Replace YAML anchors with `extends` in `.gitlab-ci.yml`
Description
In 11.3 we are going to release extends
keyword support that is an alternative to YAML anchors.
extends
is a little more flexible because it uses reverse, recursive, deep merge strategy, unlike anchors.
We should consider refactoring our own .gitlab-ci.yml
to use extends
instead of YAML anchors, what should hopefully simplify our CI/CD configuration.
Designs
- Show closed items
Relates to
- gitlab #31230Backlog
Activity
-
Newest first Oldest first
-
Show all activity Show comments only Show history only
- Grzegorz Bizon added Quality test labels
- Lin Jen-Shin added ci-build label
added ci-build label
- Author Maintainer
@jlenny we talked about this today!
- Author Maintainer
/cc @godfat
- Contributor
Would be great to do this!
- Mek Stittri added priority3 label
added priority3 label
- Mek Stittri changed milestone to %11.5
changed milestone to %11.5
- Contributor
@grzesiek can you help us estimate a rough weight ? maybe 2-3 ?
- Author Maintainer
@meks We don't need to rewrite everything, perhaps most critical / complex parts of the
.gitlab-ci.yml
. We can start simple, in this case it would be 2 indeed. - Author Maintainer
That said, I'm a little sad that we don't have specs for
.gitlab-ci.yml
and an easy way of writing them.Edited by Grzegorz Bizon 1 - Mek Stittri changed weight to 2
changed weight to 2
- 🤖 GitLab Bot 🤖 mentioned in issue #51598 (closed)
mentioned in issue #51598 (closed)
- 🤖 GitLab Bot 🤖 mentioned in issue #51628 (closed)
mentioned in issue #51628 (closed)
- Lin Jen-Shin added severity4 label
added severity4 label
Are you guys aware that
extends
does not merge items? gitlab-runner#3611- Maintainer
- Author Maintainer
- 🤖 GitLab Bot 🤖 added [deprecated] Accepting merge requests label
added [deprecated] Accepting merge requests label
- Maintainer
Cross-posting from omnibus-gitlab#3917 (comment 117604043):
Beware of
extends
: jobs that are extended inherits the globalbefore_script
, and override anyscript
/stage
set by a previous extension in contrary to the YAML anchor syntax which doesn't do anything special since it's not a "CI feature".See the following examples which result in an invalid CI configuration:
-
rymai/test-project@651984fc => missing
script
-
rymai/test-project@0ca20b33 => missing
stage
- working example: rymai/test-project@3a694710
-
rymai/test-project@651984fc => missing
- Maintainer
Created an issue for these bugs: https://gitlab.com/gitlab-org/gitlab-ce/issues/54111
- Rémy Coutable mentioned in issue #54111 (closed)
mentioned in issue #54111 (closed)
I intend to build a public semver versioned library of reusable gitlabci configuration (I already have one internally) but it's depending on this feature shipping. I hope this ships soon - it's going to revolutionize how we use gitlabci.
- Author Maintainer
@ztenerowicz This is an issue about internal
.gitlab-ci.yml
for GitLab CE and EE.extends
is already available in recent versions of GitLab 1 - Rémy Coutable changed milestone to %12.0
changed milestone to %12.0
- 🤖 GitLab Bot 🤖 mentioned in issue #60326 (closed)
mentioned in issue #60326 (closed)
- Maintainer
Milestone %11.9 has expired, this will be rescheduled to the next milestone in active development %11.11. If you think this is incorrect, please feel free to update the milestone to a more appropriate one.
We're also adding missed:11.9
- 🤖 GitLab Bot 🤖 changed milestone to %11.11
changed milestone to %11.11
- 🤖 GitLab Bot 🤖 added missed:11.9 label
added missed:11.9 label
- 🤖 GitLab Bot 🤖 mentioned in issue #63065 (closed)
mentioned in issue #63065 (closed)
- Maintainer
Milestone %11.11 has expired, this will be rescheduled to the next milestone in active development %12.1. If you think this is incorrect, please feel free to update the milestone to a more appropriate one.
We're also adding missed:11.11
- 🤖 GitLab Bot 🤖 changed milestone to %12.1
changed milestone to %12.1
- 🤖 GitLab Bot 🤖 added missed:11.11 label
added missed:11.11 label
- Author Maintainer
I would like to mention that we now have support for multiple
extends
and this feature is now much more flexible. 1 @grzesiek is this already deployed in gitlab.com? There are no changes to the docs I think : https://docs.gitlab.com/ee/ci/yaml/#extends
- Author Maintainer
@pmatos it is, also present in the docs you linked, scroll down.
Edited by Grzegorz Bizon @grzesiek ah ok, so the new
extends
features is theextends
with multiple parents. It was not clear what was added in the most recent versions.- 🤖 GitLab Bot 🤖 mentioned in issue #65094 (closed)
mentioned in issue #65094 (closed)
- 🤖 GitLab Bot 🤖 changed milestone to %12.2
changed milestone to %12.2
- 🤖 GitLab Bot 🤖 added missed:12.1 label
added missed:12.1 label
- Lin Jen-Shin marked this issue as related to #65702 (closed)
marked this issue as related to #65702 (closed)
- Lin Jen-Shin mentioned in issue #65702 (closed)
mentioned in issue #65702 (closed)
- Rémy Coutable assigned to @rymai
assigned to @rymai
- Rémy Coutable mentioned in merge request !31728 (merged)
mentioned in merge request !31728 (merged)
- 🤖 GitLab Bot 🤖 removed [deprecated] Accepting merge requests label
removed [deprecated] Accepting merge requests label
- Matija Čupić marked this issue as related to #66547 (moved)
marked this issue as related to #66547 (moved)
- Matija Čupić mentioned in issue #63982 (closed)
mentioned in issue #63982 (closed)
- 🤖 GitLab Bot 🤖 mentioned in issue #66572 (closed)
mentioned in issue #66572 (closed)
- 🤖 GitLab Bot 🤖 mentioned in issue #66594 (closed)
mentioned in issue #66594 (closed)
- 🤖 GitLab Bot 🤖 mentioned in issue #66618 (closed)
mentioned in issue #66618 (closed)
- 🤖 GitLab Bot 🤖 changed milestone to %12.3
changed milestone to %12.3
- 🤖 GitLab Bot 🤖 added missed:12.2 label
added missed:12.2 label
- Kyle Wiebers added to epic &1853
added to epic &1853