Skip to content

feat: Add a template propagation check for pull requests to main - #1372

Closed
BaggioWongHK wants to merge 2 commits into
mainfrom
template-first/b-propagation-check
Closed

BaggioWongHK wants to merge 2 commits into
mainfrom
template-first/b-propagation-check

Conversation

@BaggioWongHK

@BaggioWongHK BaggioWongHK commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

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-scoped label. 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-scoped label. 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 -r step to the copy PR instead.

#1373 is stacked on this PR. Squash on merge.

Type of Change

  • Image update - Bug fix
  • Image update - New feature
  • Image update - Breaking change
  • SMD image build tool update
  • Documentation update

Release Information

  • Yes (Critical bug fix or security update)
  • No (New feature or non-critical change)
  • N/A (Not an image update)

How Has This Been Tested?

Checklist:

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works

Related Issues

#1343, #1361, #1363

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.
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.
@BaggioWongHK

Copy link
Copy Markdown
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 (cp -r template/vX/vX.Y template/vX/vX.(Y+1)) right after X.Y.0 ships, before the next minor's first build. The branch is kept for reference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant