Add pipeline schedule variables to forward:pipeline
What does this MR do and why?
In #213729 (closed), we implemented trigger:forward
that allows users to have an option to decide sending some variables to downstream pipelines via bridge jobs. (!82676 (merged))
A user report (#357509 (closed)) reminded us that we don't pass schedule pipeline variables along with pipeline variables. In our "CI/CD variable precedence" list, they have the same priority. So we decided that we could consider pipeline schedule variables as pipeline variables.
This is still behind a feature flag ci_trigger_forward_variables
#355572 (closed). We can disable the feature flag after merging this, then restart enabling.
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. Schedule a pipeline and run
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.