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

Dynamic parallel step appears two times with one element

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major Major
    • blueocean-plugin
    • None
    • Blueocean-plugin 1.1.1
      Jenkins 2.7.4
    • Blue Ocean 1.4 - beta 2

      Hi all,

      Recently, I have started to develop a few pipelines for my company. I´m tryinig to use a dynamic parallel step, but sometimes, the origin array/list can be only one element or empty.

      The problem is when only the array contain one element, the blueocean plugin show the execution two times.

      This is the normal view:

      BlueOcean view:

      And the code:

      node {
          
          stage('test' ) {
              println('pre parallel step')
          }
          
          
          stage('parallel stage') { 
              
              def array = ["a_1"]
          
              def builds = [:]
          
              array.each {
              
                  test = it
                  builds[it] = {
                      
                      node {
                          stage (it) {
                              println(it)   
                              sh 'date'
                          }
                      }
                  }
                  
                  
              }
              parallel builds
          
          }    
          
          stage('test2') {
              println('post parallel step')
          }
      

      Thanks you very much!

          [JENKINS-46490] Dynamic parallel step appears two times with one element

          Daniel Majano created issue -
          Daniel Majano made changes -
          Assignee New: James Dumay [ jamesdumay ]
          Daniel Majano made changes -
          Description Original: Hi all,

          Recently, I have started to develop a few pipelines for my company. I´m tryinig to use a dynamic parallel step, but sometimes, the origin array/list can be only one element or empty.

          The problem is when is only one element, the blueocean plugin show the execution two times.

          This is the normal view:

           !image-2017-08-28-08-14-59-547.png|thumbnail!

          BlueOcean view:

           !image-2017-08-28-08-15-52-537.png|thumbnail!

           !image-2017-08-28-08-16-19-023.png|thumbnail!

          And the code:


          {code:java}
          node {
              
              stage('test' ) {
                  println('pre parallel step')
              }
              
              
              stage('parallel stage') {
                  
                  def array = ["a_1"]
              
                  def builds = [:]
              
                  array.each {
                  
                      test = it
                      builds[it] = {
                          
                          node {
                              stage (it) {
                                  println(it)
                                  sh 'date'
                              }
                          }
                      }
                      
                      
                  }
                  parallel builds
              
              }
              
              stage('test2') {
                  println('post parallel step')
              }
          {code}


          Thanks you very much!
          New: Hi all,

          Recently, I have started to develop a few pipelines for my company. I´m tryinig to use a dynamic parallel step, but sometimes, the origin array/list can be only one element or empty.

          The problem is when only the array contain one element, the blueocean plugin show the execution two times.

          This is the normal view:

           !image-2017-08-28-08-14-59-547.png|thumbnail!

          BlueOcean view:

           !image-2017-08-28-08-15-52-537.png|thumbnail!

           !image-2017-08-28-08-16-19-023.png|thumbnail!

          And the code:


          {code:java}
          node {
              
              stage('test' ) {
                  println('pre parallel step')
              }
              
              
              stage('parallel stage') {
                  
                  def array = ["a_1"]
              
                  def builds = [:]
              
                  array.each {
                  
                      test = it
                      builds[it] = {
                          
                          node {
                              stage (it) {
                                  println(it)
                                  sh 'date'
                              }
                          }
                      }
                      
                      
                  }
                  parallel builds
              
              }
              
              stage('test2') {
                  println('post parallel step')
              }
          {code}


          Thanks you very much!
          James Dumay made changes -
          Epic Link New: JENKINS-35759 [ 171771 ]
          James Dumay made changes -
          Sprint New: Blue Ocean 1.3 - candidates [ 326 ]
          Assignee Original: James Dumay [ jamesdumay ] New: Vivek Pandey [ vivek ]
          James Dumay made changes -
          Rank New: Ranked higher
          James Dumay made changes -
          Epic Link Original: JENKINS-35759 [ 171771 ] New: JENKINS-43953 [ 181485 ]
          James Dumay made changes -
          Sprint Original: Blue Ocean 1.4 - candidates [ 326 ] New: Blue Ocean 1.4 - beta 2 [ 416 ]
          Vivek Pandey made changes -
          Attachment New: screenshot-1.png [ 40149 ]
          Vivek Pandey made changes -
          Attachment New: screenshot-2.png [ 40150 ]
          Vivek Pandey made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]

            vivek Vivek Pandey
            majano Daniel Majano
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: