Dynamically generate child pipeline from artifact
What does this MR do?
Related to: #35632 (closed)
- Introduce
trigger:include:artifact
syntax which will allow a bridge job triggering a child pipeline to use the content of an artifact as CI configuration - Pass parent pipeline to
Gitlab::Ci::Config
and to theExternal::Context
so that we can define whether a pipeline is being created as child of another pipeline - Add new
Gitlab::Ci::Config::External::File::Artifact
class which is responsible for fetching and validating the content to include
What does this MR NOT do?
- check if the job containing the referenced artifacts is in the dependency path for the trigger job. This will be tackled in a separate MR. See !23790 (comment 289387012)
Demo
Demo of the feature: https://www.youtube.com/watch?v=nMdfus2JWHM
Feature flag
ci_dynamic_child_pipeline
off by default.
Screenshots
stages:
- build
- test
# supposed we have a script or service that dynamically
# generates CI configurations
generate-config:
stage: build
script: my-ci-generator.sh > generated-config.yml
artifacts:
paths:
- generated-config.yml
run-generated-child:
stage: test
trigger:
include:
- artifact: generated-config.yml
job: generate-config
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Edited by Kamil Trzciński (Back 2025-01-01)