Skip to content

feat: Create new minor templates on main before the first build - #1373

Closed
BaggioWongHK wants to merge 2 commits into
template-first/b-propagation-checkfrom
template-first/c-create-templates-on-main
Closed

BaggioWongHK wants to merge 2 commits into
template-first/b-propagation-checkfrom
template-first/c-create-templates-on-main

Conversation

@BaggioWongHK

@BaggioWongHK BaggioWongHK commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Description

Since 31c0e14, a new minor's template has been copied from the previous minor during that minor's first build and committed only to its release branch. Main never had it, so nobody editing templates on main could see that the new minor needed their change, and a later port that created the folder on main gave the two branches unrelated copies that conflicted. That is what broke 4.6.0 (#1343, #1361, #1363).

This moves the copy to main, as a manual step done once per minor:

  • main.py: _ensure_minor_template_exists no longer copies. It fails and prints the command to run in a pull request to main, e.g. cp -r template/v4/v4.6 template/v4/v4.7. X.0 still needs a template created by hand.
  • build-image.yml: commit only build_artifacts/ to release branches.
  • CONTRIBUTING.md: describes the copy PR, including a diff -r check before merging it, so a change to the previous minor that lands while the copy is in review isn't lost.

The minor release runbook gets a matching step: when X.Y.0 is released, open the X.(Y+1) copy PR and merge it before the first X.(Y+1).0 build. If that step is skipped, the nightly X.(Y+1).0 build fails with the message above.

Stacked on #1372; merge after it. Squash on merge.

Timing: this needs to merge before 4.6.0 ships. The night after 4.6.0 is published, the nightly starts 4.7.0 and would otherwise create v4.7 on release-4.7.0 again. Either way, open the v4.7 copy PR right after 4.6.0 ships.

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?

  • _ensure_minor_template_exists was run in isolation: it returns when the template exists, and raises with the cp command for 4.7 and the by-hand message for 5.0, without creating anything.
  • black (line length 120) and isort pass on src/main.py.
  • test/test_main.py was not run: it needs the conda environment, and its 8 minor/major artifact tests already fail on main.

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

Since 31c0e14, a new minor's template has been copied from the previous
minor during that minor's first build and committed only to its
release branch. Main never had it, so nobody editing templates on main
could see that the new minor needed their change, and a later port that
created the folder on main gave the two branches unrelated copies that
conflicted. That is what broke 4.6.0 (#1343, #1361, #1363).

Make the copy on main instead:
- create-minor-template.yml: when X.Y.0 is published (or on manual
  dispatch), open a pull request to main that copies vX.Y to vX.(Y+1).
  The propagation check verifies it is an exact copy.
- main.py: _ensure_minor_template_exists no longer copies; it fails
  and points to that pull request. X.0 still needs a manual template.
- build-image.yml: commit only build_artifacts/ to release branches.
- CONTRIBUTING.md: describe the new flow.
- template_tools.py: add `create` and require_minor_template.
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