Status: Closed (View Workflow)
Created as response to comments of https://issues.jenkins-ci.org/browse/JENKINS-37781 as the visualization of skipped stages is very, very nice for declarative pipelines in Blue Ocean.
- Allow to skip stages in scripted pipelines leading to equally nice visualization in Blue Ocean: The current approaches mentioned by mkobit in https://issues.jenkins-ci.org/browse/JENKINS-37781?focusedCommentId=294965&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-294965 and jamesdumay in https://issues.jenkins-ci.org/browse/JENKINS-37781?focusedCommentId=294966&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-294966 lead to either misleading or just less obvious visualization...
- Improve visualization of stage view: instead of showing skipped stages (declarative pipelines) as always being green and allegedly executed, make them e.g. gray.
- Stage "skipped" is actually skipped, but stage view shows:
- This is IMHO also a major enhancement and valid fix for the other problem reported by mkobit in https://issues.jenkins-ci.org/browse/JENKINS-37781?focusedCommentId=294965&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-294965: "[The Pipeline Stage View Plugin] has some weird display issues if new pipelines have different stage executions than previous ones."
- is related to
JENKINS-37781 Pipeline Config: ability to skip whole pipeline or stages based on boolean condition
- relates to
JENKINS-54322 Add ability SKIP stage in script pipeline
- In Review
michaelneale I am a bit surprised by being the new assignee of this issue, as I am not sure what you are expecting from me. Considering the admittedly rather long history of this issue and its distractions/deviations I think I can only try to do a little update:
- the issue's title/goal is still completely the same and correct
- and IMHO the "only" (or main) thing certainly missing is a stable/public API for org.jenkinsci.plugins.pipeline.modeldefinition.Utils.markStageSkippedForConditional(STAGE_NAME) (as this is annotated with @Restricted(NoExternalUse.class))
- In the course of doing that other questions from https://issues.jenkins-ci.org/browse/JENKINS-47286?focusedCommentId=334032&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-334032 might be answered as well... (I think item #2 "mouse hover" was actually fixed; see https://issues.jenkins-ci.org/browse/JENKINS-47286?focusedCommentId=360479&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-360479)
Assigning this back to michaelneale with the update/summary comment above...
While I am not sure if this is the correct/perfect/recommended place for this question, it admittedly fits to this issue and I can actually give you a little hint
My approach for this is to have a skipableStage step in my shared Jenkins pipeline library that wraps the default/standard stage step, so the usage is almost like normally:
... and the steps implementation in pseudo code is: