Class PipelineManagerBuildNumberAction

java.lang.Object
hudson.model.InvisibleAction
org.jvnet.hudson.plugins.groovypostbuild.PipelineManagerBuildNumberAction
All Implemented Interfaces:
Action, ModelObject

public class PipelineManagerBuildNumberAction extends InvisibleAction
Records, on the Run a Pipeline step is actually executing on, which build number manager in that Pipeline is currently redirected to via GroovyPostbuildRecorder.BadgeManager.setBuildNumber(int).

WorkflowManager.getValue(org.jenkinsci.plugins.workflow.cps.CpsScript) builds a brand new BadgeManager every time a script references manager, so without this the redirect chosen by one reference would be lost by the next one (JENKINS-43012). Keeping the chosen build number as an ordinary action on the run - the same mechanism manager's badges themselves use - lets it survive both later references within the run and a Jenkins restart, with no static or in-memory cache to leak.

  • Constructor Details

    • PipelineManagerBuildNumberAction

      public PipelineManagerBuildNumberAction(int buildNumber)
  • Method Details

    • getBuildNumber

      public int getBuildNumber()