Pipeline keeps running forever if job needs other manual job
Summary
When using the keyword needs
the job gets created immediately and waits for the needed job to finish. In case the needed job has a manual trigger (when: manual
) the pipeline doesn't finish but stays in a running state forever.
Steps to reproduce
Use the following CI configuration:
stages:
- build
- deploy:rls
- deploy:prod
- live-test
maven:
stage: build
script:
- echo "Build java jar with maven"
deploy:rls:
stage: deploy:rls
script:
- echo "Deploy to rls stage"
deploy:prod:
stage: deploy:prod
when: manual
script:
- echo "Deploy to rls stage"
verify:rls:
stage: live-test
needs: ["deploy:rls"]
script:
- echo "Run some checks to verify rls deployment succeeded"
verify:prod:
stage: live-test
needs: ["deploy:prod"]
script:
- echo "Run some checks to verify prod deployment succeeded"
Example Project
https://gitlab.com/basiszwo/needs-keyword-for-manual-job
Example pipeline:
https://gitlab.com/basiszwo/needs-keyword-for-manual-job/pipelines/80691304
What is the current bug behavior?
The job verify:rls
needs deploy:rls
to run. deploy:rls
is a manual job. The pipeline never finishes when needs
refers to a manual job that is not being triggered.
What is the expected correct behavior?
The pipeline should not stay in running state but show a success / fail state if the manual job is not being triggered.
Relevant logs and/or screenshots
Output of checks
This bug happens on GitLab.com
Results of GitLab environment info
Results of GitLab application Check
Possible fixes
Maybe the job with the needs
keyword gets created at the time, when the needed (manual) job is actually being run.