Allow only one top-level definition in includes
Summary
The idea of allowing only one top-level definition in includes and requiring the use of extends:
in other cases came up a few times recently, so I thought I should open an issue to centralize the discussion around this.
This was originally pointed out by @ayufan in a couple of issues.
Designs
- Show closed items
Relates to
- #29980Backlog
- gitlab-foss #63982
Activity
-
Newest first Oldest first
-
Show all activity Show comments only Show history only
- Matija Čupić changed title from Allow only top-level includes to Allow only one top-level definition in includes
changed title from Allow only top-level includes to Allow only one top-level definition in includes
- Matija Čupić changed the description
changed the description
- Author Contributor
- Maintainer
I'm not sure I understand @matteeyah. Can you elaborate? I though that
includes
andextends
are orthogonal features (but kind of related, of course)? - Matija Čupić changed the description
changed the description
- Author Contributor
I'll give an example to better illustrate - if we have two CI config files (
a.gitlab-ci.yml
andb.gitlab-ci.yml
).# a.gitlab-ci.yml variables: my_variable: my_value include: local: b.gitlab-ci.yml example_job: script: - echo $my_variable
and
# b.gitlab-ci.yml variables: my_variable: my_other_value other_job: script: - echo "${$my_variable} hello"
The proposal is to disallow having two top-level
variables
(or any other) definitions and force usingextends
instead. Collapse replies - Contributor
@matteeyah can you please add an example of what you propose changing the above to?
- Author Contributor
The proposal is to disallow having two top-level
variables
definitions - i.e. the above config should be considered invalid. - Maintainer
Actually
variables:
are fine, as they are joined together, and this is actually quite OK.Problems happens when we merge items that are not mergeable, like
before_script:
and we do not clearly state what is being overwritten and in what order. Maybe this should be disallowed?
- Jason Yavorska changed milestone to %Backlog
changed milestone to %Backlog
- 🤖 GitLab Bot 🤖 added [deprecated] Accepting merge requests label
added [deprecated] Accepting merge requests label
- 🤖 GitLab Bot 🤖 changed milestone to %Backlog
changed milestone to %Backlog
- Jason Yavorska added DEPRECATE_pipeline authoring label
added DEPRECATE_pipeline authoring label
- 🤖 GitLab Bot 🤖 added sectionops label
added sectionops label
- 🤖 GitLab Bot 🤖 added grouppipeline authoring + 1 deleted label and removed grouppipeline execution label
added grouppipeline authoring + 1 deleted label and removed grouppipeline execution label
- 🤖 GitLab Bot 🤖 added Category:Pipeline Composition label
added Category:Pipeline Composition label
- GitLab Dependency Bot mentioned in merge request !180392 (merged)
mentioned in merge request !180392 (merged)
- GitLab Dependency Bot mentioned in merge request !180419 (closed)
mentioned in merge request !180419 (closed)