Introduce trigger:forward for CI bridge jobs
What does this MR do and why?
By default, only YAML-defined bridge variables are passed to downstream pipelines. With the forward keyword, it is now available to pass manual pipeline variables to downstream pipelines.
-
forward:yaml_variables
is an existing behavior, by default it's true. When true, YAML-defined bridge variables are passed to downstream pipelines. -
forward:pipeline_variables
is a new feature, by default it's false. When true, manual pipeline variables are passed to downstream pipelines.
This is behind a feature flag ci_trigger_forward_variables
#355572 (closed).
Related to #213729 (closed)
Screenshots or screen recordings
ci_trigger_forward_variables
1. Enable Feature.enable(:ci_trigger_forward_variables)
2. Setup the pipeline
.gitlab-ci.yml
variables: # default variables for each job
VARIABLE1: value 1
# default behavior
child1:
trigger:
include: .child-pipeline.yml
# forwarding pipeline variables
child2:
trigger:
include: .child-pipeline.yml
forward:
pipeline_variables: true
# not forwarding yaml variables
child3:
trigger:
include: .child-pipeline.yml
forward:
yaml_variables: false
.child-pipeline.yml
test:
script:
- echo $VARIABLE1
- echo $VARIABLE2
3. Run the pipeline
4. Result
Parent Pipeline
Child 1
Child 2
Child 3
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Furkan Ayhan