.gitlab-ci.yml "needs" confused when a non-needed job fails; job run incorrectly
Summary
Consider the following CI pipeline:
stages:
- A
- B
- C
- D
A that passes:
stage: A
script:
- "true"
A that fails:
stage: A
script:
- "false"
B that passes:
stage: B
script:
- "true"
C that needs previous jobs:
stage: C
script:
- "true"
needs:
- A that passes
- B that passes
D that passes:
stage: D
script:
- "true"
As the names suggest, "A that passes" passes, and "A that fails" fails. Then, for some reason Job C is triggered.
Steps to reproduce
See https://gitlab.com/stjm-cc/ci-bug-demo
Example Project
https://gitlab.com/stjm-cc/ci-bug-demo
What is the current bug behavior?
Job C is run erroneously, when some of the previous jobs it needs have not been run.
What is the expected correct behavior?
Job C should not be run unless Job B has run.
Relevant logs and/or screenshots
(Paste any relevant logs - please use code blocks (```) to format console output, logs, and code as it's tough to read otherwise.)
Output of checks
This bug happens on GitLab.com
Possible fixes
(If you can, link to the line of code that might be responsible for the problem)
Edited by Stuart Moore
