Hi I’m trying to trigger the execution of say 10 jobs sequentially by making them depend on each others, using the keyword needs. (say job 2 says "need: [ job1 ], etc…)
Now I want a bit of control when all of this happens, so the first job is manual. using when:manual.
What I see is that what job are enabled to run is not recalculated farther than the first direct depency for a manual job and ANY of it’s children. This forces me to relaunch all jobs once after the first job has been launched, which is what I’m trying to avoid.
What I expect to see is that once I click on the one single manual job at the start of the dependency chain, all jobs run sequentially provided the first one ran successfully.
I’m doing this on gitlab 14.9 (yeah I know, but it’s not my choice)
here is an example
job1s2 is manual, all other are on_success. I’ve clicked to run job1s2, and job2s2 was enabled and ran, but no cascading effect happens and then enables and starts job3s2. To be able to run job3s2, I actually need to rerun job2s2, which will trigger a run of job3s2, and so.
This means I need to clik all jobs, and they all run twice, which is not great at all…
any help welcome.
Here is a sample gitlab-ci.yml to reproduce
stages:
- stage1
- stage2
- stage3
job1s1 :
stage: stage1
tags :
- linux
script:
- ls
job1s2 :
stage: stage2
tags :
- linux
script:
- ls
when: manual
needs:
- job1s1
job2s2 :
stage: stage2
tags :
- linux
script:
- ls
when: on_success
needs:
- job1s2
job3s2 :
stage: stage2
tags :
- linux
script:
- ls
when: on_success
needs:
- job2s2
job4s2 :
stage: stage2
tags :
- linux
script:
- ls
when: on_success
needs:
- job3s2
job1s3 :
stage: stage3
tags :
- linux
script:
- ls
needs:
- job1s1
job2s3 :
stage: stage3
tags :
- linux
script:
- ls
needs:
- job1s3
job3s3 :
stage: stage3
tags :
- linux
script:
- ls
needs:
- job2s3
job4s3 :
stage: stage3
tags :
- linux
script:
- ls
needs:
- job3s3