Backend: Chains of needs is not automatically triggered after a failure
Summary
Not all jobs in a chain of needs are triggered automatically if one of the previous jobs fails.
Steps to reproduce
- Create a stage with multiple jobs, each depending on the previous one using
needs
. The third jobneeds
the second, the second jobneeds
the first etc. Sample GitLab ci file below. - Trigger the pipeline and let the first job fail.
- After the failure of the first job, retry the failed job and let it pass.
- Wait for the next jobs to be triggered.
gitlab-ci.yml:
stages:
- my_stage
job_1:
stage: my_stage
tags:
- my-runner
script:
- exit $(( $RANDOM % 2)) # Exit randomly with 0 or 1
job_2:
stage: my_stage
needs:
- job_1
tags:
- my-runner
script:
- exit 0
job_3:
stage: my_stage
needs:
- job_2
tags:
- my-runner
script:
- exit 0
What is the current bug behavior?
If job_1
failed, the next steps are marked as skipped:
After successfully retrying job_1
, next in the line job_2
gets automatically triggered but job_3
remains skipped:
After manually retrying job_2
, job_3
finally gets automatically triggered:
What is the expected correct behavior?
After job_1
fails, press retry on job_1
and both job_2
and job_3
are automatically triggered.
Output of checks
This bug happens on GitLab.com
Edited by Mark Nuzzo