Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-48884

Conditional parallel stages are not rendered properly if skipped by failed previous stage

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Component/s: blueocean-plugin
    • Labels:
      None
    • Environment:
      Jenkins 2.89
      Blue Ocean 1.35
      Pipeline Graph Analysis Plugin 1.6
    • Sprint:
      Blue Ocean 1.5 - beta 3
    • Similar Issues:

      Description

      Related to JENKINS-47219

      Problem

      When running a pipeline with parallel stages, the state of those stages is incorrectly displayed when a previous one has failed.

      JenkinsFile

      pipeline {
       agent any
       stages {
        stage('Run Tests') {
         steps {
          bat 'exit 1'
         }
        }
        stage('Deploy') {
         parallel {
          stage('Dev') {
           when {
            branch 'master'
           }
           steps {
            echo 'hello master'
           }
          }
          stage('QA') {
           steps {
            echo 'hello stable'
           }
          }
         }
        }
       }
      }
      
      

       

      Log output:

       

      First time build. Skipping changelog.
      [Pipeline] }
      [Pipeline] // stage
      [Pipeline] withEnv
      [Pipeline] {
      [Pipeline] stage
      [Pipeline] { (Run Tests)
      [Pipeline] bat
      [parallel-stage-complete-bug-JNC4NY4S375GSWLOMCSNQAMH4OIZKQT7UCEAS4OYPXLQVHI6A3XA] Running batch script
      
      C:\...>exit 1 
      [Pipeline] }
      [Pipeline] // stage
      [Pipeline] stage
      [Pipeline] { (Deploy)
      Stage 'Deploy' skipped due to earlier failure(s)
      [Pipeline] parallel
      [Pipeline] [Dev] { (Branch: Dev)
      [Pipeline] [QA] { (Branch: QA)
      [Pipeline] [Dev] stage
      [Pipeline] [Dev] { (Dev)
      [Pipeline] [QA] stage
      [Pipeline] [QA] { (QA)
      Stage 'Dev' skipped due to earlier failure(s)
      Stage 'QA' skipped due to earlier failure(s)
      [Pipeline] [Dev] }
      [Pipeline] [QA] }
      [Pipeline] [Dev] // stage
      [Pipeline] [QA] // stage
      [Pipeline] [Dev] }
      [Pipeline] [QA] }
      [Pipeline] // parallel
      [Pipeline] }
      [Pipeline] // stage
      [Pipeline] }
      [Pipeline] // withEnv
      [Pipeline] }
      [Pipeline] // node
      [Pipeline] End of Pipeline
      ERROR: script returned exit code 1
      Finished: FAILURE
      

      This gives the following output:

      Result when the pipe is successful:

      (Changing the exit 1 to exit 0)

      FYI: Cliff Meyers

        Attachments

          Issue Links

            Activity

            thdepauw Thomas De Pauw created issue -
            thdepauw Thomas De Pauw made changes -
            Field Original Value New Value
            Epic Link JENKINS-43953 [ 181485 ]
            thdepauw Thomas De Pauw made changes -
            Description Related to JENKINS-47219

            *Problem*

            When running a pipeline with parallel stages, the state of those stages is incorrectly displayed when a previous one has failed.

            *JenkinsFile*
            {code:java}
            pipeline {
            agent {
            node {
            label 'itc-nodes'
            }
            }
            stages {
            stage('Run Tests') {
            steps {
            bat 'exit 1'
            }
            }
            stage('Deploy') {
            parallel {
            stage('Dev') {
            when {
            branch 'master'
            }
            steps {
            echo 'hello master'
            }
            }
            stage('QA') {
            steps {
            echo 'hello stable'
            }
            }
            }
            }
            }
            }

            {code}
             

            *Log output*:

             
            {code:java}
            First time build. Skipping changelog.
            [Pipeline] }
            [Pipeline] // stage
            [Pipeline] withEnv
            [Pipeline] {
            [Pipeline] stage
            [Pipeline] { (Run Tests)
            [Pipeline] bat
            [parallel-stage-complete-bug-JNC4NY4S375GSWLOMCSNQAMH4OIZKQT7UCEAS4OYPXLQVHI6A3XA] Running batch script

            C:\...>exit 1
            [Pipeline] }
            [Pipeline] // stage
            [Pipeline] stage
            [Pipeline] { (Deploy)
            Stage 'Deploy' skipped due to earlier failure(s)
            [Pipeline] parallel
            [Pipeline] [Dev] { (Branch: Dev)
            [Pipeline] [QA] { (Branch: QA)
            [Pipeline] [Dev] stage
            [Pipeline] [Dev] { (Dev)
            [Pipeline] [QA] stage
            [Pipeline] [QA] { (QA)
            Stage 'Dev' skipped due to earlier failure(s)
            Stage 'QA' skipped due to earlier failure(s)
            [Pipeline] [Dev] }
            [Pipeline] [QA] }
            [Pipeline] [Dev] // stage
            [Pipeline] [QA] // stage
            [Pipeline] [Dev] }
            [Pipeline] [QA] }
            [Pipeline] // parallel
            [Pipeline] }
            [Pipeline] // stage
            [Pipeline] }
            [Pipeline] // withEnv
            [Pipeline] }
            [Pipeline] // node
            [Pipeline] End of Pipeline
            ERROR: script returned exit code 1
            Finished: FAILURE
            {code}
            This gives the following output:

            !failed-pipe-shows-skipped-as-green.png!

            Result when the pipe is successful:

            (Changing the exit 1 to exit 0)

            !success-pipe-run-with-skipped-stage.png!

            FYI: [~cliffmeyers]
            Related to -JENKINS-47219-

            *Problem*

            When running a pipeline with parallel stages, the state of those stages is incorrectly displayed when a previous one has failed.

            *JenkinsFile*
            {code:java}
            pipeline {
             agent any
             stages {
              stage('Run Tests') {
               steps {
                bat 'exit 1'
               }
              }
              stage('Deploy') {
               parallel {
                stage('Dev') {
                 when {
                  branch 'master'
                 }
                 steps {
                  echo 'hello master'
                 }
                }
                stage('QA') {
                 steps {
                  echo 'hello stable'
                 }
                }
               }
              }
             }
            }

            {code}
             

            *Log output*:

             
            {code:java}
            First time build. Skipping changelog.
            [Pipeline] }
            [Pipeline] // stage
            [Pipeline] withEnv
            [Pipeline] {
            [Pipeline] stage
            [Pipeline] { (Run Tests)
            [Pipeline] bat
            [parallel-stage-complete-bug-JNC4NY4S375GSWLOMCSNQAMH4OIZKQT7UCEAS4OYPXLQVHI6A3XA] Running batch script

            C:\...>exit 1
            [Pipeline] }
            [Pipeline] // stage
            [Pipeline] stage
            [Pipeline] { (Deploy)
            Stage 'Deploy' skipped due to earlier failure(s)
            [Pipeline] parallel
            [Pipeline] [Dev] { (Branch: Dev)
            [Pipeline] [QA] { (Branch: QA)
            [Pipeline] [Dev] stage
            [Pipeline] [Dev] { (Dev)
            [Pipeline] [QA] stage
            [Pipeline] [QA] { (QA)
            Stage 'Dev' skipped due to earlier failure(s)
            Stage 'QA' skipped due to earlier failure(s)
            [Pipeline] [Dev] }
            [Pipeline] [QA] }
            [Pipeline] [Dev] // stage
            [Pipeline] [QA] // stage
            [Pipeline] [Dev] }
            [Pipeline] [QA] }
            [Pipeline] // parallel
            [Pipeline] }
            [Pipeline] // stage
            [Pipeline] }
            [Pipeline] // withEnv
            [Pipeline] }
            [Pipeline] // node
            [Pipeline] End of Pipeline
            ERROR: script returned exit code 1
            Finished: FAILURE
            {code}
            This gives the following output:

            !failed-pipe-shows-skipped-as-green.png!

            Result when the pipe is successful:

            (Changing the exit 1 to exit 0)

            !success-pipe-run-with-skipped-stage.png!

            FYI: [~cliffmeyers]
            michaelneale Michael Neale made changes -
            Assignee Nicolae Pascu [ nicu ]
            michaelneale Michael Neale made changes -
            Sprint Blue Ocean 1.5 - beta 3 [ 491 ]
            nicu Nicolae Pascu made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            kzantow Keith Zantow made changes -
            Link This issue is duplicated by JENKINS-50399 [ JENKINS-50399 ]
            nicu Nicolae Pascu made changes -
            Status In Progress [ 3 ] In Review [ 10005 ]
            nicu Nicolae Pascu made changes -
            Remote Link This issue links to "#1702 (Web Link)" [ 20337 ]
            nicu Nicolae Pascu made changes -
            Status In Review [ 10005 ] Closed [ 6 ]
            Resolution Fixed [ 1 ]

              People

              • Assignee:
                nicu Nicolae Pascu
                Reporter:
                thdepauw Thomas De Pauw
              • Votes:
                5 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: