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

Multijob builder creates two ParameterActions when using parameters from triggering job.

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • multijob-plugin
    • None
    • Multijob plugin 1.7
      Jenkins 1.498

      From Email Chain
      https://groups.google.com/d/topic/jenkinsci-dev/mqyMUbLT-Ac/discussion

      The job is triggered by a phase in a Multijob (Jenkins Multijob plugin v1.7), with the default "current job parameters" setting.

      This produces a build.xml with two ParametersAction elements: the first is from the Multijob build which triggered this job, the second is the default parameters for the current job.

      The buildstep sees the first block, but the publisher sees the second block.

      If I use a parameterized trigger to launch a third job, that one has only one set of parameters, and works as expected. It also managed to capture the parameters as seen by the buildstep, so it has the value I put into the original Multijob build page.

      Does this imply that the problem is in the Multijob plugin?

      Just looked at the case you mentioned and can reproduce it, from what I can see in the Multijob plugin, it creates both of the Parameter actions itself, and does not seem to combine them.

      and then due to the way that the Enviroment variables are provided to the different items via build.getBuildVariables() (added to launcher) and via build.getEnviroment() causes you to only see one of the sets of the values as they override eachother.

      at [1] in the code it creates the default parameters from the job to be triggered. not added to the actions list.
      At [2] it gets the parameters from the build that is triggering it and merges it with any actions already added to the list. if none already exist it creates a new one and adds it.
      At [3] It gets additional actions from the configs (Add Parameters items) and merges/adds these as needed

      At [4] it then adds the default parameters to the action list created at [1] which I think is the error causing the duplicate ParametersAction.
      These two lines should be moved to [1] and added to the action list first, and all other code will merge with these default Parameters overriding as necessary.

      Please create a Issue on that plugin reporting this.
      I have created an Issue for this

      [1] https://github.com/jenkinsci/tikal-multijob-plugin/blob/master/src/main/java/com/tikal/jenkins/plugins/multijob/PhaseJobsConfig.java#L292
      [2] https://github.com/jenkinsci/tikal-multijob-plugin/blob/master/src/main/java/com/tikal/jenkins/plugins/multijob/PhaseJobsConfig.java#L297
      [3] https://github.com/jenkinsci/tikal-multijob-plugin/blob/master/src/main/java/com/tikal/jenkins/plugins/multijob/PhaseJobsConfig.java#L312
      [4] https://github.com/jenkinsci/tikal-multijob-plugin/blob/master/src/main/java/com/tikal/jenkins/plugins/multijob/PhaseJobsConfig.java#L321

          [JENKINS-16715] Multijob builder creates two ParameterActions when using parameters from triggering job.

          cjo9900 added a comment -

          cjo9900 added a comment - Pull request https://github.com/jenkinsci/tikal-multijob-plugin/pull/20

          Code changed in jenkins
          User: cjo9900
          Path:
          src/main/java/com/tikal/jenkins/plugins/multijob/PhaseJobsConfig.java
          src/test/java/com/tikal/jenkins/plugins/multijob/test/PhaseJobsConfigTest.java
          http://jenkins-ci.org/commit/tikal-multijob-plugin/ec7cf80ae0169911645d42c8206bb4231b1f9954
          Log:
          [FIXED JENKINS-16715] Make sure all ParametersActions are combined correctly

          Made sure that all ParameterSActions are combined together,
          Forced a set order Parameter overriding:
          Default values from triggered project
          Overridded by Parameters in current Build (if enabled)
          Overridded by Parameters added configs.

          Added test cases for most/all of the combinations above.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: cjo9900 Path: src/main/java/com/tikal/jenkins/plugins/multijob/PhaseJobsConfig.java src/test/java/com/tikal/jenkins/plugins/multijob/test/PhaseJobsConfigTest.java http://jenkins-ci.org/commit/tikal-multijob-plugin/ec7cf80ae0169911645d42c8206bb4231b1f9954 Log: [FIXED JENKINS-16715] Make sure all ParametersActions are combined correctly Made sure that all ParameterSActions are combined together, Forced a set order Parameter overriding: Default values from triggered project Overridded by Parameters in current Build (if enabled) Overridded by Parameters added configs. Added test cases for most/all of the combinations above.

          Code changed in jenkins
          User: ronil
          Path:
          src/main/java/com/tikal/jenkins/plugins/multijob/PhaseJobsConfig.java
          src/test/java/com/tikal/jenkins/plugins/multijob/test/PhaseJobsConfigTest.java
          http://jenkins-ci.org/commit/tikal-multijob-plugin/458cbab3a03fc9e0eea94d8310d1cbd48221620f
          Log:
          Merge pull request #20 from cjo9900/JENKINS-16715

          [FIXED JENKINS-16715] Make sure all ParametersActions are combined corre...

          Compare: https://github.com/jenkinsci/tikal-multijob-plugin/compare/de71f22cca88...458cbab3a03f


          You received this message because you are subscribed to the Google Groups "Jenkins Commits" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-commits+unsubscribe@googlegroups.com.
          For more options, visit https://groups.google.com/groups/opt_out.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: ronil Path: src/main/java/com/tikal/jenkins/plugins/multijob/PhaseJobsConfig.java src/test/java/com/tikal/jenkins/plugins/multijob/test/PhaseJobsConfigTest.java http://jenkins-ci.org/commit/tikal-multijob-plugin/458cbab3a03fc9e0eea94d8310d1cbd48221620f Log: Merge pull request #20 from cjo9900/ JENKINS-16715 [FIXED JENKINS-16715] Make sure all ParametersActions are combined corre... Compare: https://github.com/jenkinsci/tikal-multijob-plugin/compare/de71f22cca88...458cbab3a03f – You received this message because you are subscribed to the Google Groups "Jenkins Commits" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-commits+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out .

            Unassigned Unassigned
            cjo9900 cjo9900
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: