For some reason after updating to the latest jenkins and promoted-builds plugin, the re-execute button is not shown after a build has been promoted.

      This used to be available for all builds and is no longer there.

        1. bug.tgz
          3 kB
        2. bug.tgz
          3 kB
        3. JenkinsBugTest.zip
          148 kB
        4. promoted-builds-2.18-20140807.061532-2.hpi
          226 kB

          [JENKINS-20492] Re-Execute promotion button is gone

          Clecio Varjao added a comment - - edited

          Can anybody provide with the job/build configuration files? You can create a new dummy job/project with some dummy promotions and send me the the whole project folder (e.g.: %JENKINS_HOME%/jobs/DUMMY-JOB) I have not been able to re-produce this behavior.

          you can also use the API:

          {baseurl}/view/All/job/{job_name}/config.xml
          {baseurl}

          /view/All/job/

          {job_name}

          /promotion/process/

          {promotion_name}

          /config.xml

          e.g.:
          http://localhost/view/All/job/APP-TEST/config.xml
          http://localhost/view/All/job/APP-TEST/promotion/process/PROM2/config.xml

          What criteria are selected?
          [ ] Only when manually approved
          [ ] Promote immediately once the build is complete
          [ ] Promote immediately once the build is complete based on build parameters
          [ ] When the following downstream projects build successfully
          [ ] When the following upstream promotions are promoted

          The move to the Badge is just technical term. But from the user's perspective, it shouldn't have changed.

          Clecio Varjao added a comment - - edited Can anybody provide with the job/build configuration files? You can create a new dummy job/project with some dummy promotions and send me the the whole project folder (e.g.: %JENKINS_HOME%/jobs/DUMMY-JOB) I have not been able to re-produce this behavior. you can also use the API: {baseurl}/view/All/job/{job_name}/config.xml {baseurl} /view/All/job/ {job_name} /promotion/process/ {promotion_name} /config.xml e.g.: http://localhost/view/All/job/APP-TEST/config.xml http://localhost/view/All/job/APP-TEST/promotion/process/PROM2/config.xml What criteria are selected? [ ] Only when manually approved [ ] Promote immediately once the build is complete [ ] Promote immediately once the build is complete based on build parameters [ ] When the following downstream projects build successfully [ ] When the following upstream promotions are promoted The move to the Badge is just technical term. But from the user's perspective, it shouldn't have changed.

          Marvi Benedet added a comment -

          bug project folder

          Marvi Benedet added a comment - bug project folder

          Marvi Benedet added a comment -

          seems I'm not allowed to upload files here....
          I lost also the commet I wrote. I rewrite it here:

          Here my job. Note that I'm using AD authentication and there is a user with a numerical ID that is authorized to approve the promotion.
          This user is also administrator of the whole jenkins, so it can "force the promotions"

          the only selected criteria is:

          [X] Only when manually approved

          BUT attention: if I promote regularly with the "approve" button all is ok. The problem came only when I use the "force promotion" button.

          Marvi Benedet added a comment - seems I'm not allowed to upload files here.... I lost also the commet I wrote. I rewrite it here: Here my job. Note that I'm using AD authentication and there is a user with a numerical ID that is authorized to approve the promotion. This user is also administrator of the whole jenkins, so it can "force the promotions" the only selected criteria is: [X] Only when manually approved BUT attention: if I promote regularly with the "approve" button all is ok. The problem came only when I use the "force promotion" button.

          Marvi Benedet added a comment -

          I sent you by mail a tgz of a job that show the problem.
          Bye Marvi

          Marvi Benedet added a comment - I sent you by mail a tgz of a job that show the problem. Bye Marvi

          Clecio Varjao added a comment -

          I was able to reproduce by using "Force Promotion" instead of "Promote". I am wondering if that is everybody case?
          The problem with "Force Promotion" is that it will ONLY work for promotion with NO parameters.
          In my organization, we NEVER use force promotion.

          Clecio Varjao added a comment - I was able to reproduce by using "Force Promotion" instead of "Promote". I am wondering if that is everybody case? The problem with "Force Promotion" is that it will ONLY work for promotion with NO parameters. In my organization, we NEVER use force promotion.

          I've attached a job with this issue.

          Yes, I only have this issue when force promotion is used. If a promotion is forced and then fails, there is no way to redo the promotion.

          A problem which was leading me to use force promotion: if a promotion has some improperly set criteria then it is impossible to do a regular promotion. For example, if "When the following upstream promotions are promoted" is checked but the box for it is not filled out, clicking Approve will give the "Re-execute Promotion" button, but the promotion will never execute. It does not give any reason why, but it will say upstream promotions under unmet qualifications, but the upstream promotions is blank so that doesn't really indicate anything. If you click the "Re-execute Promotion" button again, you get a 404 error. The only option at that point is to force the promotion, and if it fails you are then completely unable to execute the promotion. I did not check if this also occurs for other invalid settings than the "upstream promotions are promoted" setting.

          Erik Ylvisaker added a comment - I've attached a job with this issue. Yes, I only have this issue when force promotion is used. If a promotion is forced and then fails, there is no way to redo the promotion. A problem which was leading me to use force promotion: if a promotion has some improperly set criteria then it is impossible to do a regular promotion. For example, if "When the following upstream promotions are promoted" is checked but the box for it is not filled out, clicking Approve will give the "Re-execute Promotion" button, but the promotion will never execute. It does not give any reason why, but it will say upstream promotions under unmet qualifications, but the upstream promotions is blank so that doesn't really indicate anything. If you click the "Re-execute Promotion" button again, you get a 404 error. The only option at that point is to force the promotion, and if it fails you are then completely unable to execute the promotion. I did not check if this also occurs for other invalid settings than the "upstream promotions are promoted" setting.

          Clecio Varjao added a comment -

          Thanks Marvi and Erik, the project files were very helpful.
          Anybody want to try my latest build with the fix? See Attachments

          Clecio Varjao added a comment - Thanks Marvi and Erik, the project files were very helpful. Anybody want to try my latest build with the fix? See Attachments

          Rene Kok added a comment -

          Fix promoted-builds-2.18-20140807.061532-2.hpi worked for me.
          thanks.

          Rene Kok added a comment - Fix promoted-builds-2.18-20140807.061532-2.hpi worked for me. thanks.

          Damien Nozay added a comment -

          Damien Nozay added a comment - https://github.com/jenkinsci/promoted-builds-plugin/pull/45

          Damien Nozay added a comment -

          Fixed/Workaround in version 2.20.

          https://github.com/jenkinsci/promoted-builds-plugin/commit/8e0e17b1e21624cb3db68f23b868fb15d280aae3

          The fix was to remove the button display condition which was `isManuallyApproved()`.
          Promotions that are "Forced" are not the same as "manually approved".
          It is now displayed unconditionally.

          There are many use cases for re-executing the promotion, two of them are:
          1. it didn't work the first time, duh!
          2. side-effects that you want to re-execute.

          The "Force promotion" workflow may very well be broken.
          You may be able to get more data using/adapting the following groovy script:

          import hudson.plugins.promoted_builds.*;
          
          jobs = hudson.model.Hudson.instance.getAllItems(FreeStyleProject)
          job = jobs[0]
          
          build = job.lastSuccessfulBuild
          
          println build.actions
          
          build.getAction(PromotedBuildAction.class).promotions.each { 
            p -> 
            println "promotion:" + p.name + ", manual:" + p.manuallyApproved + ", success:" + p.promotionSuccessful
            println p.badges
          }
          

          Damien Nozay added a comment - Fixed/Workaround in version 2.20. https://github.com/jenkinsci/promoted-builds-plugin/commit/8e0e17b1e21624cb3db68f23b868fb15d280aae3 The fix was to remove the button display condition which was `isManuallyApproved()`. Promotions that are "Forced" are not the same as "manually approved". It is now displayed unconditionally. There are many use cases for re-executing the promotion, two of them are: 1. it didn't work the first time, duh! 2. side-effects that you want to re-execute. The "Force promotion" workflow may very well be broken. You may be able to get more data using/adapting the following groovy script: import hudson.plugins.promoted_builds.*; jobs = hudson.model.Hudson.instance.getAllItems(FreeStyleProject) job = jobs[0] build = job.lastSuccessfulBuild println build.actions build.getAction(PromotedBuildAction.class).promotions.each { p -> println "promotion:" + p.name + ", manual:" + p.manuallyApproved + ", success:" + p.promotionSuccessful println p.badges }

            cvarjao Clecio Varjao
            oggie gary ogden
            Votes:
            7 Vote for this issue
            Watchers:
            13 Start watching this issue

              Created:
              Updated: