Configuration to force pipeline retry to retry all jobs
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Problem to solve
Some pipelines have jobs which do not make sense to be retried on their own - only together with jobs from the previous stages.
Example 1:
- Stage
testingruns tests and produces artifacts. Does not fail if tests fail (the next stage is responsible for that) - Stage
compile test reportsruns afterwards, collects all the test artifacts and reports on the test result with either success or failure - Retrying a failed
compile test reportsitself does not make sense because it operates on the same artifacts producing the same result - One would like to retry the pipeline at a whole
Example 2:
- Stage "queue job" which queues a job in an external CI system (in our case Jenkins), waits for the job to start and passing the resulting job id to the next stage
- Stage "wait for job" which uses the given job id to wait for the job to finish and to report success or failure based on its status
- The
queue jobwill not fail due to a build failure - thewait for jobwill. But retrying the latter does not make any sense because it will query the build results of the same Jenkins job ID and return the same result - Instead, a retry should retry the whole pipeline
Proposal
The config YML needs a syntax to define the pipeline as "monolithic" in terms of retrying. The CI engineer should be able to configure this global retry behavior in the CI yaml so the developers don't stumble upon this.
An option is needed to define that:
- Single jobs are not retryable on their own
- Retrying the pipeline does not only run the failed jobs but all of them together
- This retry behavior could be relevant for retry via UI and for automatic retry
Edited by 🤖 GitLab Bot 🤖