Job properties are not (should be !?) cumulative

24 views
Skip to first unread message

nco...@lbisa.com

unread,
May 19, 2017, 4:28:12 AM5/19/17
to Jenkins Users

Project properties are not cumulative when additional settings are set during the pipeline.


For example, if setting a Parameterized build and later in the pipeline, a Discard Old Builds is set, the Parameterized build is unset.

I had this happening when the Discard Old Builds were used in a Shared library, later in the pipeline.


When a additional propertie is set, it shouldn't unset all the previous properties, if they are not the same type (discard builds vs parameters).


Someone know if this is working as designed or is something that could be implemented?

Matt Stave

unread,
May 19, 2017, 10:24:31 AM5/19/17
to Jenkins Users
It also means if you use a JobDSL statement to generate a Pipeline job with 
  authorization {
permission('...

then if your Pipeline Jenkinsfile uses

options {
buildDiscarder(

It wipes out the permissions, since they both use the properties mechanism, which only works once. 
I'm not sure if that's a bug or missing feature, but it's annoying

harold...@lexmark.com

unread,
Jun 16, 2017, 1:34:57 PM6/16/17
to Jenkins Users
Yes it is working as designed. 
"Note that any existing properties of the job will be replaced with the list given here."

It would be nice to be able to modify job properties rather than overwrite everything. It makes for a confusing user experience when you set job properties manually, and then have them blown away when your pipeline job runs. 

I've been working around it by first reading the properties I want to preserve and then writing them back, but this is ugly and very undocumented.
Reply all
Reply to author
Forward
0 new messages