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

Parallel branches with no stage should not be displayed in Blue Ocean

      With the following pipeline:

      stage("begin") { println "begin" }
      
      parallel (
          "no_stage": { println "no stage" },
          
          "": { println "no name" },
          
          "with_stage": { stage("my_stage") { println "named stage" } }
      )
      
      stage("end") { println "end" }
      

      we are getting the following display in BlueOcean:

      But in the parallel step, only the third branch has a stage defined, and therefore only this one is expected to be displayed. Unfortunately all the branches are displayed even if not containing any stage.
      Additionally, the name displayed for the third branch is the branch name instead of the stage name as one would have thought.

      On the other hand, in the Pipeline view it is displayed as expected:

      Use case: technical steps which need to run in parallel to maintain shared resources, advance timeout monitoring, etc ... doesn't have to pollute the Blue Ocean view.

      May be possible to add a boolean option to the parallel step not to use branch name as default display name in Blue Ocean, and eventually make branch with no stage invisible ?

          [JENKINS-44820] Parallel branches with no stage should not be displayed in Blue Ocean

          James Dumay added a comment - - edited

          jguigui

          having branch without stage (aka no display)

          These will still need to be in a stage but you would not see the "parallels" in the visualisation. You need the enclosing stage for us to display the steps within the parallel.

          In your example, if we made these changes, your visualisation would look like:

          It is also highly unlikely we will be ever able to visualise infinitely nested parallels. This proposal would not attempt to address that use case.

          Thanks for the response

          James Dumay added a comment - - edited jguigui having branch without stage (aka no display) These will still need to be in a stage but you would not see the "parallels" in the visualisation. You need the enclosing stage for us to display the steps within the parallel. In your example, if we made these changes, your visualisation would look like: It is also highly unlikely we will be ever able to visualise infinitely nested parallels. This proposal would not attempt to address that use case. Thanks for the response

          Jean-Paul G added a comment - - edited

          Hi James,

          If I understood properly, you mean that the following pipeline:

          stage("begin") { println "begin" }
          
          stage('stage_parallel') {
              parallel {
                  stage('stage_p1') {
                      steps {
                          echo "First branch"
                      }
                  }
                  stage(''stage_p2') {
                      steps {
                          echo "Second branch"
                      }
                  }
              }
          }
          
          stage("end") { println "end" }
          
          

          will not display the nested stage_p1 and stage_p2 and generate this:

           

           

          Jean-Paul G added a comment - - edited Hi James, If I understood properly, you mean that the following pipeline: stage( "begin" ) { println "begin" } stage( 'stage_parallel' ) { parallel { stage( 'stage_p1' ) { steps { echo "First branch" } } stage( ''stage_p2' ) { steps { echo "Second branch" } } } } stage( "end" ) { println "end" } will not display the nested stage_p1 and stage_p2 and generate this:    

          James Dumay added a comment -

          jguigui that is correct

          James Dumay added a comment - jguigui that is correct

          James Dumay added a comment - - edited

          jguigui actually, I spoke too soon. This pipeline:

          stage("begin") { println "begin" }
          
          stage('stage_parallel') {
              parallel {
                  'stage_p1': {
                          echo "First branch"
                  }
                   'stage_p2': {
                          echo "Second branch"
                  }
              }
          }
          
          stage("end") { println "end" }
          

          Would produce:

          James Dumay added a comment - - edited jguigui actually, I spoke too soon. This pipeline: stage( "begin" ) { println "begin" } stage( 'stage_parallel' ) { parallel { 'stage_p1' : { echo "First branch" } 'stage_p2' : { echo "Second branch" } } } stage( "end" ) { println "end" } Would produce:

          Jean-Paul G added a comment -

          And the following pipeline with some branches not inside any stage:

          stage("begin") { println "begin" }
          
          stage('stage_parallel') {
              parallel {
                  stage('stage_p1') {
                      steps {
                          echo "First branch"
                      }
                  }
                  stage('stage_p2') {
                      steps {
                          echo "Second branch"
                      }
                  }
                  'invisible_branch_p3': {
                          echo "Third branch"
                  }
                  'invisible_branch_p4': {
                          echo "Fourth branch"
                  }
              }
          }
          
          stage("end") { println "end" }
          

          would produce with the proposed RFC:

           

          If it's the case, I've my use cases covered.

          Agree with you, multiple nested case will be difficult to display.

          Thanks a lot,

          Jean-Paul

           

          Jean-Paul G added a comment - And the following pipeline with some branches not inside any stage: stage( "begin" ) { println "begin" } stage( 'stage_parallel' ) { parallel { stage( 'stage_p1' ) { steps { echo "First branch" } } stage( 'stage_p2' ) { steps { echo "Second branch" } } 'invisible_branch_p3' : { echo "Third branch" } 'invisible_branch_p4' : { echo "Fourth branch" } } } stage( "end" ) { println "end" } would produce with the proposed RFC:   If it's the case, I've my use cases covered. Agree with you, multiple nested case will be difficult to display. Thanks a lot, Jean-Paul  

          James Dumay added a comment -

          jguigui you wouldn't be able to put both parallel syntaxes within the same stage with the proposal as it stands

          James Dumay added a comment - jguigui you wouldn't be able to put both parallel syntaxes within the same stage with the proposal as it stands

          Jean-Paul G added a comment -

          I hope you may reconsider the RFC. Definitely by splitting the execution (branch) and the display (stage) concepts, users will be given a much better flexibility. 

          Jean-Paul G added a comment - I hope you may reconsider the RFC. Definitely by splitting the execution (branch) and the display (stage) concepts, users will be given a much better flexibility. 

          James Dumay added a comment -

          jguigui its still in the planning stages so I will consider when driving a decision on this one

          James Dumay added a comment - jguigui its still in the planning stages so I will consider when driving a decision on this one

          Jean-Paul G added a comment -

          Great ! Thank you very much 

          Jean-Paul

          Jean-Paul G added a comment - Great ! Thank you very much  Jean-Paul

          James Dumay added a comment -

          Merging this within JENKINS-47799 as it will likely be the solution we are heading towards.

          James Dumay added a comment - Merging this within JENKINS-47799 as it will likely be the solution we are heading towards.

            Unassigned Unassigned
            jguigui Jean-Paul G
            Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: