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

Blue Ocean Pipeline: only first skipped cell of matrix shown as skipped

    Details

    • Similar Issues:

      Description

      When stages within a matrix are skipped using the 'when' directive, the pipeline result is not rendered correctly. The first cell of the matrix is correctly shown as 'Skipped', however subsequent cells are shown as 'Passed' (in 0s). This is very confusing.

       

      #!groovy
      pipeline {  
        agent none
        parameters {
          booleanParam( name: 'matrix', defaultValue: true )
          booleanParam( name: 'parallel', defaultValue: true )
        }  
        stages {
      
          stage( 'matrix' ) {
            matrix {
              axes {
                axis {
                  name 'server'
                  values 'server-one', 'server-two'
                }
              }
              stages {
                stage( 'matrix' ) {
                  agent {
                    label "${server}"
                  }
                  when {
                    expression { params.matrix }
                  }
                  steps {
                    echo "matrix ${server}"
                  }
                }
              }
            }      
          }
          
          stage( 'parallel' ) {
          
            parallel {
      
              stage( 'parallel-one' ) {
                agent {
                  label 'server-one'
                }
                when {
                  expression { params.parallel }
                }
                steps {
                  echo 'parallel-one'
                }
              }        stage( 'parallel-two' ) {
                agent {
                  label 'server-two'
                }
                when {
                  expression { params.parallel }
                }
                steps {
                  echo 'parallel-two'
                }
              }
              
            }
          }
          
        } // stages
      
      } // pipeline
      

       

        Attachments

          Activity

          smd Stefan Drissen created issue -
          smd Stefan Drissen made changes -
          Field Original Value New Value
          Description When stages within a matrix are skipped using the when, directive, the build is not rendered correctly. The first cell of the matrix is correctly shown as 'Skipped', the subsequent cells are shown as 'Passed' (in 0s). This is very confusing.

           
          {noformat}
          #!groovy
          pipeline {
            agent none
            parameters {
              booleanParam( name: 'matrix', defaultValue: true )
              booleanParam( name: 'parallel', defaultValue: true )
            }
            stages {

              stage( 'matrix' ) {
                matrix {
                  axes {
                    axis {
                      name 'server'
                      values 'server-one', 'server-two'
                    }
                  }
                  stages {
                    stage( 'matrix' ) {
                      agent {
                        label "${server}"
                      }
                      when {
                        expression { params.matrix }
                      }
                      steps {
                        echo "matrix ${server}"
                      }
                    }
                  }
                }
              }
              
              stage( 'parallel' ) {
              
                parallel {

                  stage( 'parallel-one' ) {
                    agent {
                      label 'server-one'
                    }
                    when {
                      expression { params.parallel }
                    }
                    steps {
                      echo 'parallel-one'
                    }
                  } stage( 'parallel-two' ) {
                    agent {
                      label 'server-two'
                    }
                    when {
                      expression { params.parallel }
                    }
                    steps {
                      echo 'parallel-two'
                    }
                  }
                  
                }
              }
              
            } // stages

          } // pipeline
          {noformat}
          !image-2020-03-24-09-29-52-211.png!

           
          When stages within a matrix are skipped using the 'when' directive, the build result is not rendered correctly. The first cell of the matrix is correctly shown as 'Skipped', however subsequent cells are shown as 'Passed' (in 0s). This is very confusing.

           
          {noformat}
          #!groovy
          pipeline {
            agent none
            parameters {
              booleanParam( name: 'matrix', defaultValue: true )
              booleanParam( name: 'parallel', defaultValue: true )
            }
            stages {

              stage( 'matrix' ) {
                matrix {
                  axes {
                    axis {
                      name 'server'
                      values 'server-one', 'server-two'
                    }
                  }
                  stages {
                    stage( 'matrix' ) {
                      agent {
                        label "${server}"
                      }
                      when {
                        expression { params.matrix }
                      }
                      steps {
                        echo "matrix ${server}"
                      }
                    }
                  }
                }
              }
              
              stage( 'parallel' ) {
              
                parallel {

                  stage( 'parallel-one' ) {
                    agent {
                      label 'server-one'
                    }
                    when {
                      expression { params.parallel }
                    }
                    steps {
                      echo 'parallel-one'
                    }
                  } stage( 'parallel-two' ) {
                    agent {
                      label 'server-two'
                    }
                    when {
                      expression { params.parallel }
                    }
                    steps {
                      echo 'parallel-two'
                    }
                  }
                  
                }
              }
              
            } // stages

          } // pipeline
          {noformat}
          !image-2020-03-24-09-29-52-211.png!

           
          smd Stefan Drissen made changes -
          Description When stages within a matrix are skipped using the 'when' directive, the build result is not rendered correctly. The first cell of the matrix is correctly shown as 'Skipped', however subsequent cells are shown as 'Passed' (in 0s). This is very confusing.

           
          {noformat}
          #!groovy
          pipeline {
            agent none
            parameters {
              booleanParam( name: 'matrix', defaultValue: true )
              booleanParam( name: 'parallel', defaultValue: true )
            }
            stages {

              stage( 'matrix' ) {
                matrix {
                  axes {
                    axis {
                      name 'server'
                      values 'server-one', 'server-two'
                    }
                  }
                  stages {
                    stage( 'matrix' ) {
                      agent {
                        label "${server}"
                      }
                      when {
                        expression { params.matrix }
                      }
                      steps {
                        echo "matrix ${server}"
                      }
                    }
                  }
                }
              }
              
              stage( 'parallel' ) {
              
                parallel {

                  stage( 'parallel-one' ) {
                    agent {
                      label 'server-one'
                    }
                    when {
                      expression { params.parallel }
                    }
                    steps {
                      echo 'parallel-one'
                    }
                  } stage( 'parallel-two' ) {
                    agent {
                      label 'server-two'
                    }
                    when {
                      expression { params.parallel }
                    }
                    steps {
                      echo 'parallel-two'
                    }
                  }
                  
                }
              }
              
            } // stages

          } // pipeline
          {noformat}
          !image-2020-03-24-09-29-52-211.png!

           
          When stages within a matrix are skipped using the 'when' directive, the pipeline result is not rendered correctly. The first cell of the matrix is correctly shown as 'Skipped', however subsequent cells are shown as 'Passed' (in 0s). This is very confusing.

           
          {noformat}
          #!groovy
          pipeline {
            agent none
            parameters {
              booleanParam( name: 'matrix', defaultValue: true )
              booleanParam( name: 'parallel', defaultValue: true )
            }
            stages {

              stage( 'matrix' ) {
                matrix {
                  axes {
                    axis {
                      name 'server'
                      values 'server-one', 'server-two'
                    }
                  }
                  stages {
                    stage( 'matrix' ) {
                      agent {
                        label "${server}"
                      }
                      when {
                        expression { params.matrix }
                      }
                      steps {
                        echo "matrix ${server}"
                      }
                    }
                  }
                }
              }
              
              stage( 'parallel' ) {
              
                parallel {

                  stage( 'parallel-one' ) {
                    agent {
                      label 'server-one'
                    }
                    when {
                      expression { params.parallel }
                    }
                    steps {
                      echo 'parallel-one'
                    }
                  } stage( 'parallel-two' ) {
                    agent {
                      label 'server-two'
                    }
                    when {
                      expression { params.parallel }
                    }
                    steps {
                      echo 'parallel-two'
                    }
                  }
                  
                }
              }
              
            } // stages

          } // pipeline
          {noformat}
          !image-2020-03-24-09-29-52-211.png!

           
          smd Stefan Drissen made changes -
          Priority Minor [ 4 ] Major [ 3 ]
          smd Stefan Drissen made changes -
          Attachment image-2020-03-25-17-31-20-694.png [ 50750 ]
          smd Stefan Drissen made changes -
          Attachment image-2020-03-25-17-31-24-907.png [ 50751 ]

            People

            • Assignee:
              Unassigned
              Reporter:
              smd Stefan Drissen
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: