Allow to recursively expand includes
What does this MR do?
This extends include:
to allow nested includes. Making the configuration truly Composable and hierarchical. The depth of includes is limited to 3.
This is nested-aware thus, based on type of include it properly resolves all relatives to the includes:
-
local
: preserves context of the current include, project and sha, -
remote
: drops context, thus only publiclly available files can be included, -
project
: changes project and sha context to be the one of the include, -
template
: preserves only user.
Example
gitlab-ci.yml
1. Project's include:
- template: Auto-DevOps.yaml
- project: my-group/my-project
file: my-generic-yaml.yaml
ref: master
Auto-DevOps.yaml
2. include:
- template: SAST.yaml
- template: DAST.yaml
- template: DockerBuild.yaml
- template: ReviewApps.yaml
- template: Staging.yaml
- template: Production.yaml
my-group/my-project/my-generic-yaml.yml
3. include:
- local: my-another-yaml.yml
This will use my-another-yaml.yml
relative to my-group/my-project
using the ref: master
.
my-group/my-project/my-another-yaml.yml
4. include:
- template: Pages-Hugo.yaml
What are the relevant issue numbers?
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/56836
Resolves https://gitlab.com/gitlab-org/gitlab-ce/issues/55937#note_143126814
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated via this MR -
Tests added for this feature/bug -
Tested in all supported browsers -
Conforms to the code review guidelines -
Conforms to the merge request performance guidelines -
Conforms to the style guides -
Conforms to the database guides -
Link to e2e tests MR added if this MR has Requires e2e tests label. See the Test Planning Process. -
Security reports checked/validated by reviewer
Edited by Grzegorz Bizon