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

Clicking "Build Now" on a Promotion results in a phantom, unkillable build

    Details

    • Similar Issues:

      Description

      If you create a promotion for a job, and then navigate to the "Promotion Status" page, and then click on the promotion itself, you will see a "Build Now" button. If you click this button, you will see a build running in the Build History window with a "null" running and estimated time.

      If you try to cancel the build, nothing will happen. If you go back to the Jenkins index page, you will not see the job running on an executor.

      You will also see this exception in the logs: https://gist.github.com/recampbell/c00b90a6ffbbbb938198

        Attachments

          Issue Links

            Activity

            Hide
            recampbell Ryan Campbell added a comment -

            Similar issue

            Show
            recampbell Ryan Campbell added a comment - Similar issue
            Hide
            recampbell Ryan Campbell added a comment -

            Screenshot of phantom build

            Show
            recampbell Ryan Campbell added a comment - Screenshot of phantom build
            Hide
            recampbell Ryan Campbell added a comment -

            The fundamental problem here is that the PromotionProcess must be buildable, but should not have a "Build Now" button. To be more precise PromotionProcess must return true for isBuildable() so that AbstractProject.scheduleBuild2() will actually perform the build.

            So we can't just return false for isBuildable().

            So it seems to me that the simplest approach is just to customize the left-hand menu for this PromotionProcess to avoid displaying the "Build Now" button.

            Show
            recampbell Ryan Campbell added a comment - The fundamental problem here is that the PromotionProcess must be buildable, but should not have a "Build Now" button. To be more precise PromotionProcess must return true for isBuildable() so that AbstractProject.scheduleBuild2() will actually perform the build. So we can't just return false for isBuildable(). So it seems to me that the simplest approach is just to customize the left-hand menu for this PromotionProcess to avoid displaying the "Build Now" button.
            Hide
            jglick Jesse Glick added a comment -

            Customizing the sidepanel seems reasonable, though this seems too high level; there are other build triggers. Not sure what else to suggest, though. This whole plugin is very weird and a lot of things do not behave reasonably.

            Independently, there seems to be a robustness bug in Promotion.getTarget: should check pta == null.

            Show
            jglick Jesse Glick added a comment - Customizing the sidepanel seems reasonable, though this seems too high level; there are other build triggers. Not sure what else to suggest, though. This whole plugin is very weird and a lot of things do not behave reasonably. Independently, there seems to be a robustness bug in Promotion.getTarget : should check pta == null .
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Ryan Campbell
            Path:
            src/main/java/hudson/plugins/promoted_builds/PromotionProcess.java
            http://jenkins-ci.org/commit/promoted-builds-plugin/dc858e87c6f99bb1653a1e06f354e4867e11147e
            Log:
            JENKINS-24782 Prevent phantom builds from being scheduled when PromotionProcesses are built directly.

            There is quite a bit more work to be done to tidy up the UX for PromotionProcesses, but at least we can prevent people from shooting themselves in the foot.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Ryan Campbell Path: src/main/java/hudson/plugins/promoted_builds/PromotionProcess.java http://jenkins-ci.org/commit/promoted-builds-plugin/dc858e87c6f99bb1653a1e06f354e4867e11147e Log: JENKINS-24782 Prevent phantom builds from being scheduled when PromotionProcesses are built directly. There is quite a bit more work to be done to tidy up the UX for PromotionProcesses, but at least we can prevent people from shooting themselves in the foot.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Stephen Connolly
            Path:
            src/main/java/hudson/plugins/promoted_builds/PromotionProcess.java
            http://jenkins-ci.org/commit/promoted-builds-plugin/2fe54570a00588e28c3cf9549f25af54858099f7
            Log:
            Merge pull request #56 from recampbell/JENKINS-24782

            JENKINS-24782 Prevent phantom builds from being scheduled when PromotionProcesses are built directly.

            Compare: https://github.com/jenkinsci/promoted-builds-plugin/compare/524772c09e5f...2fe54570a005

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stephen Connolly Path: src/main/java/hudson/plugins/promoted_builds/PromotionProcess.java http://jenkins-ci.org/commit/promoted-builds-plugin/2fe54570a00588e28c3cf9549f25af54858099f7 Log: Merge pull request #56 from recampbell/ JENKINS-24782 JENKINS-24782 Prevent phantom builds from being scheduled when PromotionProcesses are built directly. Compare: https://github.com/jenkinsci/promoted-builds-plugin/compare/524772c09e5f...2fe54570a005
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            It is fixed according to comments

            Show
            oleg_nenashev Oleg Nenashev added a comment - It is fixed according to comments

              People

              • Assignee:
                Unassigned
                Reporter:
                recampbell Ryan Campbell
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: