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

Make properties step leave non-Jenkinsfile-defined JobPropertys undisturbed

    XMLWordPrintable

Details

    Description

      See JENKINS-44621 and friends for something similar. The properties step will nuke every JobProperty on the job (other than BranchJobProperty), even if that JobProperty was defined outside of the Jenkinsfile, such as for non-multibranch jobs in the UI. We can set things up to be smarter about that and ignore any JobProperty not defined in the previous Jenkinsfile.

      Attachments

        Issue Links

          Activity

            abayer Andrew Bayer added a comment - PR up at https://github.com/jenkinsci/workflow-multibranch-plugin/pull/65

            Code changed in jenkins
            User: Andrew Bayer
            Path:
            src/main/java/org/jenkinsci/plugins/workflow/multibranch/JobPropertyStep.java
            src/main/java/org/jenkinsci/plugins/workflow/multibranch/JobPropertyTrackerAction.java
            src/main/resources/org/jenkinsci/plugins/workflow/multibranch/Messages.properties
            src/test/java/org/jenkinsci/plugins/workflow/multibranch/JobPropertyStepTest.java
            http://jenkins-ci.org/commit/workflow-multibranch-plugin/c62ca446066454e5834c7e641a3fff157e8184e1
            Log:
            [FIXED JENKINS-44848] Stop removing JobPropertys defined outside step

            There's some special logic for handling the case where the previous
            run had the `properties` step run, but does not have the
            `JobPropertyTrackerAction` on it - i.e., the first run of an existing
            job with the `properties` step after upgrading. In that case, we still
            use the old behavior of removing all existing `JobProperty`s. But in
            all future runs, only `JobProperty`s defined via `properties` will be
            removed by `properties`.

            Also removed the warning messages about removing `JobProperty`s in
            non-multibranch jobs, since, well, we don't do that any more once this
            lands.

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Andrew Bayer Path: src/main/java/org/jenkinsci/plugins/workflow/multibranch/JobPropertyStep.java src/main/java/org/jenkinsci/plugins/workflow/multibranch/JobPropertyTrackerAction.java src/main/resources/org/jenkinsci/plugins/workflow/multibranch/Messages.properties src/test/java/org/jenkinsci/plugins/workflow/multibranch/JobPropertyStepTest.java http://jenkins-ci.org/commit/workflow-multibranch-plugin/c62ca446066454e5834c7e641a3fff157e8184e1 Log: [FIXED JENKINS-44848] Stop removing JobPropertys defined outside step There's some special logic for handling the case where the previous run had the `properties` step run, but does not have the `JobPropertyTrackerAction` on it - i.e., the first run of an existing job with the `properties` step after upgrading. In that case, we still use the old behavior of removing all existing `JobProperty`s. But in all future runs, only `JobProperty`s defined via `properties` will be removed by `properties`. Also removed the warning messages about removing `JobProperty`s in non-multibranch jobs, since, well, we don't do that any more once this lands.

            People

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

              Dates

                Created:
                Updated:
                Resolved: