Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-44621

Declarative is over-eager in deleting job properties not defined in the Jenkinsfile

XMLWordPrintable

      Before JENKINS-44149, Declarative only called the properties step if there was a JobProperty, Trigger, or ParameterDefinition specified in the Jenkinsfile. This was, in point of fact, not the right behavior - if you had a Trigger but no other JobProperty or ParameterDefinition and then you removed that Trigger from the Jenkinsfile, it wouldn't actually get removed from the job, since there were no JobProperty/Trigger/ParameterDefinition specified in the Jenkinsfile. So...with JENKINS-44149, we changed to instead call the properties step if there were no JobProperty/Trigger/ParameterDefinition as well. Hooray, correct behavior!

      Buuuuut.

      If you had never had any of those things in your Jenkinsfile but you were using a non-mulitbranch Pipeline and specifying triggers, properties, parameters, etc in the Jenkins UI for the standalone job, those now get wiped out, whether you like it or not. That is not ideal. We really should be only removing things that were defined in the Jenkinsfile previously.

            abayer Andrew Bayer
            abayer Andrew Bayer
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: