Child pages
  • Pipeline Stage View Plugin
Skip to end of metadata
Go to start of metadata

Plugin Information

View Pipeline: Stage View on the plugin site for more information.

Stage View: 

When you have complex builds Pipelines, it is useful to be able to see the progress of each stage.  The Pipeline Stage View plugin includes an extended visualization of Pipeline build history on the index page of a flow project, under Stage View. (You can also click on Full Stage View to get a full-screen view.)

To take advantage of this view, you need to define stages in your flow. You can have as many stages as you like, in a linear sequence. (They may be inside other steps such as 'node' if that is convenient.) Give each a short name that will appear in the GUI.

node {
  stage ('Checkout') {
  	svn 'https://svn.mycorp/trunk/'
  	stage 'Build'
	sh 'make all'
	stage 'Test'
  	sh 'make test'
  }
}

When you run some builds, the stage view will appear with CheckoutBuild, and Test columns, and one row per build. When hovering over a stage cell you can click the Logs button to see log messages printed in that stage: after the preceding stage step and before the next one.

Other important events are also indicated with special buttons, either in a stage cell or for the build as a whole. If a build is waiting in an input step, you will be able to tell it to proceed (or not). Download can be used to obtain any artifacts archived by a build. 

Each row also records the build number, date it was started, and any changelog entries from a version control system. Progress bars also indicate how long each stage is taking and how long it might still be expected to take, based on historical averages.

Usage Notes/Limits:

  • Block-scoped stages (stages that take a closure, see below) may occur in parallels but are not displayed in parallel.

    stage('name'){ echo 'steps here' }
  • Dynamic stages: in general, if you want to visualize dynamically changing stages, make it conditional to execute the stage contents, not conditional to include the stage** Stage view can handle a limited subset of cases where you're appending additional stages, but the cell-based view is not matched to changing stage structures 
  • Configurable limits are provided for the REST API that drives stage view -- these may be overridden though (see below).
  • The pipeline stage view uses caching internally for performance: even if the first viewing is slow, following ones should be quite fast

Configurable Properties:

  • At runtime or startup, you may turn off Jenkins user lookup for changesets with property  com.cloudbees.workflow.rest.external.ChangeSetExt.resolveCommitAuthors
    • This is a workaround for rare cases where you are relying on an external security realm for user information and have performance issues with many calls:
    • In the script console this setting may be changed at runtime (with immediate impact):
System.setProperty("com.cloudbees.workflow.rest.external.ChangeSetExt.resolveCommitAuthors","false");
    • To turn user lookup back on: 
System.setProperty("com.cloudbees.workflow.rest.external.ChangeSetExt.resolveCommitAuthors","true");
  • Hardcoded API limits that may be overridden by setting the properties at startup (requires restarting Jenkins to see the change):
    • Characters in each step's log entry (default: 10240 or 10kB) - com.cloudbees.workflow.rest.external.FlowNodeLogExt.maxReturnChars
    • Runs displayed per job (default: 10) - com.cloudbees.workflow.rest.external.JobExt.maxRunsPerJob
    • Artifacts shown per run (default: 100) - com.cloudbees.workflow.rest.external.RunExt.maxArtifactsCount
    • Steps displayed per stage (default: 100) - com.cloudbees.workflow.rest.external.StageNodeExt.maxChildNodes - note: this may have a very large performance impact with complex builds.

Changelog:

2.10 (Mar 30, 2018)

  • Fix a small bug with URL generation that could result in invalid URL generation in rare cases with customized Jenkins hostnames

2.9 (Aug 29, 2017)

  • Fix a timing bug for run durations - JENKINS-40162
  • Fix Jackson 2 dependencies by switching to use the Jenkins plugin rather than the library JENKINS-46526
  • Fix an issue with Stage View caching where job renames generated bad links - JENKINS-38159

2.8 (May 25, 2017)

  • Major feature: Display arguments used in running steps in the logs view - JENKINS-37324
  • Fix handling of BooleanParameter default to false - JENKINS-36543

2.6 (Mar 6, 2017)

2.5 (Feb 13, 2017)

  • Fix a minor CSS layout issue with stage view interfering with test results trends graphs

2.4 (Nov 29, 2016)

  • Fix: Regression introduced in 2.3 which resulting in requesting all runs for a job, even if most were cached JENKINS-40087

2.3 (Nov 22, 2016)

  • Fix: Stage View showed multiple rows if displayName changed for a run (community PR, thank you!) - JENKINS-34538

2.2 (Nov 2, 2016)

  • CSS Fix: excess whitespace on sides of stages table with very high resolution monitors

2.1 (Sept 30, 2016)

  • Fix: Prevent errors in deeply nested blocks from overflowing the stage status window (JENKINS-37945)
    • Also filters out block start/end steps from that and log display (reverts to 1.7 behavior)
  • Fix: hide NotExecuted steps from log display (user is resuming from checkpoint, these steps never ran on this run)
  • CSS Fix: prevent excessively long error messages from overflowing stage status popup
  • Feature: display timing information for steps in log view
  • Don't show log-expand icons if there is no log message for a step (JENKINS-31833)

2.0 (Aug 30, 2016)

  • Feature: support visualization of block-scoped stages (labelled blocks) (JENKINS-26107)
  • Major feature: complete rewrite of the flow analysis algorithms (JENKINS-34038)
    • Needed to support block-scoped stage, and originally intended to allow for visualizing parallels
    • Scalability: simpler and more efficient APIs allow for analyzing flows in a logical one-pass fashion.
    • Performance: allows for far greater performance.  Currently roughly at parity with 1.7, but once JENKINS-37569 is done, should be *much* faster.
    • Optimization: includes one final round of caching improvements.  We can now serve requests about individual stages/nodes from the cache, and caches use less memory.

1.7 (Aug 6, 2016)

  • Performance/bugfix: massively improve serverside run/stage caching, by greatly limiting excess cache invalidation
    • Cache no longer fully invalidates on renaming a pipeline job: instead the old cache entries are removed and new ones created with the new job name
    • Bugfix: Need to invalidate run cache results when their job is deleted (JENKINS-36865)
    • Known issue: run cache can no longer serve requests for data about individual stages/nodes. 
      • Mitigation: UI switches to use API below, so it just gets this data with the run request
  • Performance:  Fetch full stage data when requesting runs, and doesn't issue separate requests for individual stages (JENKINS-34036)
    • API extension to allow getting full stage data for requested runs (or just the stage minimal data without child nodes)
    • Front-end (browser) uses this API now
    • It will still issue requests for in-progress builds though (room for some additional work)
    • Clientside stage cache is redone to cache all completed stages when request issued.
  • Minor fix to CSS for unstable build (JENKINS-37001)

1.6 (July 18, 2016)

Theme: Status handling and UX

  • Stage view correctly handles try/catch blocks (JENKINS-34212)
    • Workaround: stages with errors are marked successful if overall build is.
  • Better support use of currentBuild.result to modify run status (JENKINS-36523 offers one example)
  • Support use of the UNSTABLE status for runs (JENKINS-33700)
    • Catch: you can only set this status for the whole build (result is that successful stages will instead show as unstable). 
    • Needs JENKINS-26522 to provide custom status tracking for a stage. 
  • Fix bizarre timing numbers from stage view (JENKINS-34644)
  • Fix Stage View jumping to the left when displaying many stages and scrolled to the right (JENKINS-36384)
  • Allow multi-line input prompts (JENKINS-36661)

1.5 (June 21, 2016)

Theme: configurability of hardcoded values

  • REMOVE node labels in stage view (per JENKINS-34038) until we can correctly handle more of the cases with a block-based pipeline graph analysis
  • Add properties to override hardcoded limits in the REST API (i.e. to show more or less builds, artifacts, etc) (JENKINS-34791)
  • Add a property (modifiable at runtime) to disable lookup of Jenkins users for commit changelogs (JENKINS-35484
    • Useful for cases where user lookup ties to a security realm and caching problems or network calls render it expensive.

1.4 (May 12, 2016)

  • Ensure the log view popup is always placed in the visible area of the page  (JENKINS-33109)
  • Make full screen mode with use the full with by removing offsets for sidebar ( JENKINS-33498)
  • Fix display of artifact names when there are large numbers (JENKINS-33351)
  • Fix an NPE when generating links object with no active Stapler request
  • Correctly calculate all data sizes to use 1024 bytes per increment (consistency with other parts of Jenkins) (JENKINS-33714)

1.3 (Apr 6, 2016)

  • Scalability enhancements dramatically improving UI performance with very large flow graphs (JENKINS-33624)
    • Should greatly reduce CPU load on masters when viewing these graphs

1.2 (Apr 6, 2016)

  • Fix issues introduced with Pipeline 2.0 that could produce linkage errors
  • Bump to parent POM v2.5

1.1 (Apr 5, 2016)

  • Fix log details not expanding/collapsing for pipeline steps (JENKINS-33110)
  • Clean up POMs and use new parent POM (JENKINS-33188)
  • Fix a StackOverflow Exception when navigating long pipeline flow graphs (JENKINS-33486)

1.0 (Feb 25, 2016)

  • Initial open source code release

11 Comments

  1. The stage view is great, but I think it could really be interesting to have links to the current build and other linked build job. If my pipeline starts a job in a stage, I don't have an easy link to click to follow that nested pipeline build.

    I think that in the logs or the options over the stages, you could have a link to it.

    Or perhaps a direct link to the pipeline steps of the current build, which already link to the nested build.

  2. Mat Mor  JENKINS-37463 - Getting issue details... STATUS

  3. Is it ok to remove the hardcoded 10  from :

    public static final int MAX_RUNS_PER_JOB = Integer.getInteger(JobExt.class.getName()+".maxRunsPerJob", 10);

    if pagination does not support, we still can have user input as for the maxRunsPerJob ?

     

    The problem is, we set the Max number of build history to 70, and only shows 10 latest runs from stage view (even the old runs still can be found from history builds)

  4. This plugin does not work very well with parallel (parallel keyword in a groovy pipeline script). With non-parallel builds we can catch an exception, do something, set the build status, and then throw the exception. This will terminate the job and correctly show the table in the Stage View i.e. it will show all stages following the exception as greyed out. This is not the case running nodes in parallel. Example: A parallel job has two nodes running in parallel with three stages each. When everything goes well, a green row showing all 6 stages is shown in the Stage View table. If yet another job goes well the Stage View table will now show two green rows. Now if a stage fails the entire table will be deleted (no more green rows), and the table will only show one red row, missing the stages that follows where the excetion was thrown. With non-paralelle builds the Stage View table looks correctly like the first Stage View example shown on this page.

    Another thing is that setting the build status with e.g. currentBuild.result = 'UNSTABLE' is ignored, and will always show failed. How can we control the color of a row (RED=failed, YELLOW=unstable, GREY=aborted)?

  5. Hi, is there anyway to break the view into multiple rows ? I have a pipeline with more than 50 steps. Thanks

  6. Hi, is there anyway to add start time, end time, total time in pipe line stage view for each run ?

    Is it possible to get an email of pipe line stage view for each run ?

    Thanks.

  7. Gentle reminder: the Jenkins project does NOT accept bug reports or feature requests via wiki comments.  Please submit a JIRA issue.  Thanks!

     

    CC Chiran K Jorge Machado Tue Christophersen Wen Zhou

  8. J S

    Hello, everybody,

    I often have the problem that builds in the "Stage View" are no longer displayed consecutively e.g. I have 155 builds in total. But at some point the steps were cut off so that I can only see from 145 to 155 in the stage view. Is there a trick to solve this problem so that all builds are displayed in the Stage View?

     

    Screenshot :

     

    1. that's exactly what I mentioned before, the default 10 limits only showing the last 10 builds, which either need to be a PR for make this configurable or you set it in the whole system to overwrite 10 to a different number, but that applies to all jobs. 

      1. J S

        Where i can change it ?

        1. set  -Dcom.cloudbees.workflow.rest.external.JobExt.maxRunsPerJob= when start jenkins.war