[JIRA] (JENKINS-61658) Blue Ocean Pipeline: only first skipped cell of matrix shown as skipped

0 views
Skip to first unread message

stefan.drissen@gmail.com (JIRA)

unread,
Mar 24, 2020, 4:31:02 AM3/24/20
to jenkinsc...@googlegroups.com
Stefan Drissen created an issue
 
Jenkins / Bug JENKINS-61658
Blue Ocean Pipeline: only first skipped cell of matrix shown as skipped
Issue Type: Bug Bug
Assignee: Unassigned
Attachments: image-2020-03-24-09-29-52-211.png
Components: blueocean-plugin, pipeline
Created: 2020-03-24 08:30
Environment: Jenkins 2.226
Priority: Minor Minor
Reporter: Stefan Drissen

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.

 

#!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

 

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo

stefan.drissen@gmail.com (JIRA)

unread,
Mar 24, 2020, 4:32:02 AM3/24/20
to jenkinsc...@googlegroups.com
Stefan Drissen updated an issue
Change By: Stefan Drissen
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', the however subsequent cells are shown as 'Passed' (in 0s). This is very confusing.

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

 

stefan.drissen@gmail.com (JIRA)

unread,
Mar 24, 2020, 4:35:02 AM3/24/20
to jenkinsc...@googlegroups.com
Stefan Drissen updated an issue
When stages within a matrix are skipped using the 'when' directive, the build 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.

stefan.drissen@gmail.com (JIRA)

unread,
Mar 24, 2020, 4:42:02 AM3/24/20
to jenkinsc...@googlegroups.com

stefan.drissen@gmail.com (JIRA)

unread,
Mar 25, 2020, 12:32:03 PM3/25/20
to jenkinsc...@googlegroups.com
Stefan Drissen updated an issue
Change By: Stefan Drissen
Attachment: image-2020-03-25-17-31-24-907.png

stefan.drissen@gmail.com (JIRA)

unread,
Mar 25, 2020, 12:32:04 PM3/25/20
to jenkinsc...@googlegroups.com
Stefan Drissen updated an issue
Change By: Stefan Drissen
Attachment: image-2020-03-25-17-31-20-694.png

stefan.drissen@gmail.com (JIRA)

unread,
Mar 25, 2020, 12:32:04 PM3/25/20
to jenkinsc...@googlegroups.com
Stefan Drissen commented on Bug JENKINS-61658
 
Re: Blue Ocean Pipeline: only first skipped cell of matrix shown as skipped

I just discovered that if I use the beforeAgent option on the when directive:

 

 

#!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 {
              beforeAgent true
              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 'sever-two'
          }
          when {
            expression { params.parallel }
          }
          steps {
            echo 'parallel-two'
          }
        }
        
      }

    }
    
  } // stages

} // pipeline

 
                                                            

That the visual result is a lot better:

There is still some confusion as to what is what, since the first matrix cell reports that it has been skipped, whereas the second cell reports that it was not built.

Reply all
Reply to author
Forward
0 new messages