-
Bug
-
Resolution: Fixed
-
Major
-
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
Pull request
https://github.com/jenkinsci/tikal-multijob-plugin/pull/20