jenkinsci / pipeline-graph-view-plugin

https://plugins.jenkins.io/pipeline-graph-view/
Other
107 stars 54 forks source link

Parallel stages show as complete when only 1 stage complete #447

Open The-Jonsey opened 3 months ago

The-Jonsey commented 3 months ago

Jenkins and plugins versions report

Environment ```text println("Jenkins: ${Jenkins.instance.getVersion()}") println("OS: ${System.getProperty('os.name')} - ${System.getProperty('os.version')}") println("Java: ${System.getProperty('java.version')} - ${System.getProperty('java.vm.vendor')} (${System.getProperty('java.vm.name')})") println "---" Jenkins.instance.pluginManager.plugins .collect() .sort { it.getShortName() } .each { plugin -> println("${plugin.getShortName()}:${plugin.getVersion()}") } return ```

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

Linux

Reproduction steps

  1. Write a pipeline with parallel stages i.e

    pipeline {
    agent any
    
    stages {
        stage('Parallel Stages') {
            parallel {
                stage('Fast Stage') {
                    steps {
                        sh 'sleep 5'
                    }
                }
                stage('Slow Stage') {
                    steps {
                        sh 'sleep 60'
                    }
                }
            }
        }
    }
    }
  2. Run said pipeline and preview on the job page with the list of builds, rather than the individual build graph

Expected Results

The graph view to show some indication of stages still running, as this can make builds look like they are complete, while they are still running

Actual Results

Job page showing build appears to be complete Screenshot 2024-05-30 at 10-16-27 Parallel Looks Like Complete Pipeline-Graph-View Jenkins Build graph showing build is still running Screenshot 2024-05-30 at 10-16-36 Graph Parallel Looks Like Complete Pipeline-Graph-View #3 Jenkins

Anything else?

No response

Are you interested in contributing a fix?

No response

SaturnIC commented 2 months ago

Its even worse when one stage succeeds in the parallel stage and later another parallel stage fails, the pipeline graph will look like all the parallel stages succeeded when in fact at least one didn't.

mortonl commented 1 month ago

We've noticed what I think is a related issue today: When looking at the job level pipeline graph for multiple parallel stages it shows as an empty circle: image

But when we go into the build page it shows correctly that the one relevant stage was completed successfully: image

timja commented 1 month ago

yes sounds related, the algorithm here could do with improving