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

Pipeline with parallel and no stages does not get visualised correctly

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • blueocean-plugin
    • None
    • tethys

      Problem
      If you have a parallel declaration, but no stages, in classic stage view nothing shows up (you just have to look at log). In blue ocean, you get a single node (stage) which shows only the first branch.
      Expected behavior: should show 3 parallel branches (ideally)

      Example

      parallel 'branch1': {
              node('node1') {
                  stage('Setup') {
                      checkout([details removed])
                  }
                  stage('Unit and Integration Tests') {
                      bat '"my command to execute tests"'
                  }
              }
      }, 'branch2': {
              node('node2') {
                  stage('Setup') {
                      checkout([details removed])
                  }
                  stage('Unit and Integration Tests') {
                      bat '"my command to execute tests"'
                  }
              }
      }
      

      Workaround
      Simply wrap the parallels in a stage and it will work correctly.

      stage('Build and Test') {
        parallel 'branch1': {
                node('node1') {
                    stage('Setup') {
                        checkout([details removed])
                    }
                    stage('Unit and Integration Tests') {
                        bat '"my command to execute tests"'
                    }
                }
        }, 'branch2': {
                node('node2') {
                    stage('Setup') {
                        checkout([details removed])
                    }
                    stage('Unit and Integration Tests') {
                        bat '"my command to execute tests"'
                    }
                }
        }
      }
      

      It will then be visualised like:

      Other examples

      Parallel defined between stages but not nested in its own stage

      node {
      	stage('Checkout') {
      		checkout scm
      	}
      }
      
      parallel linux: {
      	node('Linux') {
      		stage('Build') {
      			echo 'Build linux'
      		}
      		stage('Tests') {
      			echo 'Tests linux'
      		}
      		stage('Static analysis') {
      			echo 'Static analysis linux'
      		}
      	}
      },
      windows: {
      	node('Windows') {
      		stage('Build') {
      			echo 'Build windows'
      		}
      		stage('Tests') {
      			echo 'Tests windows'
      		}
      		stage('Static analysis') {
      			echo 'Static analysis windows'
      		}
      	}
      }
      

      Result looks like this:

          [JENKINS-39464] Pipeline with parallel and no stages does not get visualised correctly

          Michael Neale created issue -
          Michael Neale made changes -
          Description Original: If you have a parallel declaration, but no stages, in classic stage view nothing shows up (you just have to look at log). In blue ocean, you get a single node (stage) which shows only the first branch.

          Expected behavior: should show 3 parallel branches (ideally)

          The pipeline below results in this visualisation:

           !Screen Shot 2016-11-03 at 12.24.11 pm.png|thumbnail!

          The pipeline:

          {noformat}
          parallel(lint: {
                      node {
                          echo "yeah"
                      }
                  },
                  verifyZoneFiles: {
                      node {
                          echo "yeah"
                      }

                  },
                  rspec: {
                      node {
                          echo "yeah"
                      }

                  },
              )
          {noformat}
          New: If you have a parallel declaration, but no stages, in classic stage view nothing shows up (you just have to look at log). In blue ocean, you get a single node (stage) which shows only the first branch.

          Expected behavior: should show 3 parallel branches (ideally)

          The pipeline below results in this visualisation:

           !Screen Shot 2016-11-03 at 12.24.11 pm.png|thumbnail!

          The pipeline:

          {noformat}
          parallel(lint: {
                      node {
                          echo "yeah"
                      }
                  },
                  verifyZoneFiles: {
                      node {
                          echo "yeah"
                      }

                  },
                  rspec: {
                      node {
                          echo "yeah"
                      }

                  },
              )
          {noformat}

          Suggested solution: in this case put a virtual "stage('parrallel') {...}" around it - then the visualisation is correct (3 dots in a column)
          Michael Neale made changes -
          Epic Link New: JENKINS-35759 [ 171771 ]

          Michael Neale added a comment -

          Not sure if this should be fixed in API or front end. Leaning to former.

          Michael Neale added a comment - Not sure if this should be fixed in API or front end. Leaning to former.
          James Dumay made changes -
          Sprint New: tasman [ 136 ]

          James Dumay added a comment -

          rtyler thanks for reporting this one. We are likely to take this on in the coming weeks. As a work around you can wrap your parallel in a stage.

          James Dumay added a comment - rtyler thanks for reporting this one. We are likely to take this on in the coming weeks. As a work around you can wrap your parallel in a stage.

          James Dumay added a comment -

          tscherler / vivek is this likely to be a frontend or backend issue?

          James Dumay added a comment - tscherler / vivek is this likely to be a frontend or backend issue?

          James Dumay added a comment -

          Now we have a start dot we can fix this problem as part of JENKINS-39628

          James Dumay added a comment - Now we have a start dot we can fix this problem as part of JENKINS-39628
          James Dumay made changes -
          Link New: This issue duplicates JENKINS-39628 [ JENKINS-39628 ]
          James Dumay made changes -
          Resolution New: Duplicate [ 3 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]

            vivek Vivek Pandey
            michaelneale Michael Neale
            Votes:
            8 Vote for this issue
            Watchers:
            23 Start watching this issue

              Created:
              Updated:
              Resolved: