Nested and parallel stages in Jenkins pipelines
Summarize
Summary of Nested and Parallel Stages in Jenkins Pipelines
Nested and parallel stages in Jenkins pipelines enhance the automation of tasks, allowing for faster execution through concurrent processing. This capability is particularly beneficial for various test cases, including quality checks across different operating systems and browsers. ServiceNow DevOps integrates with Jenkins to provide a real-time view of the pipeline execution status and associated artifacts.
Show less
Key Features
- Support for Nested and Parallel Stages: Only available in scripted pipelines, enabling automation of multiple tasks simultaneously.
- Real-Time Pipeline UI: ServiceNow DevOps replicates the Jenkins pipeline UI, showing live updates of the pipeline's status and details such as test results and change requests.
- Change Requests: Created for all stages, including nested and parallel stages, once upstream events are processed.
Key Outcomes
By utilizing nested and parallel stages, customers can ensure that all relevant change requests are processed effectively, avoiding the limitations of previous releases where only parent stages were recognized. It is essential to map approval groups to the correct stages and understand that pipeline execution may be paused until necessary approvals are granted. When upgrading, perform the upgrade during off-peak hours to prevent disruptions in ongoing pipeline executions.
Use nested and parallel stages in scripted Jenkins pipelines to speed up your pipeline execution. Change requests are created for nested and parallel stages and not just for the parent stage.
Support for nested and parallel stages in Jenkins pipelines
You can use nested and parallel stages in scripted Jenkins pipelines to automate and speed up tasks that can be run in parallel. For example, you have a scripted Jenkins pipeline with nested and parallel stages for various test cases such as different quality checks for different operating systems and browsers.
Change requests in nested and parallel stages
Change requests are created for all nested and parallel stages, once all upstream events (prior to the change request) are received. In previous releases, nested or parallel stages in Jenkins pipelines were not identified nor processed in ServiceNow DevOps. Only parent stages were identified and processed in a linear or sequential manner. If change requests existed as part of any nested and parallel stages, those change requests were ignored and a single change request was processed as part of the parent stage. When you run a new pipeline after upgrading, new steps and steps executions are created for nested stages.
Nested and parallel stages were not processed previously, and approval groups were mapped only to the parent stage. Because nested and parallel stages are identified during processing, you must verify that relevant approval groups are mapped to the appropriate nested or parallel stage. If subsequent steps of the pipeline are dependent on the change request's being approved, the pipeline execution is paused, and resumed when the change request is approved.
Upgrade Considerations
- Upgrade during off-peak hours.
- Ensure that you do not have any pipeline executions that are currently in progress by ServiceNow DevOps. If pipeline executions are being processed, step executions might not be created as expected for the in-progress pipeline runs. Rerun the pipeline to create appropriate step executions.