You need to sign in or sign up before continuing.
Backend: Subsequent job does not wait for previous bridge job status
Summary
The subsequent job does not wait for the status of the previous bridge job when using environment
key.
Example
.gitlab-ci.yml
trigger_job:
stage: test
trigger:
strategy: depend
include: .child-pipeline.yml
deploy:
stage: deploy
# needs: [trigger_job] # the bug occurs with or without this
environment:
name: "my-env"
script: echo deploy
.child-pipeline.yml
deploy:
stage: deploy
environment:
name: "my-env"
script:
- sleep 20
- echo deploy
Expected
Actual
Technical Details
-
trigger_job
triggers the childdeploy
- child
deploy
transitions torunning
state.- child
deploy
hasenvironment
, so it has adeployment
- it triggers
deployment
to run.
- child
-
deployment
enqueuesDeployments::DropOlderDeploymentsWorker
. - parent
deploy
has a lowerid
than childdeploy
, soDeployments::OlderDeploymentsDropService
drops it.
The starting point of this issue: #213080 (comment 415741007)
After a long investigation, I've found that this issue is not related to the original comment.
The "bug" in this issue is this: we intentionally drop previous jobs with the same environment, that's why the "bug" in the issue description occurs. (technical detail: #254323 (comment 472850042))
Edited by Furkan Ayhan