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

Regression, Promoted builds plugin not expanding job parameters on immediate promote after build.

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • promoted-builds-plugin
    • None
    • Linux

      Up until upgrading to 2.17 I could reference my build parameters (from "This build is parameterized" section). Now these parameters are silently replace with empty strings when the promotion is run automatically after the build.
      If I run the promotion again, it works.

      From the promotion job:
      ${RELEASES}/${PROMOTED_NUMBER}/${CONFIG}/develop-${CONFIG}-${PROMOTED_NUMBER}.ipa

      I logged the env for a promotion run immediately after and one run later manually.
      For the immediate case, all my parameters above, CONFIG, RELEASES are null whereas they are correct for the later manual invocation.

      Note that promoted builds specific parameters are OK, it's just all the rest that are not.

      What makes this worse is that the jenkins updater doesn't offer a downgrade option for this plugin.

          [JENKINS-22679] Regression, Promoted builds plugin not expanding job parameters on immediate promote after build.

          Bruce Edge added a comment -

          Confirmed that reverting to 2.15 fixes the problem.

          For anyone else hitting this, download the source from here:
          https://github.com/jenkinsci/promoted-builds-plugin/archive/promoted-builds-2.15.tar.gz
          unpack, mvn clean package, then copy promoted-builds-plugin-promoted-builds-2.15/target/promoted-builds.hpi to JENKINS_ROOT/plugins.promoted-builds.jpi
          note the extension change.

          Bruce Edge added a comment - Confirmed that reverting to 2.15 fixes the problem. For anyone else hitting this, download the source from here: https://github.com/jenkinsci/promoted-builds-plugin/archive/promoted-builds-2.15.tar.gz unpack, mvn clean package, then copy promoted-builds-plugin-promoted-builds-2.15/target/promoted-builds.hpi to JENKINS_ROOT/plugins.promoted-builds.jpi note the extension change.

          Jamey Graham added a comment - or, instead of building... http://updates.jenkins-ci.org/download/plugins/promoted-builds/2.15/promoted-builds.hpi https://wiki.jenkins-ci.org/display/JENKINS/Plugins#Plugins-Byhand

          Code changed in jenkins
          User: Jesse Glick
          Path:
          src/main/java/hudson/matrix/FilterScript.java
          http://jenkins-ci.org/commit/matrix-project-plugin/a40e83f731884c05fc15af13786d4306aec127a0
          Log:
          Merge pull request #1 from mc1arke/JENKINS-22679

          [FIXED JENKINS-22879] Fix Groovy classloading issue.

          Compare: https://github.com/jenkinsci/matrix-project-plugin/compare/51ac5ab4ef3a...a40e83f73188

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/main/java/hudson/matrix/FilterScript.java http://jenkins-ci.org/commit/matrix-project-plugin/a40e83f731884c05fc15af13786d4306aec127a0 Log: Merge pull request #1 from mc1arke/ JENKINS-22679 [FIXED JENKINS-22879] Fix Groovy classloading issue. Compare: https://github.com/jenkinsci/matrix-project-plugin/compare/51ac5ab4ef3a...a40e83f73188

          Bruce Edge added a comment -

          Problem still exists in jenkins update site.

          What's needed to get the above merge pull into the global plugin update site?

          Bruce Edge added a comment - Problem still exists in jenkins update site. What's needed to get the above merge pull into the global plugin update site?

          Wilco Greven added a comment - - edited

          This seems to be caused by the fix for JENKINS-22005. Reverting to 2.16 fixes the problem. I can reproduce the issue using the following steps:

          1) Create a job job1 with a string parameter named param1.
          2) Create a job job2 with a string parameter named param1.
          3) Create a job job3 with a string parameter named param1.
          4) Add a promotion process promotion1 to job3 with criteria 'Only when manually approved'. Add an action 'Trigger parameterized build on other projects' to the promotion which triggers job1 with predefined parameters 'param1=${param1}'.
          5) Add a promotion process promotion2 to job3 with criteria 'When the following downstream projects build successfully' on downstream project job1. Add an action 'Trigger parameterized build on other projects' to the promotion which triggers job2 with predefined parameters 'param1=${param1}'.
          6) Run job3 with param1=someString.
          7) Manually approve promotion1. You will see that job1 is correctly run with param1=someString.
          8) Promotion process promotion2 will now automatically start job2. But job2 will be run with param1=${param1} which is not correct.

          Wilco Greven added a comment - - edited This seems to be caused by the fix for JENKINS-22005 . Reverting to 2.16 fixes the problem. I can reproduce the issue using the following steps: 1) Create a job job1 with a string parameter named param1. 2) Create a job job2 with a string parameter named param1. 3) Create a job job3 with a string parameter named param1. 4) Add a promotion process promotion1 to job3 with criteria 'Only when manually approved'. Add an action 'Trigger parameterized build on other projects' to the promotion which triggers job1 with predefined parameters 'param1=${param1}'. 5) Add a promotion process promotion2 to job3 with criteria 'When the following downstream projects build successfully' on downstream project job1. Add an action 'Trigger parameterized build on other projects' to the promotion which triggers job2 with predefined parameters 'param1=${param1}'. 6) Run job3 with param1=someString. 7) Manually approve promotion1. You will see that job1 is correctly run with param1=someString. 8) Promotion process promotion2 will now automatically start job2. But job2 will be run with param1=${param1} which is not correct.

          Robert Liotta added a comment -

          Hello.

          I just updated to the 2.18 SNAPSHOT that was posted a few days back to fix the re-execute button. I have now run into this issue. Will this get fixed for 2.18?

          Robert Liotta added a comment - Hello. I just updated to the 2.18 SNAPSHOT that was posted a few days back to fix the re-execute button. I have now run into this issue. Will this get fixed for 2.18?

          Steve Jansen added a comment -

          Confirmed reverting to 2.16 fixes the problem for me.

          Steve Jansen added a comment - Confirmed reverting to 2.16 fixes the problem for me.

          Hi, I've prepared a pull request with a fix for the issue described. I would kindly appreciate any committer picking it up

          https://github.com/jenkinsci/promoted-builds-plugin/pull/50

          Bartosz Czerwinski added a comment - Hi, I've prepared a pull request with a fix for the issue described. I would kindly appreciate any committer picking it up https://github.com/jenkinsci/promoted-builds-plugin/pull/50

          Bruce Edge added a comment -

          +1 for the pull request.

          Bruce Edge added a comment - +1 for the pull request.

          Bruce Edge added a comment -

          The above pull request is closed, is this issue fixed?
          There's no indication from the change logs that this was addressed.

          Bruce Edge added a comment - The above pull request is closed, is this issue fixed? There's no indication from the change logs that this was addressed.

          Bruce Edge added a comment -

          This bug still exists in 2.20.

          Build parameters are no longer expanded. My promotion directory looks like this after any version past 2.15:

          drwxr-xr-x 3 jenkins nogroup 4096 Apr 1 12:39 ${PROJECT}

          instead of

          drwxr-xr-x 3 jenkins nogroup 4096 Apr 1 12:39 Sling-Controller

          Where PROJECT=Sling-Controller as defined as a build-parameter in the job.

          Bruce Edge added a comment - This bug still exists in 2.20. Build parameters are no longer expanded. My promotion directory looks like this after any version past 2.15: drwxr-xr-x 3 jenkins nogroup 4096 Apr 1 12:39 ${PROJECT} instead of drwxr-xr-x 3 jenkins nogroup 4096 Apr 1 12:39 Sling-Controller Where PROJECT=Sling-Controller as defined as a build-parameter in the job.

          Bartosz Czerwinski added a comment - - edited

          Not sure... at that time I was told that there was another pull request fixing the issue with preferable solution, but it seems it hasn't been merged and it is still pending in open state (https://github.com/jenkinsci/promoted-builds-plugin/pull/49). Welcome to open-source world

          Bartosz Czerwinski added a comment - - edited Not sure... at that time I was told that there was another pull request fixing the issue with preferable solution, but it seems it hasn't been merged and it is still pending in open state ( https://github.com/jenkinsci/promoted-builds-plugin/pull/49 ). Welcome to open-source world

          Bruce Edge added a comment -

          Here's some more info form a promotion log:

          build BapSshPromotionPublisherPlugin[delegate=BapSshPublisherPlugin[consolePrefix=SSH: ,delegate=BPInstanceConfig[publishers=[BapSshPublisher[configName=boot-1.qa,verbose=false,transfers=[BapSshTransfer[sourceFiles=*,excludes=,removePrefix=,remoteDirectory=${PROJECT}/${BRANCH}/QA/${BUILD_NUMBER},remoteDirectorySDF=false,flatten=false,cleanRemote=false,noDefaultExcludes=false,makeEmptyDirs=false,patternSeparator=[, ]+,execCommand=,execTimeout=120000,pseudoTty=false]],useWorkspaceInPromotion=false,usePromotionTimestamp=false,retry=<null>,label=<null>,credentials=<null>]],continueOnError=false,failOnError=false,masterNodeName=<null>,alwaysPublishFromMaster=false,paramPublish=<null>]]] SUCCES

          note the "remoteDirectory=${PROJECT}/${BRANCH}/QA/${BUILD_NUMBER},"

          Bruce Edge added a comment - Here's some more info form a promotion log: build BapSshPromotionPublisherPlugin[delegate=BapSshPublisherPlugin[consolePrefix=SSH: ,delegate=BPInstanceConfig[publishers=[BapSshPublisher[configName=boot-1.qa,verbose=false,transfers=[BapSshTransfer[sourceFiles=*,excludes=,removePrefix=,remoteDirectory=${PROJECT}/${BRANCH}/QA/${BUILD_NUMBER},remoteDirectorySDF=false,flatten=false,cleanRemote=false,noDefaultExcludes=false,makeEmptyDirs=false,patternSeparator= [, ] +,execCommand=,execTimeout=120000,pseudoTty=false]],useWorkspaceInPromotion=false,usePromotionTimestamp=false,retry=<null>,label=<null>,credentials=<null>]],continueOnError=false,failOnError=false,masterNodeName=<null>,alwaysPublishFromMaster=false,paramPublish=<null>]]] SUCCES note the "remoteDirectory=${PROJECT}/${BRANCH}/QA/${BUILD_NUMBER},"

          Wilco Greven added a comment -

          Yep, it's waiting there for almost half a year now. It's pretty frustrating that it still hasn't been merged.

          Wilco Greven added a comment - Yep, it's waiting there for almost half a year now. It's pretty frustrating that it still hasn't been merged.

          Andy Smith added a comment - - edited

          Getting hit by this (I believe), cannot take EnvInject values in my promotion step

          Andy Smith added a comment - - edited Getting hit by this (I believe), cannot take EnvInject values in my promotion step

          Code changed in jenkins
          User: Wilco Greven
          Path:
          src/main/java/hudson/plugins/promoted_builds/Promotion.java
          src/main/java/hudson/plugins/promoted_builds/PromotionProcess.java
          src/test/java/hudson/plugins/promoted_builds/conditions/SelfPromotionTest.java
          http://jenkins-ci.org/commit/promoted-builds-plugin/80156830fe9a6da762bb6269b79c3f3b12dbede8
          Log:
          JENKINS-22679
          Don't skip passing the target build parameters to the promotion build when the promotion build doesn't have its own parameters.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Wilco Greven Path: src/main/java/hudson/plugins/promoted_builds/Promotion.java src/main/java/hudson/plugins/promoted_builds/PromotionProcess.java src/test/java/hudson/plugins/promoted_builds/conditions/SelfPromotionTest.java http://jenkins-ci.org/commit/promoted-builds-plugin/80156830fe9a6da762bb6269b79c3f3b12dbede8 Log: JENKINS-22679 Don't skip passing the target build parameters to the promotion build when the promotion build doesn't have its own parameters.

          Code changed in jenkins
          User: Steven Christou
          Path:
          src/main/java/hudson/plugins/promoted_builds/Promotion.java
          src/main/java/hudson/plugins/promoted_builds/PromotionProcess.java
          src/test/java/hudson/plugins/promoted_builds/conditions/SelfPromotionTest.java
          http://jenkins-ci.org/commit/promoted-builds-plugin/34157a212e757c4306fdd7be4db855f1b3351e3a
          Log:
          Merge pull request #49 from wgreven/JENKINS-22679

          JENKINS-22679 Pass the target build parameters to the promotion build when the promotion build doesn't have its own parameters.

          Compare: https://github.com/jenkinsci/promoted-builds-plugin/compare/726f7a0966f5...34157a212e75

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Steven Christou Path: src/main/java/hudson/plugins/promoted_builds/Promotion.java src/main/java/hudson/plugins/promoted_builds/PromotionProcess.java src/test/java/hudson/plugins/promoted_builds/conditions/SelfPromotionTest.java http://jenkins-ci.org/commit/promoted-builds-plugin/34157a212e757c4306fdd7be4db855f1b3351e3a Log: Merge pull request #49 from wgreven/ JENKINS-22679 JENKINS-22679 Pass the target build parameters to the promotion build when the promotion build doesn't have its own parameters. Compare: https://github.com/jenkinsci/promoted-builds-plugin/compare/726f7a0966f5...34157a212e75

          Bruce Edge added a comment - - edited

          Still broken in 2.21 release.

          Was pull request #49 from wgreven/JENKINS-22679 not merged?

          Snippet from promotion log using 2.21 shows:
          + relpath=releases///QA/172

          reverting back to 2.15:
          + relpath=releases/Collections/develop/QA/172

          Note the lack of the "Collections" and "develop" strings in the 2.21 case.
          These are env-inject plugin variables.

          Bruce Edge added a comment - - edited Still broken in 2.21 release. Was pull request #49 from wgreven/ JENKINS-22679 not merged? Snippet from promotion log using 2.21 shows: + relpath=releases///QA/172 reverting back to 2.15: + relpath=releases/Collections/develop/QA/172 Note the lack of the "Collections" and "develop" strings in the 2.21 case. These are env-inject plugin variables.

          Raul Melo added a comment - - edited

          Still broken with env-inject vars and 2.22 version.

          PR #49
          vStone said: "This does not seem to fix variables that were inserted with envinject"
          wgreven-ibr respond: "No, it's a fix specific for the build parameters."

          Seems that the problem for this Issue is solved, Should we open a new BUG specific for env-inject?

          Raul Melo added a comment - - edited Still broken with env-inject vars and 2.22 version. PR #49 vStone said: "This does not seem to fix variables that were inserted with envinject" wgreven-ibr respond: "No, it's a fix specific for the build parameters." Seems that the problem for this Issue is solved, Should we open a new BUG specific for env-inject?

          Bruce Edge added a comment -

          Filed JENKINS-30772 for env-inject plugin. with reference to this bug.

          Bruce Edge added a comment - Filed JENKINS-30772 for env-inject plugin. with reference to this bug.

          Oleg Nenashev added a comment -

          Sorry, over last months I had no time to work on the plugin, because I had to focus on the Jenkins core and other projects. I also have not been using this plugin on my own since 2016. So I have decided to unassign the issues so that there is no expectation that I work on them anytime soon.

          Currently the plugin is being transfered to another maintainer. Hopefully he will have some time to finish triaging of the issues and maybe to deliver some fixes. But, as in any community-driven project, everybody is welcome to propose pull requests and to contribute to the plugin's state.

          Oleg Nenashev added a comment - Sorry, over last months I had no time to work on the plugin, because I had to focus on the Jenkins core and other projects. I also have not been using this plugin on my own since 2016. So I have decided to unassign the issues so that there is no expectation that I work on them anytime soon. Currently the plugin is being transfered to another maintainer. Hopefully he will have some time to finish triaging of the issues and maybe to deliver some fixes. But, as in any community-driven project, everybody is welcome to propose pull requests and to contribute to the plugin's state.

            Unassigned Unassigned
            bedge Bruce Edge
            Votes:
            19 Vote for this issue
            Watchers:
            27 Start watching this issue

              Created:
              Updated: