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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • other
    • None
    • Platform: All, OS: All

      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.

            brucechapman brucechapman
            brucechapman brucechapman
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: