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

          Branton Horsley created issue -
          Jesse Glick made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Jesse Glick made changes -
          Remote Link New: This issue links to "PR 199 (Web Link)" [ 13134 ]
          Jesse Glick made changes -
          Resolution New: Cannot Reproduce [ 5 ]
          Status Original: In Progress [ 3 ] New: Resolved [ 5 ]
          Jesse Glick made changes -
          Attachment New: log [ 30575 ]
          Attachment New: build.xml [ 30576 ]
          Attachment New: Jenkinsfile [ 30577 ]
          Attachment New: config.xml [ 30578 ]
          Attachment New: config.xml [ 30579 ]
          Branton Horsley made changes -
          Summary Original: Multibranch plugin does not pass parameters as expected New: Multibranch plugin: Modified properties do not propagate to existing branches
          Branton Horsley made changes -
          Description Original: h5. 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

          h5. Example
          Set parameter property of 'test_parameter' with a default value

          !Selection_384.png|thumbnail!

          Attempt to use the parameter
          {code}
          def param = test_parameter

          node("nodejs && swarm") {
            checkout scm
            println(param)
          ...
          {code}
          this exception gets thrown when the script is being executed.
          {code}
          groovy.lang.MissingPropertyException: No such property: test_parameter for class: groovy.lang.Binding
          {code}

          ----

          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

          New: *EDIT*: see https://issues.jenkins-ci.org/browse/JENKINS-30206?focusedCommentId=235736&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-235736
          ----
          h5. 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

          h5. Example
          Set parameter property of 'test_parameter' with a default value

          !Selection_384.png|thumbnail!

          Attempt to use the parameter
          {code}
          def param = test_parameter

          node("nodejs && swarm") {
            checkout scm
            println(param)
          ...
          {code}
          this exception gets thrown when the script is being executed.
          {code}
          groovy.lang.MissingPropertyException: No such property: test_parameter for class: groovy.lang.Binding
          {code}

          ----

          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

          Jesse Glick made changes -
          Resolution Original: Cannot Reproduce [ 5 ]
          Status Original: Resolved [ 5 ] New: Reopened [ 4 ]
          Jesse Glick made changes -
          Labels Original: plugin
          Jesse Glick made changes -
          Link New: This issue is duplicated by JENKINS-30492 [ JENKINS-30492 ]
          Jesse Glick made changes -
          Labels New: multibranch

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

              Created:
              Updated: