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

Dynamic parallel step appears two times with one element

    Details

    • Type: Improvement
    • Status: Reopened (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Component/s: blueocean-plugin
    • Labels:
      None
    • Environment:
      Blueocean-plugin 1.1.1
      Jenkins 2.7.4
    • Sprint:
      Blue Ocean 1.4 - beta 2
    • Similar Issues:

      Description

      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!

        Attachments

          Issue Links

            Activity

            Hide
            jamesdumay James Dumay added a comment -

            Looks like a bug. Ill have someone take a look

            Show
            jamesdumay James Dumay added a comment - Looks like a bug. Ill have someone take a look
            Hide
            majano Daniel Majano added a comment -

            Some new with this Vivek Pandey ? Ty!

            Show
            majano Daniel Majano added a comment - Some new with this Vivek Pandey ? Ty!
            Hide
            vivek Vivek Pandey added a comment -

            Daniel Majano I could easily reproduce using your sample. Its a bug in visualization where it flattens parallel and enclosing stage - this makes stage clickable and it shows all steps executed inside it. This explains 'parallel stage' listing steps of a_1.

            I am going to work on a fix that will generate a graph aligned with how parallel branches are rendered in other cases. Something like below:

            Show
            vivek Vivek Pandey added a comment - Daniel Majano I could easily reproduce using your sample. Its a bug in visualization where it flattens parallel and enclosing stage - this makes stage clickable and it shows all steps executed inside it. This explains 'parallel stage' listing steps of a_1. I am going to work on a fix that will generate a graph aligned with how parallel branches are rendered in other cases. Something like below:
            Hide
            majano Daniel Majano added a comment -

            Vivek Pandey finally today I have updated the blue ocean plugin, but with the same code that I uploaded the first day with the ticket creation, the result still being the same:

            Show
            majano Daniel Majano added a comment - Vivek Pandey finally today I have updated the blue ocean plugin, but with the same code that I uploaded the first day with the ticket creation, the result still being the same:

              People

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

                Dates

                • Created:
                  Updated: