Jobs Run with Skipped Needs
Summary
When a job is canceled (or fails) and its dependencies are skipped, jobs that depend on the skipped jobs using needs start running.
Steps to reproduce
stages: [build, test, deploy]
image: busybox
Build:
stage: build
script:
- sleep 30
- exit 1
Test:
stage: test
script:
- sleep 30
Deploy:
stage: deploy
script:
- sleep 30
needs:
- Test
- Start the pipeline
- Cancel the first job
Example Project
https://gitlab.com/deckar01/gitlab-ce-permissions-test/pipelines/111850213
What is the current bug behavior?
The jobs that "need" the canceled job are skipped, but the jobs that "need" the skipped job are executed. Jobs that error (rather than being canceled) also fail to prevent the transitive dependent from running.
- Canceled example: https://gitlab.com/deckar01/gitlab-ce-permissions-test/pipelines/111850213
- Failed example: https://gitlab.com/deckar01/gitlab-ce-permissions-test/pipelines/113091503
What is the expected correct behavior?
Jobs that "need" skipped jobs should also be skipped. Implicit stage dependencies and explicit dependencies behave correctly.
- Stage example: https://gitlab.com/deckar01/gitlab-ce-permissions-test/pipelines/111835833
- Dependencies example: https://gitlab.com/deckar01/gitlab-ce-permissions-test/pipelines/111851246
Relevant logs and/or screenshots
Needs behavior:
Default behavior:
Output of checks
This bug happens on GitLab.com
Edited by Jared Deckard

