refactor(templates): split rules-free base bodies for build/deploy/lint#89
Open
universal-itengineer wants to merge 1 commit into
Open
refactor(templates): split rules-free base bodies for build/deploy/lint#89universal-itengineer wants to merge 1 commit into
universal-itengineer wants to merge 1 commit into
Conversation
Extract .build_base / .deploy_base / .lint_base carrying only the job body (stage + script, plus allow_failure for lint). .build / .deploy / .lint now extend their base and re-add the baked-in rules (and when: manual for deploy), so existing consumers are unaffected. This lets consuming projects gate these jobs with their own context mixin (extends: [.build_base, .dev]) instead of copying the body verbatim to escape the inherited rules, matching the existing .go_linter / .cve_scan convention. Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>
AntonFomichev-Flant
approved these changes
Jul 8, 2026
himax1991
approved these changes
Jul 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Split the three rules-baked hidden templates into a rules-free
*_basebody plus a thin wrapper that re-adds the rules:.build→.build_base(body) +.build(extends: .build_base+ rules).deploy→.deploy_base(body) +.deploy(extends + rules +when: manual).lint→.lint_base(body +allow_failure) +.lint(extends + rules)Why
.build/.deploy/.lintbakerules:directly into the job body. GitLab mergesextends:rules parent-first, so a consuming project cannot override the inherited gating — it is forced to copy the whole body verbatim just to attach its ownrules:(e.g. strict.dev/.main/.prodgating). Those verbatim copies then drift from upstream (thevirtualizationmodule's copy already predates the bundle-attestation change).Every other body template in this repo (
.go_linter,.go_tests,.cve_scan,.svace_analyze) is already rules-free and expects the consumer to attach a context mixin, e.g.extends: [.go_linter, .dev]. These three were the outliers; this change aligns them.Backward compatibility
.build/.deploy/.lintresolve to byte-identical jobs after the split, so existing consumers (includingexamples/simple-module.gitlab-ci.ymland the README snippet) are unaffected. New consumers can now do: