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

          Jean-Paul G created issue -
          Jean-Paul G made changes -
          Description Original: With the following pipeline:
          {code:java}
          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" }
          {code}
          we are getting the following display in BlueOcean:

          !blueocean.png!

          But in the parallel step, only the third step as 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

          Typically in the Pipeline view it is displayed as expected:

          !stages.png!

          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.
          New: With the following pipeline:
          {code:java}
          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" }
          {code}
          we are getting the following display in BlueOcean:

          !blueocean.png!

          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:

          !stages.png!

          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 an boolean option to the parallel step not to use branch name as default display name in Blue Ocean ?
          Jean-Paul G made changes -
          Description Original: With the following pipeline:
          {code:java}
          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" }
          {code}
          we are getting the following display in BlueOcean:

          !blueocean.png!

          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:

          !stages.png!

          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 an boolean option to the parallel step not to use branch name as default display name in Blue Ocean ?
          New: With the following pipeline:
          {code:java}
          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" }
          {code}
          we are getting the following display in BlueOcean:

          !blueocean.png!

          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:

          !stages.png!

          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 ?
          Jean-Paul G made changes -
          Description Original: With the following pipeline:
          {code:java}
          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" }
          {code}
          we are getting the following display in BlueOcean:

          !blueocean.png!

          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:

          !stages.png!

          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 ?
          New: With the following pipeline:
          {code:java}
          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" }
          {code}
          we are getting the following display in BlueOcean:

          !blueocean.png!

          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:

          !stages.png!

          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 ?

          James Dumay added a comment -

          jguigui this is related to a bunch of problems around sophisticated Pipelines.

          I am in the process of drafting a RFC to rationalise parallel usage.

          For example, in Declarative 1.2 we've introduced the following syntax called "Parallel Stages"

          stage('foo') {
              parallel {
                  stage('Firefox') {
                      steps {
                          echo "First branch"
                      }
                  }
                  stage('Chrome') {
                      steps {
                          echo "Second branch"
                      }
                  }
              }
          }
          

          The advantage here is that we now have different syntaxes for parallel execution and parallel stages.

          For reference the current syntax looks like:

          stage('foo') {
              parallel(
          		'copy-1': {
          			... copy some files ...
          		},
          		'copy-2': {
          			... copy some files ...
          		},
          		'some other process': {
          			 parallel(
          				'branch-1': {
          					... run process 1 ...
          				},
          				'branch-2': {
          					... run process 2 ...
          				}
          			)
          		}
          	)
          }
          

          With the syntax above its possible to next parallels infinitely and this is something Blue Ocean isn't likely to support.

          What I would like to do is:

          • Make the new Parallel Stage syntax the only way to visualise parallel
          • Parallel executions get folded into the nearest "stage" and their steps appear in the step listing according to their execution order.

          This is still some time away but it would cover the case you have outlined here.

          Let me know what you think

          James Dumay added a comment - jguigui this is related to a bunch of problems around sophisticated Pipelines. I am in the process of drafting a RFC to rationalise parallel usage. For example, in Declarative 1.2 we've introduced the following syntax called "Parallel Stages" stage( 'foo' ) { parallel { stage( 'Firefox' ) { steps { echo "First branch" } } stage( 'Chrome' ) { steps { echo "Second branch" } } } } The advantage here is that we now have different syntaxes for parallel execution and parallel stages. For reference the current syntax looks like: stage( 'foo' ) { parallel( 'copy-1' : { ... copy some files ... }, 'copy-2' : { ... copy some files ... }, 'some other process' : { parallel( 'branch-1' : { ... run process 1 ... }, 'branch-2' : { ... run process 2 ... } ) } ) } With the syntax above its possible to next parallels infinitely and this is something Blue Ocean isn't likely to support. What I would like to do is: Make the new Parallel Stage syntax the only way to visualise parallel Parallel executions get folded into the nearest "stage" and their steps appear in the step listing according to their execution order. This is still some time away but it would cover the case you have outlined here. Let me know what you think
          James Dumay made changes -
          Epic Link New: JENKINS-43953 [ 181485 ]

          Jean-Paul G added a comment - - edited

          Hi James,

          I think there are two orthogonal concepts here:

          • the parallel branches used to run in parallel (on different cpu for instance) several tasks
          • the stage used for display purpose

          To be flexible and cover all the use cases, we need to have these two concept independent.
          Typically we may want:

          1. in a same branch have sequential stages
          2. in a same branch have nested stages
          3. having branch without stage (aka no display)

          Looks like your RFC is covering cases 1. and 2. but not 3.

          Today limitation with current implementation are:

          • the parallel branch is creating a stage with this branch name as the stage name
          • branches with no stages are displayed (linked to first point here above)
          • nested stages are not displayed

          Having the branch name (used in the log) different from the stage name (used in Blue Ocean display) is useful too.

          Regarding the representation of nested stages I like your suggestion. There is similar discussion on JENKINS-38442.

          Last point I can think about, is how to represent stage with same name in a parallel step. Typically when lot of branches are generated by a for loop. I'm not sure of the best option:

          • either aggregate them in one display (with eventually a badge indicating the number of stages with same name)
          • either display each of them

          Jean-Paul

          Jean-Paul G added a comment - - edited Hi James, I think there are two orthogonal concepts here: the parallel branches used to run in parallel (on different cpu for instance) several tasks the stage used for display purpose To be flexible and cover all the use cases, we need to have these two concept independent. Typically we may want: in a same branch have sequential stages in a same branch have nested stages having branch without stage (aka no display) Looks like your RFC is covering cases 1. and 2. but not 3. Today limitation with current implementation are: the parallel branch is creating a stage with this branch name as the stage name branches with no stages are displayed (linked to first point here above) nested stages are not displayed Having the branch name (used in the log) different from the stage name (used in Blue Ocean display) is useful too. Regarding the representation of nested stages I like your suggestion. There is similar discussion on JENKINS-38442 . Last point I can think about, is how to represent stage with same name in a parallel step. Typically when lot of branches are generated by a for loop. I'm not sure of the best option: either aggregate them in one display (with eventually a badge indicating the number of stages with same name) either display each of them Jean-Paul

          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 made changes -
          Link New: This issue is related to JENKINS-38442 [ JENKINS-38442 ]

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

              Created:
              Updated:
              Resolved: