• Icon: New Feature New Feature
    • Resolution: Unresolved
    • Icon: Minor Minor
    • blueocean-plugin
    • None
    • Blue Ocean 1.1-beta4, Blue Ocean 1.1

      We have a company-wide Pipeline setup that uses global pipeline scripts. These scripts do all sort of "behind the scenes" things to make the lives of developers as easy as possible, and make going from first commit to a testable application on Jenkins cost the least amount of code/configuration.

      This is all working great, and developers don't really interact with Jenkins in any way, unless their build failed, and they want to know why.

      Right now, when they click the red cross on GitHub, they are redirected to the build status on the "blue" view, but then they are greeted with multiple steps, that have no meaning to them, and are (given our global scripts work as expected) not the cause of their problems, they just want to see the output of their test run, not all the surrounding steps that make it possible to run their build/test.

      So basically, what I'm looking for is two things:

      1. make step titles more descriptive (but this is already being tackled in another issue)
      2. add the option to hide specific steps from showing up, so devs only see what's relevant

      I did find this issue: https://issues.jenkins-ci.org/browse/JENKINS-26987

      But this is not about the blueocean plugin, and I do believe that the notion "Running Steps is itself intended to be a debugging view" does not apply here, as the blueocean view very much is intended to be as simple as possible for developers to get to the root of their problems, and not for the "Jenkins people" amongst us, who want to drill down into all the possible details there are (for which we still have the classic interface).

          [JENKINS-44094] Hide specific steps in build view

          James Dumay added a comment -

          jeanmertz what do you think of the proposal I wrote above?

          James Dumay added a comment - jeanmertz what do you think of the proposal I wrote above?

          Jean Mertz added a comment -

          I think grouping of steps would certainly be a great addition and improve the situation by a lot.

          Regarding this quote:

          > I am very hesitant of showing and hiding steps based on the authors desired visibility level or state

          What I am proposing is that step visibility be defined in a Jenkinsfile (or in our case, the global-pipeline-script code that is executed for each Jenkinsfile in our organisation). This way, it's a conscious decision made by the people maintaining the Jenkinsfile of a project or organisation.

          Another thing I noticed is that currently any steps that run after the last stage in a pipeline is completed, are not shown in the interface, and in fact it is possible to have a failed run (with a red bar at the top), without any failed stages (all stages are green, no steps are red).

          Jean Mertz added a comment - I think grouping of steps would certainly be a great addition and improve the situation by a lot. Regarding this quote: > I am very hesitant of showing and hiding steps based on the authors desired visibility level or state What I am proposing is that step visibility be defined in a Jenkinsfile (or in our case, the global-pipeline-script code that is executed for each Jenkinsfile in our organisation). This way, it's a conscious decision made by the people maintaining the Jenkinsfile of a project or organisation. Another thing I noticed is that currently any steps that run  after the last stage in a pipeline is completed, are not shown in the interface, and in fact it is possible to have a failed run (with a red bar at the top), without any failed stages (all stages are green, no steps are red).

          James Dumay added a comment -

          Another thing I noticed is that currently any steps that run after the last stage in a pipeline is completed, are not shown in the interface, and in fact it is possible to have a failed run (with a red bar at the top), without any failed stages (all stages are green, no steps are red).

          I assume you've got a Pipeline that looks like

          node {
             stage('stuff') {
               echo 'can be seen in ui'
             }
             echo('cannot be seen in ui');
          }
          

          The workaround here is to wrap those steps within a stage. We determined a while ago that we cannot reliably attach orphaned steps to the nearest stage or parallel and have it be what most people want.

          James Dumay added a comment - Another thing I noticed is that currently any steps that run after the last stage in a pipeline is completed, are not shown in the interface, and in fact it is possible to have a failed run (with a red bar at the top), without any failed stages (all stages are green, no steps are red). I assume you've got a Pipeline that looks like node { stage( 'stuff' ) { echo 'can be seen in ui' } echo( 'cannot be seen in ui' ); } The workaround here is to wrap those steps within a stage. We determined a while ago that we cannot reliably attach orphaned steps to the nearest stage or parallel and have it be what most people want.

          James Dumay added a comment -

          jeanmertz as a general rule we do not want to hide steps for that exact reason. There are design problems in the original Pipeline script syntax that allowed a developer to write Pipelines that can't be visualised such as the orphaned step issue above and nesting stages/parallels.

          If we hide your global library steps from the visualization then we run into the same problem (all steps are green but the Pipeline shows failed) and that is a bigger usability issue than the one we are trying to solve here (hiding steps).

          We won't be providing a way to hide the steps. However, we can consider grouping steps into a single step so at least there are a smaller amount of steps visualized.

          James Dumay added a comment - jeanmertz as a general rule we do not want to hide steps for that exact reason. There are design problems in the original Pipeline script syntax that allowed a developer to write Pipelines that can't be visualised such as the orphaned step issue above and nesting stages/parallels. If we hide your global library steps from the visualization then we run into the same problem (all steps are green but the Pipeline shows failed) and that is a bigger usability issue than the one we are trying to solve here (hiding steps). We won't be providing a way to hide the steps. However, we can consider grouping steps into a single step so at least there are a smaller amount of steps visualized.

          Vicky Chijwani added a comment - - edited

          This is a huge problem for us too. We have 100s of developers relying on a global shared library that abstracts out a lot of common functionality, exactly as described in the original issue description. It would be great to see the group proposal above implemented - it would definitely solve most of the problem.

          Vicky Chijwani added a comment - - edited This is a huge problem for us too. We have 100s of developers relying on a global shared library that abstracts out a lot of common functionality, exactly as described in the original issue description. It would be great to see the  group proposal above implemented - it would definitely solve most of the problem.

          I have an example of situations when hiding stages are required.

          Multi-branch pipeline, when push on different branch should create a different slave node in different network segment.

          In order to filter specific use case we are using WHEN condition.

          In such case, there are lots of 'pseudo' stages like "Branch: dev/master", "Branch: dev", "Env: development", "Env: production", "Branch: master".

          Such drill down also breaks the console output as two stages running in UI (for example: Branch: dev and Spawn Slave)

          stage("Branch: dev/master"){
            parallel {
              stage("Env: development") {
                when {
                  allOf {
                    branch 'dev'
                    environment name: 'CHANGE_TARGET', value: ''
                  }
                }
                stages {
                  stage("Branch: dev"){
                    agent {label "development-slave"}
                    stages {
                      stage("Spawn Slave") {
                        steps {
                          sh 'command'
                        }
                        post {
                          failure {
                            sh 'command'
                          }
                          aborted {
                            sh 'command'
                          }
                        }
                      }
                      stage("Base Image") {
                        steps {
                          sh 'command'
                        }
                        post {
                          aborted {
                            sh 'command'
                          }
                          failure {
                            sh 'command'
                          }
                        }
                      }
                      stage("Dev Image") {
                        steps {
                          sh 'command'
                        }
                        post {
                          aborted {
                            sh 'command'
                          }
                          failure {
                            sh 'command'
                          }
                        }
                      }
                      stage("Notify Team"){
                        agent {label "master"}
                        steps {
                          sh 'command'
                        }
                      }
                      stage('Deploy QA') {
                        steps {
                          sh 'command'
                        }
                        post {
                          success {
                            sh 'command'
                          }
                          failure {
                            sh 'command'
                          }
                          aborted {
                            sh 'command'
                          }
                          always {
                            sh 'command'
                          }
                        }
                      }
                    }
                  }
                }
              }
              stage("Env: production") {
                when {
                  allOf {
                    branch 'master'
                    environment name: 'CHANGE_TARGET', value: ''
                  }
                }
                stages {
                  stage("Branch: master"){
                    agent {label "production-slave"}
                    stages {
                      stage("Spawn Slave") {
                        steps {
                          sh 'command'
                        }
                        post {
                          failure {
                            sh 'command'
                          }
                          aborted {
                            sh 'command'
                          }
                        }
                      }
                      stage("Base Image") {
                        steps {
                          sh 'command'
                        }
                        post {
                          aborted {
                            sh 'command'
                          }
                          failure {
                            sh 'command'
                          }
                        }
                      }
                      stage("Prod Image") {
                        steps {
                          sh 'command'
                        }
                        post {
                          success {
                            sh ' command'
                          }
                          failure {
                            sh 'command'
                          }
                          aborted {
                            sh 'command'
                          }
                          always {
                            sh 'command'
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
          

          Anton Yurchenko added a comment - I have an example of situations when hiding stages are required. Multi-branch pipeline, when push on different branch should create a different slave node in different network segment. In order to filter specific use case we are using WHEN condition. In such case, there are lots of 'pseudo' stages like "Branch: dev/master", "Branch: dev", "Env: development", "Env: production", "Branch: master". Such drill down also breaks the console output as two stages running in UI (for example: Branch: dev and Spawn Slave) stage( "Branch: dev/master" ){ parallel { stage( "Env: development" ) { when { allOf { branch 'dev' environment name: 'CHANGE_TARGET' , value: '' } } stages { stage( "Branch: dev" ){ agent {label "development-slave" } stages { stage( "Spawn Slave" ) { steps { sh 'command' } post { failure { sh 'command' } aborted { sh 'command' } } } stage( "Base Image" ) { steps { sh 'command' } post { aborted { sh 'command' } failure { sh 'command' } } } stage( "Dev Image" ) { steps { sh 'command' } post { aborted { sh 'command' } failure { sh 'command' } } } stage( "Notify Team" ){ agent {label "master" } steps { sh 'command' } } stage( 'Deploy QA' ) { steps { sh 'command' } post { success { sh 'command' } failure { sh 'command' } aborted { sh 'command' } always { sh 'command' } } } } } } } stage( "Env: production" ) { when { allOf { branch 'master' environment name: 'CHANGE_TARGET' , value: '' } } stages { stage( "Branch: master" ){ agent {label "production-slave" } stages { stage( "Spawn Slave" ) { steps { sh 'command' } post { failure { sh 'command' } aborted { sh 'command' } } } stage( "Base Image" ) { steps { sh 'command' } post { aborted { sh 'command' } failure { sh 'command' } } } stage( "Prod Image" ) { steps { sh 'command' } post { success { sh ' command' } failure { sh 'command' } aborted { sh 'command' } always { sh 'command' } } } } } } } } }

          bruno teixeira added a comment - - edited

          I also have a specific use case in my company. We use jenkins & global shared libraries extensively to setup the build's workspaces.

          There are several steps (like creating folders, setting packages feeds, injecting env variables...) that i would like to "hide" from the users so that the commands that the users actually run are not mixed with shared libraries. This is because the steps in the shared libraries are not the end user's concern and often it becomes a bundled mess from the user's perspective.

           

          This is not a hard requirement, merely a UX improvement that i would like.

          bruno teixeira added a comment - - edited I also have a specific use case in my company. We use jenkins & global shared libraries extensively to setup the build's workspaces. There are several steps (like creating folders, setting packages feeds, injecting env variables...) that i would like to "hide" from the users so that the commands that the users actually run are not mixed with shared libraries. This is because the steps in the shared libraries are not the end user's concern and often it becomes a bundled mess from the user's perspective.   This is not a hard requirement, merely a UX improvement that i would like.

          GMarquez added a comment -

          I think the ability to hide stages is useful. There are several small trivial stages in my pipeline and would like the ability to hide if possible. It would be nice to not see in OceanBlue but perhaps could still log in standard console output (in case any issues). 

          Topic: Add ability to hide skipped stages/ignore stages altogether (support DRY) , similar but not same, I like Timur Batyrshin's suggestion:
          https://issues.jenkins-ci.org/browse/JENKINS-48980?focusedCommentId=345319&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-345319

          hide true 
          // hide false // default

          GMarquez added a comment - I think the ability to hide stages is useful. There are several small trivial stages in my pipeline and would like the ability to hide if possible. It would be nice to not see in OceanBlue but perhaps could still log in standard console output (in case any issues).  Topic: Add ability to hide skipped stages/ignore stages altogether (support DRY) , similar but not same, I like Timur Batyrshin's suggestion: https://issues.jenkins-ci.org/browse/JENKINS-48980?focusedCommentId=345319&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-345319 hide true  // hide false // default

          Thomas Peitz added a comment - - edited

          We are using a shared jenkins library for our company which allows our developers to set up pipelines pretty easily.

          In the configuration of the pipelines we allow to enable / disable steps. Here is an example of a Jenkinsfile:

           

          @Library('ivx@0.1.0') _

           

          buildPipelineKubernetes {

             productionDeployment = false

             lintOpenApi = false

          }

           

          It works pretty good for us and removed the need that developer need to know how Jenkins works. It boosted developer happiness enormously.

           

          Now our deployment pipelines have a lot of steps which are just "white" as they are not executed for the project. For this particular project steps won't be ever executed. So it bloats the view and gives devs bad user experience.

           

          So for us it would be nice to be able to hide steps if they are not executed. Is there any chance we can implement this feature ourselves? - We would take time and try to create a pull request if there is a solution which would be accepted.

           

          We would favor the contribution rather of going back to scripted pipelines again.

           

          Greetings, Thomas 

          Thomas Peitz added a comment - - edited We are using a shared jenkins library for our company which allows our developers to set up pipelines pretty easily. In the configuration of the pipelines we allow to enable / disable steps. Here is an example of a Jenkinsfile:   @Library('ivx@0.1.0') _   buildPipelineKubernetes {    productionDeployment = false    lintOpenApi = false }   It works pretty good for us and removed the need that developer need to know how Jenkins works. It boosted developer happiness enormously.   Now our deployment pipelines have a lot of steps which are just "white" as they are not executed for the project. For this particular project steps won't be ever executed. So it bloats the view and gives devs bad user experience.   So for us it would be nice to be able to hide steps if they are not executed. Is there any chance we can implement this feature ourselves? - We would take time and try to create a pull request if there is a solution which would be accepted.   We would favor the contribution rather of going back to scripted pipelines again.   Greetings, Thomas 

          dor s added a comment -

          +1
          This feature is a must, it can ease the end user to get only the relevant stages instead of getting confused

          dor s added a comment - +1 This feature is a must, it can ease the end user to get only the relevant stages instead of getting confused

            jamesdumay James Dumay
            jeanmertz Jean Mertz
            Votes:
            27 Vote for this issue
            Watchers:
            24 Start watching this issue

              Created:
              Updated: