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

Multibranch plugin: Modified properties do not propagate to existing branches

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • branch-api-plugin
    • None
    • Jenkins: 1.612
      Workflow (all): 1.10-beta-1
      Workflow multibranch: 1.9-beta-2

      EDIT: see https://issues.jenkins-ci.org/browse/JENKINS-30206?focusedCommentId=235736&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-235736


      Steps to reproduce:

      1. Create a multi-branch workflow project
      2. Select a git repository as a branch source
      3. Set property strategy to "named branches get different properties"
      4. Add a parameter property (as the default or as an exception that matches the branch you're building. both seem to not work) of a string or boolean with a set default value
      5. Run a branch that attempts to use that property
      6. Property does not appear to be accessible from Jenkinsfile

      Example

      Set parameter property of 'test_parameter' with a default value

      Attempt to use the parameter

      def param = test_parameter
      
      node("nodejs && swarm") {
        checkout scm
        println(param)
      ...
      

      this exception gets thrown when the script is being executed.

      groovy.lang.MissingPropertyException: No such property: test_parameter for class: groovy.lang.Binding
      

      I've tried accessing

      • boolean and string parameters
      • As properties of the 'env' object or directly (The current tutorial for the workflow-plugin suggests that parameters are exported as variables in the global scope)

      And I can't seem to get it to work in any instance

        1. log
          2 kB
          Jesse Glick
        2. build.xml
          6 kB
          Jesse Glick
        3. Jenkinsfile
          0.1 kB
          Jesse Glick
        4. config.xml
          3 kB
          Jesse Glick
        5. config.xml
          3 kB
          Jesse Glick
        6. Selection_384.png
          36 kB
          Branton Horsley

          [JENKINS-30206] Multibranch plugin: Modified properties do not propagate to existing branches

          Jesse Glick added a comment -

          Wrote a functional test for this but it passes as expected. Will check to see if I can reproduce manually in the stated combination of software versions.

          Jesse Glick added a comment - Wrote a functional test for this but it passes as expected. Will check to see if I can reproduce manually in the stated combination of software versions.

          Jesse Glick added a comment -

          Nope, working fine for me. Created Git repo with Jenkinsfile as attached. Installed 1.612, enabled experimental UC, added Workflow: Aggregator 1.10-beta-1 and Workflow: Multibranch 1.9-beta-2, restarted. Also added Git plugin (did not otherwise get selected). Created a multibranch workflow, will attach configuration, as well as generated master branch project configuration. The first build ran automatically, and printed the expected result based on the parameter default; will attach build metadata and log.

          Jesse Glick added a comment - Nope, working fine for me. Created Git repo with Jenkinsfile as attached. Installed 1.612, enabled experimental UC, added Workflow: Aggregator 1.10-beta-1 and Workflow: Multibranch 1.9-beta-2, restarted. Also added Git plugin (did not otherwise get selected). Created a multibranch workflow, will attach configuration, as well as generated master branch project configuration. The first build ran automatically, and printed the expected result based on the parameter default; will attach build metadata and log.

          Jesse Glick added a comment -

          All relevant files from my failed attempt to reproduce interactively. Compare your files with these and look for significant differences.

          Jesse Glick added a comment - All relevant files from my failed attempt to reproduce interactively. Compare your files with these and look for significant differences.

          Code changed in jenkins
          User: Jesse Glick
          Path:
          multibranch/src/test/java/org/jenkinsci/plugins/workflow/multibranch/WorkflowParameterDefinitionBranchPropertyTest.java
          http://jenkins-ci.org/commit/workflow-plugin/b19985d062703304ba317a8f82743187469a4f27
          Log:
          JENKINS-30206 WorkflowParameterDefinitionBranchProperty working fine from a test at least.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: multibranch/src/test/java/org/jenkinsci/plugins/workflow/multibranch/WorkflowParameterDefinitionBranchPropertyTest.java http://jenkins-ci.org/commit/workflow-plugin/b19985d062703304ba317a8f82743187469a4f27 Log: JENKINS-30206 WorkflowParameterDefinitionBranchProperty working fine from a test at least.

          Code changed in jenkins
          User: Jesse Glick
          Path:
          multibranch/src/test/java/org/jenkinsci/plugins/workflow/multibranch/WorkflowParameterDefinitionBranchPropertyTest.java
          http://jenkins-ci.org/commit/workflow-plugin/2c148f146a8f8cf5c4bde9bf70978d6cc3983e8c
          Log:
          Merge pull request #199 from jglick/multibranch-param-JENKINS-30206

          JENKINS-30206 Testing WorkflowParameterDefinitionBranchProperty more

          Compare: https://github.com/jenkinsci/workflow-plugin/compare/cc3469c132f0...2c148f146a8f

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: multibranch/src/test/java/org/jenkinsci/plugins/workflow/multibranch/WorkflowParameterDefinitionBranchPropertyTest.java http://jenkins-ci.org/commit/workflow-plugin/2c148f146a8f8cf5c4bde9bf70978d6cc3983e8c Log: Merge pull request #199 from jglick/multibranch-param- JENKINS-30206 JENKINS-30206 Testing WorkflowParameterDefinitionBranchProperty more Compare: https://github.com/jenkinsci/workflow-plugin/compare/cc3469c132f0...2c148f146a8f

          I think I found the problem. It appears that when you modify the properties of the root project, a new config.xml does not get generated for existing branches but will be generated for new branches.

          The original bug reported appears to be caused by
          1) create multibranch workflow
          2) check in branch (let's say 'feature/2') and notify Jenkins
          3) modify multibranch workflow to add a parameter to 'feature/*'
          4) check in feature/2 again
          5) feature/2's config.xml (workflow-root/branches/feature%2F1/config.xml) remains as it was in step 2


          If you then were to check in a new branch feature/3 (also matching feature/*), the config.xml generated for feature/2 correctly inherits the parameter, but feature/1 still will not

          Going through the above example results in the following configs:

          main config.xml
          <strategy class="jenkins.branch.NamedExceptionsBranchPropertyStrategy">
            <defaultProperties class="java.util.Arrays$ArrayList">
              <a class="jenkins.branch.BranchProperty-array">
                <jenkins.branch.UntrustedBranchProperty>
                  <publisherWhitelist class="sorted-set">
          		    ---snip---
                  </publisherWhitelist>
                </jenkins.branch.UntrustedBranchProperty>
                <org.jenkinsci.plugins.workflow.multibranch.WorkflowParameterDefinitionBranchProperty plugin="workflow-multibranch@1.9-beta-2">
                  <parameterDefinitions>
                    <hudson.model.BooleanParameterDefinition>
                      <name>RUN_TESTS</name>
                      <description></description>
                      <defaultValue>true</defaultValue>
                    </hudson.model.BooleanParameterDefinition>
                    <hudson.model.StringParameterDefinition>
                      <name>test_parameter</name>
                      <description></description>
                      <defaultValue>SHOULD_EXIST</defaultValue>
                    </hudson.model.StringParameterDefinition>
                  </parameterDefinitions>
                </org.jenkinsci.plugins.workflow.multibranch.WorkflowParameterDefinitionBranchProperty>
              </a>
            </defaultProperties>
            <namedExceptions class="java.util.Arrays$ArrayList">
              <a class="jenkins.branch.NamedExceptionsBranchPropertyStrategy$Named-array">
                <jenkins.branch.NamedExceptionsBranchPropertyStrategy_-Named>
                  ---snip---
                  <name>development,master</name>
                </jenkins.branch.NamedExceptionsBranchPropertyStrategy_-Named>
                <jenkins.branch.NamedExceptionsBranchPropertyStrategy_-Named>
                  <props class="java.util.Arrays$ArrayList">
                    <a class="jenkins.branch.BranchProperty-array">
                      <org.jenkinsci.plugins.workflow.multibranch.WorkflowParameterDefinitionBranchProperty plugin="workflow-multibranch@1.9-beta-2">
                        <parameterDefinitions>
                          <hudson.model.BooleanParameterDefinition>
                            <name>RUN_TESTS</name>
                            <description></description>
                            <defaultValue>true</defaultValue>
                          </hudson.model.BooleanParameterDefinition>
                          <hudson.model.StringParameterDefinition>
                            <name>SECOND_PROP</name>
                            <description></description>
                            <defaultValue></defaultValue>
                          </hudson.model.StringParameterDefinition>
                        </parameterDefinitions>
                      </org.jenkinsci.plugins.workflow.multibranch.WorkflowParameterDefinitionBranchProperty>
                    </a>
                  </props>
                  <name>feature/*</name>
                </jenkins.branch.NamedExceptionsBranchPropertyStrategy_-Named>
              </a>
            </namedExceptions>
          </strategy>
          

          exception for feature/*: add RUN_TESTS and SECOND_PROP. prior to this (in step 2 above the above workflow), only RUN_TESTS was defined

          'feature/2's config.xml

          created *before* multibranch config change but pushed to after the config change

          <flow-definition plugin="workflow-job@1.10-beta-1">
            <properties>
              <org.jenkinsci.plugins.workflow.multibranch.BranchJobProperty plugin="workflow-multibranch@1.9-beta-2">
                <branch plugin="branch-api@0.2-beta-4">
                  <head plugin="scm-api@0.2">
                    <name>feature/workflow-test-2</name>
                  </head>
                  <properties class="java.util.concurrent.CopyOnWriteArrayList">
                    <org.jenkinsci.plugins.workflow.multibranch.WorkflowParameterDefinitionBranchProperty plugin="workflow-multibranch@1.9-beta-2">
                      <parameterDefinitions>
                        <hudson.model.BooleanParameterDefinition>
                          <name>RUN_TESTS</name>
                          <description></description>
                          <defaultValue>true</defaultValue>
                        </hudson.model.BooleanParameterDefinition>
                      </parameterDefinitions>
                    </org.jenkinsci.plugins.workflow.multibranch.WorkflowParameterDefinitionBranchProperty>
                  </properties>
                </branch>
              </org.jenkinsci.plugins.workflow.multibranch.BranchJobProperty>
              <hudson.model.ParametersDefinitionProperty>
                <parameterDefinitions reference="../../org.jenkinsci.plugins.workflow.multibranch.BranchJobProperty/branch/properties/org.jenkinsci.plugins.workflow.multibranch.WorkflowParameterDefinitionBranchProperty/parameterDefinitions"/>
              </hudson.model.ParametersDefinitionProperty>
            </properties>
            <definition class="org.jenkinsci.plugins.workflow.multibranch.SCMBinder" plugin="workflow-multibranch@1.9-beta-2"/>
            <triggers/>
          </flow-definition>
          

          only RUN_TESTS defined

          'feature/3's config.xml

          created *after* multibranch config change and pushed to

          <flow-definition plugin="workflow-job@1.10-beta-1">
            <keepDependencies>false</keepDependencies>
            <properties>
              <org.jenkinsci.plugins.workflow.multibranch.BranchJobProperty plugin="workflow-multibranch@1.9-beta-2">
                <branch plugin="branch-api@0.2-beta-4">
                  <head plugin="scm-api@0.2">
                    <name>feature/workflow-test-3</name>
                  </head>
                  <properties class="java.util.concurrent.CopyOnWriteArrayList">
                    <org.jenkinsci.plugins.workflow.multibranch.WorkflowParameterDefinitionBranchProperty plugin="workflow-multibranch@1.9-beta-2">
                      <parameterDefinitions>
                        <hudson.model.BooleanParameterDefinition>
                          <name>RUN_TESTS</name>
                          <description></description>
                          <defaultValue>true</defaultValue>
                        </hudson.model.BooleanParameterDefinition>
                        <hudson.model.StringParameterDefinition>
                          <name>SECOND_PROP</name>
                          <description></description>
                          <defaultValue></defaultValue>
                        </hudson.model.StringParameterDefinition>
                      </parameterDefinitions>
                    </org.jenkinsci.plugins.workflow.multibranch.WorkflowParameterDefinitionBranchProperty>
                  </properties>
                </branch>
              </org.jenkinsci.plugins.workflow.multibranch.BranchJobProperty>
              <hudson.model.ParametersDefinitionProperty>
                <parameterDefinitions reference="../../org.jenkinsci.plugins.workflow.multibranch.BranchJobProperty/branch/properties/org.jenkinsci.plugins.workflow.multibranch.WorkflowParameterDefinitionBranchProperty/parameterDefinitions"/>
              </hudson.model.ParametersDefinitionProperty>
            </properties>
            <definition class="org.jenkinsci.plugins.workflow.multibranch.SCMBinder" plugin="workflow-multibranch@1.9-beta-2"/>
            <triggers/>
          </flow-definition>
          
          

          both RUN_TESTS and SECOND_PROP defined

          Branton Horsley added a comment - I think I found the problem. It appears that when you modify the properties of the root project, a new config.xml does not get generated for existing branches but will be generated for new branches. The original bug reported appears to be caused by 1) create multibranch workflow 2) check in branch (let's say 'feature/2') and notify Jenkins 3) modify multibranch workflow to add a parameter to 'feature/*' 4) check in feature/2 again 5) feature/2's config.xml (workflow-root/branches/feature%2F1/config.xml) remains as it was in step 2 If you then were to check in a new branch feature/3 (also matching feature/*), the config.xml generated for feature/2 correctly inherits the parameter, but feature/1 still will not Going through the above example results in the following configs: main config.xml <strategy class= "jenkins.branch.NamedExceptionsBranchPropertyStrategy" > <defaultProperties class= "java.util.Arrays$ArrayList" > <a class= "jenkins.branch.BranchProperty-array" > <jenkins.branch.UntrustedBranchProperty> <publisherWhitelist class= "sorted-set" > ---snip--- </publisherWhitelist> </jenkins.branch.UntrustedBranchProperty> <org.jenkinsci.plugins.workflow.multibranch.WorkflowParameterDefinitionBranchProperty plugin= "workflow-multibranch@1.9-beta-2" > <parameterDefinitions> <hudson.model.BooleanParameterDefinition> <name>RUN_TESTS</name> <description></description> <defaultValue> true </defaultValue> </hudson.model.BooleanParameterDefinition> <hudson.model.StringParameterDefinition> <name>test_parameter</name> <description></description> <defaultValue>SHOULD_EXIST</defaultValue> </hudson.model.StringParameterDefinition> </parameterDefinitions> </org.jenkinsci.plugins.workflow.multibranch.WorkflowParameterDefinitionBranchProperty> </a> </defaultProperties> <namedExceptions class= "java.util.Arrays$ArrayList" > <a class= "jenkins.branch.NamedExceptionsBranchPropertyStrategy$Named-array" > <jenkins.branch.NamedExceptionsBranchPropertyStrategy_-Named> ---snip--- <name>development,master</name> </jenkins.branch.NamedExceptionsBranchPropertyStrategy_-Named> <jenkins.branch.NamedExceptionsBranchPropertyStrategy_-Named> <props class= "java.util.Arrays$ArrayList" > <a class= "jenkins.branch.BranchProperty-array" > <org.jenkinsci.plugins.workflow.multibranch.WorkflowParameterDefinitionBranchProperty plugin= "workflow-multibranch@1.9-beta-2" > <parameterDefinitions> <hudson.model.BooleanParameterDefinition> <name>RUN_TESTS</name> <description></description> <defaultValue> true </defaultValue> </hudson.model.BooleanParameterDefinition> <hudson.model.StringParameterDefinition> <name>SECOND_PROP</name> <description></description> <defaultValue></defaultValue> </hudson.model.StringParameterDefinition> </parameterDefinitions> </org.jenkinsci.plugins.workflow.multibranch.WorkflowParameterDefinitionBranchProperty> </a> </props> <name>feature/*</name> </jenkins.branch.NamedExceptionsBranchPropertyStrategy_-Named> </a> </namedExceptions> </strategy> exception for feature/*: add RUN_TESTS and SECOND_PROP. prior to this (in step 2 above the above workflow), only RUN_TESTS was defined 'feature/2's config.xml created * before * multibranch config change but pushed to after the config change <flow-definition plugin= "workflow-job@1.10-beta-1" > <properties> <org.jenkinsci.plugins.workflow.multibranch.BranchJobProperty plugin= "workflow-multibranch@1.9-beta-2" > <branch plugin= "branch-api@0.2-beta-4" > <head plugin= "scm-api@0.2" > <name>feature/workflow-test-2</name> </head> <properties class= "java.util.concurrent.CopyOnWriteArrayList" > <org.jenkinsci.plugins.workflow.multibranch.WorkflowParameterDefinitionBranchProperty plugin= "workflow-multibranch@1.9-beta-2" > <parameterDefinitions> <hudson.model.BooleanParameterDefinition> <name>RUN_TESTS</name> <description></description> <defaultValue> true </defaultValue> </hudson.model.BooleanParameterDefinition> </parameterDefinitions> </org.jenkinsci.plugins.workflow.multibranch.WorkflowParameterDefinitionBranchProperty> </properties> </branch> </org.jenkinsci.plugins.workflow.multibranch.BranchJobProperty> <hudson.model.ParametersDefinitionProperty> <parameterDefinitions reference= "../../org.jenkinsci.plugins.workflow.multibranch.BranchJobProperty/branch/properties/org.jenkinsci.plugins.workflow.multibranch.WorkflowParameterDefinitionBranchProperty/parameterDefinitions" /> </hudson.model.ParametersDefinitionProperty> </properties> <definition class= "org.jenkinsci.plugins.workflow.multibranch.SCMBinder" plugin= "workflow-multibranch@1.9-beta-2" /> <triggers/> </flow-definition> only RUN_TESTS defined 'feature/3's config.xml created * after * multibranch config change and pushed to <flow-definition plugin= "workflow-job@1.10-beta-1" > <keepDependencies> false </keepDependencies> <properties> <org.jenkinsci.plugins.workflow.multibranch.BranchJobProperty plugin= "workflow-multibranch@1.9-beta-2" > <branch plugin= "branch-api@0.2-beta-4" > <head plugin= "scm-api@0.2" > <name>feature/workflow-test-3</name> </head> <properties class= "java.util.concurrent.CopyOnWriteArrayList" > <org.jenkinsci.plugins.workflow.multibranch.WorkflowParameterDefinitionBranchProperty plugin= "workflow-multibranch@1.9-beta-2" > <parameterDefinitions> <hudson.model.BooleanParameterDefinition> <name>RUN_TESTS</name> <description></description> <defaultValue> true </defaultValue> </hudson.model.BooleanParameterDefinition> <hudson.model.StringParameterDefinition> <name>SECOND_PROP</name> <description></description> <defaultValue></defaultValue> </hudson.model.StringParameterDefinition> </parameterDefinitions> </org.jenkinsci.plugins.workflow.multibranch.WorkflowParameterDefinitionBranchProperty> </properties> </branch> </org.jenkinsci.plugins.workflow.multibranch.BranchJobProperty> <hudson.model.ParametersDefinitionProperty> <parameterDefinitions reference= "../../org.jenkinsci.plugins.workflow.multibranch.BranchJobProperty/branch/properties/org.jenkinsci.plugins.workflow.multibranch.WorkflowParameterDefinitionBranchProperty/parameterDefinitions" /> </hudson.model.ParametersDefinitionProperty> </properties> <definition class= "org.jenkinsci.plugins.workflow.multibranch.SCMBinder" plugin= "workflow-multibranch@1.9-beta-2" /> <triggers/> </flow-definition> both RUN_TESTS and SECOND_PROP defined

          Jesse Glick added a comment -

          I see. Will try to reproduce when I get a chance.

          Jesse Glick added a comment - I see. Will try to reproduce when I get a chance.

          Jesse Glick added a comment -

          Plan to resolve differently.

          Jesse Glick added a comment - Plan to resolve differently.

          Jesse Glick added a comment -

          Actually should still be fixed since it could affect Literate projects.

          Jesse Glick added a comment - Actually should still be fixed since it could affect Literate projects.

          Jesse Glick added a comment -

          Possibly because BranchProjectFactory.decorate calls BulkChange.abort without commit, so save is never called? That would explain lack of update to XML, but the user would not normally notice since the in-memory version would be correct. Or perhaps decorate is just not getting called at all for an existing project?

          Jesse Glick added a comment - Possibly because BranchProjectFactory.decorate calls BulkChange.abort without commit , so save is never called? That would explain lack of update to XML, but the user would not normally notice since the in-memory version would be correct. Or perhaps decorate is just not getting called at all for an existing project?

          Jesse Glick added a comment -

          Now that workflow-multibranch has switched to the properties step, this issue no longer affects Workflow.

          Jesse Glick added a comment - Now that workflow-multibranch has switched to the properties step, this issue no longer affects Workflow.

          Code changed in jenkins
          User: Jesse Glick
          Path:
          multibranch/src/test/java/org/jenkinsci/plugins/workflow/multibranch/WorkflowParameterDefinitionBranchPropertyTest.java
          http://jenkins-ci.org/commit/workflow-multibranch-plugin/9c7fab4f6ba57460e50f94ffc08d181111a1dee9
          Log:
          JENKINS-30206 WorkflowParameterDefinitionBranchProperty working fine from a test at least.
          Originally-Committed-As: b19985d062703304ba317a8f82743187469a4f27

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: multibranch/src/test/java/org/jenkinsci/plugins/workflow/multibranch/WorkflowParameterDefinitionBranchPropertyTest.java http://jenkins-ci.org/commit/workflow-multibranch-plugin/9c7fab4f6ba57460e50f94ffc08d181111a1dee9 Log: JENKINS-30206 WorkflowParameterDefinitionBranchProperty working fine from a test at least. Originally-Committed-As: b19985d062703304ba317a8f82743187469a4f27

          Code changed in jenkins
          User: Jesse Glick
          Path:
          multibranch/src/test/java/org/jenkinsci/plugins/workflow/multibranch/WorkflowParameterDefinitionBranchPropertyTest.java
          http://jenkins-ci.org/commit/workflow-multibranch-plugin/8e3c946b5cf47b59cc4eee8a7d0f39a679ac617d
          Log:
          Merge pull request #199 from jglick/multibranch-param-JENKINS-30206

          JENKINS-30206 Testing WorkflowParameterDefinitionBranchProperty more
          Originally-Committed-As: 2c148f146a8f8cf5c4bde9bf70978d6cc3983e8c

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: multibranch/src/test/java/org/jenkinsci/plugins/workflow/multibranch/WorkflowParameterDefinitionBranchPropertyTest.java http://jenkins-ci.org/commit/workflow-multibranch-plugin/8e3c946b5cf47b59cc4eee8a7d0f39a679ac617d Log: Merge pull request #199 from jglick/multibranch-param- JENKINS-30206 JENKINS-30206 Testing WorkflowParameterDefinitionBranchProperty more Originally-Committed-As: 2c148f146a8f8cf5c4bde9bf70978d6cc3983e8c

          Jesse Glick added a comment -

          Might affect Pipeline as of JENKINS-32396.

          Jesse Glick added a comment - Might affect Pipeline as of JENKINS-32396 .

          Code changed in jenkins
          User: Jesse Glick
          Path:
          src/test/java/org/jenkinsci/plugins/workflow/multibranch/JobPropertyStepTest.java
          http://jenkins-ci.org/commit/workflow-multibranch-plugin/a9b45d7d94ab27b1eba23fafb2672d72299c0ace
          Log:
          https://github.com/jenkinsci/pipeline-plugin/pull/209 in its final form did not actually try to reproduce JENKINS-30206.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/test/java/org/jenkinsci/plugins/workflow/multibranch/JobPropertyStepTest.java http://jenkins-ci.org/commit/workflow-multibranch-plugin/a9b45d7d94ab27b1eba23fafb2672d72299c0ace Log: https://github.com/jenkinsci/pipeline-plugin/pull/209 in its final form did not actually try to reproduce JENKINS-30206 .

          Code changed in jenkins
          User: Jesse Glick
          Path:
          src/main/java/org/jenkinsci/plugins/workflow/multibranch/WorkflowBranchProjectFactory.java
          src/test/java/org/jenkinsci/plugins/workflow/multibranch/NoTriggerBranchPropertyWorkflowTest.java
          http://jenkins-ci.org/commit/workflow-multibranch-plugin/18077ec14b79dc5a68c1b1ae3d853af6dee32255
          Log:
          JENKINS-30206 Fixed branch property propagation.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/main/java/org/jenkinsci/plugins/workflow/multibranch/WorkflowBranchProjectFactory.java src/test/java/org/jenkinsci/plugins/workflow/multibranch/NoTriggerBranchPropertyWorkflowTest.java http://jenkins-ci.org/commit/workflow-multibranch-plugin/18077ec14b79dc5a68c1b1ae3d853af6dee32255 Log: JENKINS-30206 Fixed branch property propagation.

          Code changed in jenkins
          User: Jesse Glick
          Path:
          pom.xml
          src/main/java/org/jenkinsci/plugins/workflow/multibranch/WorkflowBranchProjectFactory.java
          src/test/java/org/jenkinsci/plugins/workflow/multibranch/JobPropertyStepTest.java
          src/test/java/org/jenkinsci/plugins/workflow/multibranch/NoTriggerBranchPropertyWorkflowTest.java
          src/test/java/org/jenkinsci/plugins/workflow/multibranch/WorkflowMultiBranchProjectTest.java
          http://jenkins-ci.org/commit/workflow-multibranch-plugin/5574409ef9334fb1774137627fe73f60174da515
          Log:
          Merge pull request #12 from jglick/update-no-trigger-JENKINS-32396-JENKINS-30206

          JENKINS-30206 JENKINS-32396 Honor changes to NoTriggerBranchProperty

          Compare: https://github.com/jenkinsci/workflow-multibranch-plugin/compare/eb538b808ee8...5574409ef933

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: pom.xml src/main/java/org/jenkinsci/plugins/workflow/multibranch/WorkflowBranchProjectFactory.java src/test/java/org/jenkinsci/plugins/workflow/multibranch/JobPropertyStepTest.java src/test/java/org/jenkinsci/plugins/workflow/multibranch/NoTriggerBranchPropertyWorkflowTest.java src/test/java/org/jenkinsci/plugins/workflow/multibranch/WorkflowMultiBranchProjectTest.java http://jenkins-ci.org/commit/workflow-multibranch-plugin/5574409ef9334fb1774137627fe73f60174da515 Log: Merge pull request #12 from jglick/update-no-trigger- JENKINS-32396 - JENKINS-30206 JENKINS-30206 JENKINS-32396 Honor changes to NoTriggerBranchProperty Compare: https://github.com/jenkinsci/workflow-multibranch-plugin/compare/eb538b808ee8...5574409ef933

          Sverre Moe added a comment - - edited

          I had the same problem accessing the defined parameter. The parameter was not accessible an an environment parameter. I found an example that worked for me.

          def param = false
          if (getBinding().hasVariable("MY_PARAM")) {
              param = MY_PARAM
          }
          

          Sverre Moe added a comment - - edited I had the same problem accessing the defined parameter. The parameter was not accessible an an environment parameter. I found an example that worked for me. def param = false if (getBinding().hasVariable( "MY_PARAM" )) { param = MY_PARAM }

          jglick is this still in progress or is it done?

          Stephen Connolly added a comment - jglick is this still in progress or is it done?

          Torben Knerr added a comment - - edited

          stephenconnolly jglick I have seen the branch properties being successfully propagated to existing branch builds, looks like they become effective with the next branch scanning.

          However, I experienced a bug in the UI where only the "Suppress automatic SCM triggering" property was available, but none of the other branch properties. I could still add the others via editing the config.xml directly or using JobDSL. They were then shown in the UI as configured, but still not available from the dropdown if you wanted to add them via the UI. See also:
          https://issues.jenkins-ci.org/browse/JENKINS-30519?focusedCommentId=325601&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-325601

          This was with Jenkins 2.73.1 and branch-api-plugin 2.0.14

          Torben Knerr added a comment - - edited stephenconnolly jglick I have seen the branch properties being successfully propagated to existing branch builds, looks like they become effective with the next branch scanning. However, I experienced a bug in the UI where only the "Suppress automatic SCM triggering" property was available, but none of the other branch properties. I could still add the others via editing the config.xml directly or using JobDSL. They were then shown in the UI as configured, but still not available from the dropdown if you wanted to add them via the UI. See also: https://issues.jenkins-ci.org/browse/JENKINS-30519?focusedCommentId=325601&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-325601 This was with Jenkins 2.73.1 and branch-api-plugin 2.0.14

            Unassigned Unassigned
            notnarb Branton Horsley
            Votes:
            6 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated: