Skip to content

Skipped stages not clickable in graph view #1397

Description

@krf

Jenkins 2.568.1
Pipeline Graph View Plugin Version 963.v2a_b_019810b_e1

Example pipeline:

Image

Note: This is using the Utils.markStageSkippedForConditional() function to skip stages.

Example code (note: Different to above pipeline, but illustrates the issue):

import org.jenkinsci.plugins.pipeline.modeldefinition.Utils

node {
    stage('Checkout') {
        echo 'Checking out source code...'
    }

    stage('Optional Deploy') {
        // Example condition: only deploy if a specific parameter is set to true
        boolean shouldDeploy = params.DEPLOY_TO_PRODUCTION ?: false

        if (!shouldDeploy) {
            echo "Skipping deployment stage because DEPLOY_TO_PRODUCTION is false."
            
            // 1. Tell Jenkins to visually mark this specific stage as skipped in the UI
            Utils.markStageSkippedForConditional(STAGE_NAME)
            
            // 2. Immediately exit the stage block so no further steps are run
            return
        }

        // This code will only execute if shouldDeploy is true
        echo 'Deploying application to production...'
    }

    stage('Notify') {
        echo 'Sending build status notifications...'
    }
}

What Operating System are you using (both controller, and any agents involved in the problem)?

Linux

Reproduction steps

  1. Click on Console Job

Expected Results

Bug: In the graph view, "ai-code-review" should be selectable and display the stage contents.

Actual Results

"ai-code-review" in the graph view is NOT selectable.

Anything else?

Note: It already IS selectable in the left sidebar though (GOOD).

Are you interested in contributing a fix?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions