Ensure that dynamic child pipeline depends explicitly on the generator job
Problem
When using "Dynamic Child Pipeline" feature we are not strictly checking whether the job generating the configurations is a dependency for the trigger job using the generated configuration.
The following snippet has child-pipeline
job running before generate-config
. This will cause the following behavior:
- Parent pipeline is created successfully
- Parent pipeline's jobs are enqueued
- Trigger job
child-pipeline
runs and attempts to create a child pipeline - The child pipeline fails with error
Job generate-config not found in parent pipeline or does not have artifacts
- Trigger job fails by consequence
- Parent pipeline fails by consequence
child-pipeline:
stage: test
trigger:
include:
- artifact: generated-config.yml
job: generate-config
generate-config:
stage: deploy
script: generate-ci-config > generated-config.yml
when: always
artifacts:
paths:
- generated-config.yml
Expected behavior
- Parent pipeline fails immediately showing an error
child-pipeline does not depend on a generate-config job
Original discussion: !23790 (comment 298174064)