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

'properties' step should warn on property deletion in non-multibranch jobs

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Since you can use the properties step on non-multibranch jobs, you can unknowingly overwrite or delete all existing JobProperty defined through the UI. I haven't come up with a good solution for this in terms of workflow, but at the very least, we can warn the user when this happens, so that they aren't completely mystified if it happens to them.

        Attachments

          Issue Links

            Activity

            Hide
            abayer Andrew Bayer added a comment -
            Show
            abayer Andrew Bayer added a comment - PR up at https://github.com/jenkinsci/workflow-multibranch-plugin/pull/23 - this is on top of https://github.com/jenkinsci/workflow-multibranch-plugin/pull/20 , so it may look a little messy at first glance.
            Hide
            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/test/java/org/jenkinsci/plugins/workflow/multibranch/JobPropertyStepTest.java
            http://jenkins-ci.org/commit/workflow-multibranch-plugin/232eb756df59322a1281af2eddd59bec8e32e1ef
            Log:
            [FIXED JENKINS-37005] Warn users using properties outside multibranch

            This doesn't change actual behavior. It simply logs to the console
            when the properties step is invoked outside of a multibranch job,
            including listing any properties that are removed. The goal is to
            decrease confusion if/when a non-multibranch job suddenly loses its
            triggers, etc due to a properties step being executed in the job.

            Show
            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/test/java/org/jenkinsci/plugins/workflow/multibranch/JobPropertyStepTest.java http://jenkins-ci.org/commit/workflow-multibranch-plugin/232eb756df59322a1281af2eddd59bec8e32e1ef Log: [FIXED JENKINS-37005] Warn users using properties outside multibranch This doesn't change actual behavior. It simply logs to the console when the properties step is invoked outside of a multibranch job, including listing any properties that are removed. The goal is to decrease confusion if/when a non-multibranch job suddenly loses its triggers, etc due to a properties step being executed in the job.
            Hide
            brianeray Brian Ray added a comment -

            FWIW I was pleasantly surprised that this step works for non-multibranch projects. We'll probably rely on it to keep more of the job configuration under source control.

            That said, the warning message is a good idea.

            Show
            brianeray Brian Ray added a comment - FWIW I was pleasantly surprised that this step works for non-multibranch projects. We'll probably rely on it to keep more of the job configuration under source control. That said, the warning message is a good idea.
            Hide
            abayer Andrew Bayer added a comment -

            Whoops, forgot this was merged. =)

            Show
            abayer Andrew Bayer added a comment - Whoops, forgot this was merged. =)

              People

              • Assignee:
                abayer Andrew Bayer
                Reporter:
                abayer Andrew Bayer
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: