Repository navigation
feat(ci): refuse to cut a release while dev is behind main - #1681
Merged
Merged
Conversation
c-vigo
enabled auto-merge
September 25, 2026 06:24
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
prepare-hotfix.ymlrefused to start whenevermain's## Unreleasedhad content, resting on #590's invariant that it never does. #1676's revised plan supersedes that invariant —mainmay now carry changes that have landed but are not yet shipped — and this refusal was its only mechanical blocker. Left alone, the lane that exists for urgent security incidents would refuse every time the release-neutral lane had been used.A hotfix cuts from
main's head, so it ships whatevermaincarries; those entries belong in the hotfix's own version section. The refusal becomes a branch on content.Type of Change
feat-- New featurefix-- Bug fixdocs-- Documentation onlychore-- Maintenance task (deps, config, etc.)refactor-- Code restructuring (no behavior change)test-- Adding or updating testsci-- CI/CD pipeline changesbuild-- Build system or dependency changesrevert-- Reverts a previous commitstyle-- Code style (formatting, whitespace)Modifiers
!) -- This change breaks backward compatibilityBehaviour changes only in the case that is currently a hard error.
Changes Made
validateclassifies instead of refusing. The step is nowClassify main's Unreleased section: it probes withprepare-changelog validate, setsMODE=preparewhen the section carries entries andMODE=seedwhen it does not, dry-probes that exact call locally, and publishes the verdict as a newchangelog_modejob output.preparebranches on that verdict.prepare-changelog prepare X.Y.Zfreezesmain's carried entries into## [X.Y.Z] - TBD(plus a fresh empty Unreleased);prepare-changelog seed X.Y.Zwrites an empty section exactly as before. The classification is load-bearing:preparerun on an empty Unreleased scoops the previous release's section instead (verified locally), which is why the mode is decided before anything is written.main, neverdev— so rollback remains "delete the branch".main's## Unreleasedself-clears when the release branch merges back.docs/RELEASE_CYCLE.md(hotfix preconditions, CHANGELOG-state block,prepare/seedCLI reference) anddocs/DOWNSTREAM_RELEASE.mdrecord the superseded invariant.Not changed, deliberately:
release.yml's publish-time gate (prepare-changelog validate --version). No empty sections at release time; an empty section is acceptable atprepare-hotfixtime. This does mean carried entries satisfy that gate without the hotfix's own fix being described — accepted on the issue, no compensating check added. Both the PR body the lane writes and the docs say so explicitly.Commit split. Devkit's own
.github/workflows/copy and theassets/workspace/scaffold copy land as separate commits: the first is release-neutral and can reachmainthrough the #1676 lane, the second is a published asset and needs a release. The scaffold copy did carry the equivalent refusal (its own dialect: mode-aware toolchain, nouv run) and received the same branch.Changelog Entry
Testing
just test)Manual Testing Details
tests/test_workflow_prepare_hotfix.pygainedtest_validate_classifies_mains_unreleased_instead_of_refusingandtest_prepare_freezes_carried_entries_or_seeds_an_empty_section, both parametrized over the devkit and scaffold copies. Committed RED (4 failures), then GREEN per copy.uv run pytest tests/test_workflow_prepare_hotfix.py -q-> 33 passed.uv run pytest tests/ -q --ignore=tests/test_image.py --ignore=tests/test_integration.py(those two fail locally from a stale:devimage) -> green.just precommit(prek run --all-files) -> exit 0, includingactionlint,shellcheck,yamllintand thesync-manifestdrift gate.prepare/seedsemantics directly againstprepare-changelogon fixture changelogs, including the failure mode that motivates classifying first:prepareon an empty## Unreleasedmoves the previous release's section into the new one.Checklist
docs/templates/, then runjust docs)CHANGELOG.mdin the[Unreleased]section (and pasted the entry above)docs/RELEASE_CYCLE.mdanddocs/DOWNSTREAM_RELEASE.mdare hand-maintained, not generated fromdocs/templates/.Additional Notes
prepare-releasesync-ordering guard) is not in scope here.dev, per the repo's gitflow model.Refs: #1679