Infinite pipeline when needs: is used after when:manual
Summary
There are similar issues to mine, but not entirely, therefore I chose to report it instead of hijacking another one.
The use case is a deployment to different environments that each need a sequence of jobs to deploy successfully (something along the lines of deploy-blue, verify, deploy-green). As verify needs a different docker container, I need to split it up.
I was under the impression that needs:
could be useful here
Steps to reproduce
Consider the following pipeline, where I want to be able to run the first branch of the pipeline always and be able to run the other parts depending on a manual decision.
stages:
- stage1
- stage2
- stage3
stage1:
stage: stage1
script: echo 'stage 1'
stage2_1:
stage: stage2
script: echo 'stage 2 - 1'
stage2_2:
when: manual
stage: stage2
script: echo 'stage 2 - 2'
stage3_1:
needs: [stage2_1]
stage: stage3
script: echo 'stage 3 - 1'
stage3_2:
needs: [stage2_2]
stage: stage3
script: echo 'stage 3 - 2'
What is the current bug behavior?
This creates an infinite pipeline as long as noone starts the manual job.
What is the expected correct behavior?
The pipeline should succeed in the first place after running stage3_1 successfully and then allow for stage2_2 to be started manually and subsequently run stage3_2