Repository navigation
feat: Add a template propagation check for pull requests to main - #1372
Closed
BaggioWongHK wants to merge 2 commits into
Closed
BaggioWongHK wants to merge 2 commits into
BaggioWongHK wants to merge 2 commits into
Conversation
A new minor's template is a one-time copy of the previous minor's. Nothing carries later changes forward, so a change merged to an older minor's template after the copy skips the newer minor unless someone makes it there too. 4.6.0 missed #1343 this way. CONTRIBUTING.md already describes a check for this, but it was never implemented. The "Check template propagation" workflow runs on every pull request to main and in the merge queue. It fails when: - a file in an older minor's template changes without the same file changing in the newest minor's template, unless the description contains `template-propagation: scoped`; - a newly added minor template differs from the previous minor's, apart from paths declared as `template-divergence: <path>`; - a change edits the old per-major paths (template/v4/dirs/), which the build no longer reads. It uses only the standard library, so it runs without the conda environment. It is meant to be required through a ruleset with no bypass list, after a few days running advisory.
This was referenced Oct 7, 2026
BaggioWongHK
added this pull request to stack #1374
October 7, 2026 20:25
Keep only the rule that addresses the root cause: changing an older minor's template requires changing the same file in the newest minor's template. - Replace the `template-propagation: scoped` description string with the `template-propagation-scoped` label. Only maintainers can apply labels, so scoping a change is their decision, and the workflow no longer reads the PR description. - Drop the new-template copy rule and its `template-divergence:` string, and the old per-major path rule. - Move the script next to the other CI helpers in .github/workflows/utils/, and pass inputs as environment variables so the workflow runs one command with no shell logic. - Mention the rule in the pull request template.
BaggioWongHK
pushed a commit
that referenced
this pull request
Oct 7, 2026
Merge the simplified propagation check from #1372, and drop the create-minor-template workflow and template_tools.py. A new minor's template is created once per minor by someone following the minor release runbook, so a one-line cp in a pull request to main is enough. main.py still refuses to create a missing template, and its error now prints the cp command. CONTRIBUTING.md describes the step.
Contributor
Author
|
Closing without merging. The team decided this tooling change is too costly to audit and test relative to its benefit. The conflict this guarded against is prevented instead by a release-runbook step: create the next minor's template on main ( |
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.
Description
A new minor's template is a one-time copy of the previous minor's. Nothing carries later changes forward, so a change merged to an older minor's template after the copy skips the newer minor unless someone makes it there too. 4.6.0 missed #1343 this way. CONTRIBUTING.md already describes a check for this, but it was never implemented.
The new "Check template propagation" workflow runs on every pull request to main. If the PR changes a file in an older minor's template (e.g.
template/v4/v4.5/...), the same file must also change in that major's newest minor template (e.g.template/v4/v4.6/...). Each failure is annotated on the changed file and names the counterpart that is missing the change.A change deliberately limited to older minors (a targeted backport) is opted out with the
template-propagation-scopedlabel. Only maintainers can apply labels, so scoping is a maintainer decision. The check reruns when the label is added or removed. The pull request template and CONTRIBUTING.md tell contributors about the rule and the label.The script (
.github/workflows/utils/check_template_propagation.py) uses only the standard library and reads its inputs from environment variables, so the workflow is a single command with no shell logic.Setup before merge: create the
template-propagation-scopedlabel. After a few days advisory, make the check required through a ruleset with no bypass list.Limits: the check confirms the counterpart file changed, not that it changed the same way, so reviewers still compare. A v4.6 change merged while the v4.7 template copy PR is open is not caught; #1373 adds a
diff -rstep to the copy PR instead.#1373 is stacked on this PR. Squash on merge.
Type of Change
Release Information
How Has This Been Tested?
test/test_check_template_propagation.pypass (pytest -m unit test/test_check_template_propagation.py), including one that runs the script against a temporary git repo with and without the label. black (line length 120) and isort pass.BASE_SHA=<base> HEAD_SHA=<merge> SCOPED=false python3 .github/workflows/utils/check_template_propagation.py:template/v4/dirs/, which this check does not cover.Checklist:
Related Issues
#1343, #1361, #1363