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

Promotion Plugin: promotion should fail if any actions are not performed



    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: other
    • Labels:
    • Environment:
      Platform: All, OS: All
    • Similar Issues:


      The promotion plugin show (when configuring a promotion) a number of possible
      actions to perform when a build is promoted. Many of the actions which are
      listed and can be configured do not actually run upon a promotion.

      Primarily this occurs when the BuildStep extends BuildStepCompatibilityLayer and
      does not override perform(AbstractBuild, Launcher, BuildListener) method so the
      BuildStep uses the implementation in BuildStepCompatibilityLayer which checks to
      see if the build is an instanceof Build, and then because it is not for a
      promotion build simply returns true without doing anything.

      Attached patch checks for actions which do not actually run (during promotion
      not during configuration) and

      • fails the action if it does not actually run because it is using
        BuildStepCompatibilityLayer perform(AbstractBuild,...) method
      • make promotion page more explicit about failed promotions by adding red/blue

      -also correctly build other projects (fixes Issue 1765) when that action is used

      As an alternative fix mechanism, maybe BuildStepCompatibilityLayer should return
      false rather than true when the build is not a Build (but some other form of
      AbstractBuild). However that involves changes to the core, not the plugin, and
      could have implications elsewhere which I do not have sufficient familiarity
      with the codebase to explore.

      Also I was unable to find a way to not show the zombie actions (those that claim
      to work but do nothing) in the configuration screen. That would be a better
      mechanism if possble.

        • It was simplest to include both fixes in the same patch since they overlap.
          If required I could separate the two patches out, but would need to do one then
          wait for it to be committed, then supply the other. Let me know if that is
          required and which order.


          Issue Links


            brucechapman brucechapman created issue -
            brucechapman brucechapman made changes -
            Field Original Value New Value
            Link This issue is blocking JENKINS-2576 [ JENKINS-2576 ]
            brucechapman brucechapman made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            brucechapman brucechapman made changes -
            Status In Progress [ 3 ] Open [ 1 ]
            brucechapman brucechapman made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            brucechapman brucechapman made changes -
            Resolution Fixed [ 1 ]
            Status In Progress [ 3 ] Resolved [ 5 ]
            abayer Andrew Bayer made changes -
            Status Resolved [ 5 ] Closed [ 6 ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 132670 ] JNJira + In-Review [ 201578 ]


              brucechapman brucechapman
              brucechapman brucechapman
              0 Vote for this issue
              0 Start watching this issue