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

Allow task pipeline steps to take closures for improved visualization

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • None
    • Delivery Pipeline plugin 1.0.3
      workflow-aggregator 2.1

    Description

      The task step should be allowed to take a body (closure).

      Currently, the task action can be used to label tasks within a Jenkins pipeline stage. It allows more fine grained visualization of stages in the Delivery Pipeline view rather than just having one big block visualized for the entire stage. For e.g. pipeline failures, tasks allows for better information on information radiators on what went wrong without requiring users to actively find this information through the Jenkins UI.

      The current implementation of the task step (action) does not support bodies (closures). This was due to the stage step not accepting bodies either in the workflow-aggregator plugin 2.0 which the current solution depends on.

      If the task is allowed to take a block, it allows for more logical grouping of tasks rather than just assuming a sequential progress. This should also allow the pipeline view to visualize the current progress of a particular task better than the current solution which basically just assumes the progress of the containing stage.

       

      Example of how it could look like:

      for the following example pipeline syntax:

      pipeline_example_syntax.txt

       

      Attachments

        Activity

          tommysdk Tommy Tynjä created issue -
          tommysdk Tommy Tynjä made changes -
          Field Original Value New Value
          Status Open [ 1 ] In Progress [ 3 ]
          tommysdk Tommy Tynjä made changes -
          Attachment dpp_twb_example.png [ 40606 ]
          tommysdk Tommy Tynjä made changes -
          Description The task step should be allowed to take a body (closure).

          Currently, the task action can be used to label tasks within a Jenkins pipeline stage. It allows more fine grained visualization of stages in the Delivery Pipeline view rather than just having one big block visualized for the entire stage. For e.g. pipeline failures, tasks allows for better information on information radiators on what went wrong without requiring users to actively find this information through the Jenkins UI.

          The current implementation of the task step (action) does not support bodies (closures). This was due to the stage step not accepting bodies either in the workflow-aggregator plugin 2.0 which the current solution depends on.

          If the task is allowed to take a block, it allows for more logical grouping of tasks rather than just assuming a sequential progress. This should also allow the pipeline view to visualize the current progress of a particular task better than the current solution which basically just assumes the progress of the containing stage.

           
          The task step should be allowed to take a body (closure).

          Currently, the task action can be used to label tasks within a Jenkins pipeline stage. It allows more fine grained visualization of stages in the Delivery Pipeline view rather than just having one big block visualized for the entire stage. For e.g. pipeline failures, tasks allows for better information on information radiators on what went wrong without requiring users to actively find this information through the Jenkins UI.

          The current implementation of the task step (action) does not support bodies (closures). This was due to the stage step not accepting bodies either in the workflow-aggregator plugin 2.0 which the current solution depends on.

          If the task is allowed to take a block, it allows for more logical grouping of tasks rather than just assuming a sequential progress. This should also allow the pipeline view to visualize the current progress of a particular task better than the current solution which basically just assumes the progress of the containing stage.

           

          Example of how it could look like:

          !dpp_twb_example.png!

          for the following example pipeline syntax:

          {{pipeline \{}}
          {{    agent any}}
          {{    options \{}}
          {{        ansiColor('xterm')}}
          {{        buildDiscarder(logRotator(numToKeepStr: '20'))}}
          {{        timeout(time: 30, unit: 'MINUTES')}}
          {{        timestamps()}}
          {{    }}}
          {{    stages \{}}
          {{        stage('Commit stage') \{}}
          {{            steps \{}}
          {{                task('Compile and package') \{}}
          {{                    echo 'Building...'}}
          {{                    sleep 2}}
          {{                }}}
          {{                }}
          {{                task('Upload artifacts') \{}}
          {{                    sleep 3}}
          {{                    echo 'Successfully uploaded artifacts!'}}
          {{                }}}
          {{            }}}
          {{        }}}
          {{        stage('Test stage') \{}}
          {{            steps \{}}
          {{                task('Run component tests') \{}}
          {{                    echo 'Running tests...'}}
          {{                    sleep 4}}
          {{                    echo 'Component tests finished!'}}
          {{                }}}
          {{                }}
          {{                task('Run integration tests') \{}}
          {{                    sleep 5}}
          {{                    echo 'Integration tests finished!'}}
          {{                }}}
          {{            }}}
          {{        }}}
          {{        stage('Deploy') \{}}
          {{            steps \{}}
          {{                task('Deploy to UAT') \{}}
          {{                    echo 'Deploying to UAT...'}}
          {{                    sleep 4}}
          {{                    echo 'Successfully deployed to UAT'}}
          {{                }}}
          {{                }}
          {{                task('Deploy to production') \{}}
          {{                    echo 'Deploying to production...'}}
          {{                    sleep 4}}
          {{                    echo 'Deployed to production!'}}
          {{                }}}
          {{            }}}
          {{        }}}
          {{    }}}
          {{}}}

           
          tommysdk Tommy Tynjä made changes -
          Description The task step should be allowed to take a body (closure).

          Currently, the task action can be used to label tasks within a Jenkins pipeline stage. It allows more fine grained visualization of stages in the Delivery Pipeline view rather than just having one big block visualized for the entire stage. For e.g. pipeline failures, tasks allows for better information on information radiators on what went wrong without requiring users to actively find this information through the Jenkins UI.

          The current implementation of the task step (action) does not support bodies (closures). This was due to the stage step not accepting bodies either in the workflow-aggregator plugin 2.0 which the current solution depends on.

          If the task is allowed to take a block, it allows for more logical grouping of tasks rather than just assuming a sequential progress. This should also allow the pipeline view to visualize the current progress of a particular task better than the current solution which basically just assumes the progress of the containing stage.

           

          Example of how it could look like:

          !dpp_twb_example.png!

          for the following example pipeline syntax:

          {{pipeline \{}}
          {{    agent any}}
          {{    options \{}}
          {{        ansiColor('xterm')}}
          {{        buildDiscarder(logRotator(numToKeepStr: '20'))}}
          {{        timeout(time: 30, unit: 'MINUTES')}}
          {{        timestamps()}}
          {{    }}}
          {{    stages \{}}
          {{        stage('Commit stage') \{}}
          {{            steps \{}}
          {{                task('Compile and package') \{}}
          {{                    echo 'Building...'}}
          {{                    sleep 2}}
          {{                }}}
          {{                }}
          {{                task('Upload artifacts') \{}}
          {{                    sleep 3}}
          {{                    echo 'Successfully uploaded artifacts!'}}
          {{                }}}
          {{            }}}
          {{        }}}
          {{        stage('Test stage') \{}}
          {{            steps \{}}
          {{                task('Run component tests') \{}}
          {{                    echo 'Running tests...'}}
          {{                    sleep 4}}
          {{                    echo 'Component tests finished!'}}
          {{                }}}
          {{                }}
          {{                task('Run integration tests') \{}}
          {{                    sleep 5}}
          {{                    echo 'Integration tests finished!'}}
          {{                }}}
          {{            }}}
          {{        }}}
          {{        stage('Deploy') \{}}
          {{            steps \{}}
          {{                task('Deploy to UAT') \{}}
          {{                    echo 'Deploying to UAT...'}}
          {{                    sleep 4}}
          {{                    echo 'Successfully deployed to UAT'}}
          {{                }}}
          {{                }}
          {{                task('Deploy to production') \{}}
          {{                    echo 'Deploying to production...'}}
          {{                    sleep 4}}
          {{                    echo 'Deployed to production!'}}
          {{                }}}
          {{            }}}
          {{        }}}
          {{    }}}
          {{}}}

           
          The task step should be allowed to take a body (closure).

          Currently, the task action can be used to label tasks within a Jenkins pipeline stage. It allows more fine grained visualization of stages in the Delivery Pipeline view rather than just having one big block visualized for the entire stage. For e.g. pipeline failures, tasks allows for better information on information radiators on what went wrong without requiring users to actively find this information through the Jenkins UI.

          The current implementation of the task step (action) does not support bodies (closures). This was due to the stage step not accepting bodies either in the workflow-aggregator plugin 2.0 which the current solution depends on.

          If the task is allowed to take a block, it allows for more logical grouping of tasks rather than just assuming a sequential progress. This should also allow the pipeline view to visualize the current progress of a particular task better than the current solution which basically just assumes the progress of the containing stage.

           

          Example of how it could look like:

          !dpp_twb_example.png!

          for the following example pipeline syntax:

          {{pipeline \{}}
           {{    agent any}}
           {{    options \{}}
           {{        ansiColor('xterm')}}
           {{        buildDiscarder(logRotator(numToKeepStr: '20'))}}
           {{        timeout(time: 30, unit: 'MINUTES')}}
           {{        timestamps()}}
          {{    }}}
           {{    stages \{}}
           {{        stage('Commit stage') \{}}
           {{            steps \{}}
           {{                task('Compile and package') \{}}
           {{                    echo 'Building...'}}
           {{                    sleep 2}}
          {{    }}{{    }}{{    }}{{    }}}
           {{                }}
           {{                task('Upload artifacts') \{}}
           {{                    sleep 3}}
           {{                    echo 'Successfully uploaded artifacts!'}}
          {{    }}{{    }}{{    }}{{    }}}
          {{    }}{{    }}{{    }}}
          {{    }}{{    }}}
           {{        stage('Test stage') \{}}
           {{            steps \{}}
           {{                task('Run component tests') \{}}
           {{                    echo 'Running tests...'}}
           {{                    sleep 4}}
           {{                    echo 'Component tests finished!'}}
          {{    }}{{    }}{{    }}{{    }}}
           {{                }}
           {{                task('Run integration tests') \{}}
           {{                    sleep 5}}
           {{                    echo 'Integration tests finished!'}}
          {{    }}{{    }}{{    }}{{    }}}
          {{    }}{{    }}{{    }}}
          {{    }}{{    }}}
           {{        stage('Deploy') \{}}
           {{            steps \{}}
           {{                task('Deploy to UAT') \{}}
           {{                    echo 'Deploying to UAT...'}}
           {{                    sleep 4}}
           {{                    echo 'Successfully deployed to UAT'}}
          {{    }}{{    }}{{    }}{{    }}}
           {{                }}
           {{                task('Deploy to production') \{}}
           {{                    echo 'Deploying to production...'}}
           {{                    sleep 4}}
           {{                    echo 'Deployed to production!'}}
          {{    }}{{    }}{{    }}{{    }}}
          {{    }}{{    }}{{    }}}
          {{    }}{{    }}}
          {{    }}}
           {{}}}

           
          tommysdk Tommy Tynjä made changes -
          Attachment pipeline_example_syntax.txt [ 40607 ]
          Description The task step should be allowed to take a body (closure).

          Currently, the task action can be used to label tasks within a Jenkins pipeline stage. It allows more fine grained visualization of stages in the Delivery Pipeline view rather than just having one big block visualized for the entire stage. For e.g. pipeline failures, tasks allows for better information on information radiators on what went wrong without requiring users to actively find this information through the Jenkins UI.

          The current implementation of the task step (action) does not support bodies (closures). This was due to the stage step not accepting bodies either in the workflow-aggregator plugin 2.0 which the current solution depends on.

          If the task is allowed to take a block, it allows for more logical grouping of tasks rather than just assuming a sequential progress. This should also allow the pipeline view to visualize the current progress of a particular task better than the current solution which basically just assumes the progress of the containing stage.

           

          Example of how it could look like:

          !dpp_twb_example.png!

          for the following example pipeline syntax:

          {{pipeline \{}}
           {{    agent any}}
           {{    options \{}}
           {{        ansiColor('xterm')}}
           {{        buildDiscarder(logRotator(numToKeepStr: '20'))}}
           {{        timeout(time: 30, unit: 'MINUTES')}}
           {{        timestamps()}}
          {{    }}}
           {{    stages \{}}
           {{        stage('Commit stage') \{}}
           {{            steps \{}}
           {{                task('Compile and package') \{}}
           {{                    echo 'Building...'}}
           {{                    sleep 2}}
          {{    }}{{    }}{{    }}{{    }}}
           {{                }}
           {{                task('Upload artifacts') \{}}
           {{                    sleep 3}}
           {{                    echo 'Successfully uploaded artifacts!'}}
          {{    }}{{    }}{{    }}{{    }}}
          {{    }}{{    }}{{    }}}
          {{    }}{{    }}}
           {{        stage('Test stage') \{}}
           {{            steps \{}}
           {{                task('Run component tests') \{}}
           {{                    echo 'Running tests...'}}
           {{                    sleep 4}}
           {{                    echo 'Component tests finished!'}}
          {{    }}{{    }}{{    }}{{    }}}
           {{                }}
           {{                task('Run integration tests') \{}}
           {{                    sleep 5}}
           {{                    echo 'Integration tests finished!'}}
          {{    }}{{    }}{{    }}{{    }}}
          {{    }}{{    }}{{    }}}
          {{    }}{{    }}}
           {{        stage('Deploy') \{}}
           {{            steps \{}}
           {{                task('Deploy to UAT') \{}}
           {{                    echo 'Deploying to UAT...'}}
           {{                    sleep 4}}
           {{                    echo 'Successfully deployed to UAT'}}
          {{    }}{{    }}{{    }}{{    }}}
           {{                }}
           {{                task('Deploy to production') \{}}
           {{                    echo 'Deploying to production...'}}
           {{                    sleep 4}}
           {{                    echo 'Deployed to production!'}}
          {{    }}{{    }}{{    }}{{    }}}
          {{    }}{{    }}{{    }}}
          {{    }}{{    }}}
          {{    }}}
           {{}}}

           
          The task step should be allowed to take a body (closure).

          Currently, the task action can be used to label tasks within a Jenkins pipeline stage. It allows more fine grained visualization of stages in the Delivery Pipeline view rather than just having one big block visualized for the entire stage. For e.g. pipeline failures, tasks allows for better information on information radiators on what went wrong without requiring users to actively find this information through the Jenkins UI.

          The current implementation of the task step (action) does not support bodies (closures). This was due to the stage step not accepting bodies either in the workflow-aggregator plugin 2.0 which the current solution depends on.

          If the task is allowed to take a block, it allows for more logical grouping of tasks rather than just assuming a sequential progress. This should also allow the pipeline view to visualize the current progress of a particular task better than the current solution which basically just assumes the progress of the containing stage.

           

          Example of how it could look like:

          !dpp_twb_example.png!

          for the following example pipeline syntax:

          [^pipeline_example_syntax.txt]

           
          tommysdk Tommy Tynjä added a comment - Proposed solution: https://github.com/Diabol/delivery-pipeline-plugin/pull/259
          tommysdk Tommy Tynjä made changes -
          Summary Improve task action by allowing closures Allow task pipeline steps to take closures for improved visualization
          tommysdk Tommy Tynjä added a comment -

          Proposed solution merged to master: https://github.com/Diabol/delivery-pipeline-plugin/commit/599c36790a617c8e91f1c8593a1999a754e3d2c5

          Will be featured in the next release of the Delivery Pipeline plugin

          tommysdk Tommy Tynjä added a comment - Proposed solution merged to master: https://github.com/Diabol/delivery-pipeline-plugin/commit/599c36790a617c8e91f1c8593a1999a754e3d2c5 Will be featured in the next release of the Delivery Pipeline plugin
          tommysdk Tommy Tynjä made changes -
          Resolution Fixed [ 1 ]
          Status In Progress [ 3 ] Resolved [ 5 ]
          tommysdk Tommy Tynjä added a comment -

          Released in Delivery Pipeline plugin 1.1.0

          tommysdk Tommy Tynjä added a comment - Released in Delivery Pipeline plugin 1.1.0
          tommysdk Tommy Tynjä made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

          People

            tommysdk Tommy Tynjä
            tommysdk Tommy Tynjä
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: