Main pipeline stuck in pending status if it triggers a child pipeline without strategy depends
Summary
Linking pipelines with trigger:strategy mentioned that
By default, the trigger job completes with the success status as soon as the downstream pipeline is created.
but
To force the trigger job to wait for the downstream (multi-project or child) pipeline to complete, use strategy: depend
which will force the job to wait for the triggered pipeline to complete. But the current behavior is that the job without strategy:depends
will wait forever even though the triggered pipeline is completed cause thing main pipeline to stuck in Pending status.
Steps to reproduce
- Setup project A and project B where job in project A trigger a pipeline in project B without
strategy: depends
- Start pipeline in project A
- Observe the job for triggering pipeline stuck in waiting state
.gitlab-ci.yml
stages:
- build
- test
- stage
- verify
- deploy
e2e:check:
stage: verify
before_script:
- echo "e2e check b4 script"
script:
- echo "e2e check script"
allow_failure: true
e2e:cb:
stage: verify
allow_failure: true
trigger:
project: gitlab-gold/triggered-pipeline
Actual behavior
The main pipeline stuck in pending stage because the job status was not updated.
Expected behavior
After successfully triggering the pipeline, the job status immediately update to success without waiting for the triggered pipeline to complete.
Used GitLab Runner version
Running with gitlab-runner 12.7.1 (003fe500)
on docker-auto-scale 72989761
Using Docker executor with image ruby:2.5 ...
00:41
Pulling docker image ruby:2.5 ...
Workaround
Trigger pipeline with API but this workaround doesn't allow the main pipeline to see the child pipeline in the main pipeline page.