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

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Component/s: other
    • Labels:
      None
    • Environment:
      Platform: All, OS: All

      Description

      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
        baloons.

      -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

          Activity

          brucechapman brucechapman created issue -
          Hide
          brucechapman brucechapman added a comment -

          blocks master issue (2576) for promotion actions not running, as well as 1765
          which is also fixed by (soon to be) attached patch.

          Show
          brucechapman brucechapman added a comment - blocks master issue (2576) for promotion actions not running, as well as 1765 which is also fixed by (soon to be) attached patch.
          brucechapman brucechapman made changes -
          Field Original Value New Value
          Link This issue is blocking JENKINS-2576 [ JENKINS-2576 ]
          Hide
          brucechapman brucechapman added a comment -

          Created an attachment (id=430)
          Patch relative to plugins/promoted-builds

          Show
          brucechapman brucechapman added a comment - Created an attachment (id=430) Patch relative to plugins/promoted-builds
          Hide
          brucechapman brucechapman added a comment -

          Patch attached. This patch also adds loging for the promotion build so that the
          steps (actions) can be seen in the build log and explain why the promotion
          succeeded or failed.

          Show
          brucechapman brucechapman added a comment - Patch attached. This patch also adds loging for the promotion build so that the steps (actions) can be seen in the build log and explain why the promotion succeeded or failed.
          Hide
          brucechapman brucechapman added a comment -

          I can do this myself now

          Show
          brucechapman brucechapman added a comment - I can do this myself now
          brucechapman brucechapman made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Hide
          brucechapman brucechapman added a comment -

          assigning to me.

          Show
          brucechapman brucechapman added a comment - assigning to me.
          brucechapman brucechapman made changes -
          Status In Progress [ 3 ] Open [ 1 ]
          Hide
          brucechapman brucechapman added a comment -

          1765 portion has been committed separately.

          Show
          brucechapman brucechapman added a comment - 1765 portion has been committed separately.
          brucechapman brucechapman made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in hudson
          User: : brucechapman
          Path:
          trunk/hudson/plugins/promoted-builds/src/main/java/hudson/plugins/promoted_builds/Promotion.java
          trunk/hudson/plugins/promoted-builds/src/main/resources/hudson/plugins/promoted_builds/PromotedBuildAction/index.jelly
          http://fisheye4.cenqua.com/changelog/hudson/?cs=14256
          Log:
          [FIX JENKINS-2597]Promotion should fail if any actions are not performed

          • fails the action if it does not actually run because it is using
            BuildStepCompatibilityLayer's perform(AbstractBuild,...) method (which does nothing but returns true)
          • make promotion page more explicit about failed promotions by adding red/blue
            balloons.
          • some logging so user can see that what actions failed and what succeeded.
          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in hudson User: : brucechapman Path: trunk/hudson/plugins/promoted-builds/src/main/java/hudson/plugins/promoted_builds/Promotion.java trunk/hudson/plugins/promoted-builds/src/main/resources/hudson/plugins/promoted_builds/PromotedBuildAction/index.jelly http://fisheye4.cenqua.com/changelog/hudson/?cs=14256 Log: [FIX JENKINS-2597] Promotion should fail if any actions are not performed fails the action if it does not actually run because it is using BuildStepCompatibilityLayer's perform(AbstractBuild,...) method (which does nothing but returns true) make promotion page more explicit about failed promotions by adding red/blue balloons. some logging so user can see that what actions failed and what succeeded.
          Hide
          brucechapman brucechapman added a comment -

          patch applied

          Show
          brucechapman brucechapman added a comment - patch applied
          brucechapman brucechapman made changes -
          Status In Progress [ 3 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          abayer abayer made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

            People

            • Assignee:
              brucechapman brucechapman
              Reporter:
              brucechapman brucechapman
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: