Repository navigation
fix(release): cut the release branch before the changelog freeze - #1483
Merged
Merged
Conversation
Assert the shape #1479 requires before implementing it: the release branch is created BEFORE the changelog freeze, the freeze target is dev under gitflow and release/X.Y.Z under trunk (never the trunk itself), the release-branch fast-forward is non-forcing and gated on this run having created the branch, and open-pr refuses a zero-commit release PR via an explicit same-SHA guard. The two existing assertions that encoded the defective topology are retargeted in the same commit: `refs/heads/main` in a trunk render (nothing writes to the trunk any more) and the `dev_sha` output name (renamed to the model-neutral `freeze_sha`). Refs: #1479
Under DEVKIT_WORKFLOW=trunk the rendered prepare-release.yml froze the
CHANGELOG onto main and then cut release/X.Y.Z from that same post-freeze
SHA, so `gh pr create --base main --head release/X.Y.Z` had head == base
and GitHub refused it ("No commits between main and release/X.Y.Z"). The
freeze was also a direct push to the trunk, which a require-PR ruleset
rejects unless the Commit App is a bypass actor (the #1227 collision class).
Reorder the shipped (gitflow) asset into a model-agnostic shape so the
trunk render stays a literal substitution: capture the base SHA, create
release/X.Y.Z at it, freeze onto the model's freeze target, wait for that
target to advance (#617, retargeted via FREEZE_REF), then fast-forward the
release branch onto the freeze commit. Under gitflow that fast-forward is
real and the leg is behaviour-identical; under trunk the freeze already
landed on the release branch, so it short-circuits and main is never
written to — by the prepare freeze or by the rollback's restore.
The fast-forward is non-force and gated on this run having created the
branch: a pre-existing release/X.Y.Z may carry commits that are not
ancestors of the freeze commit, where the update is not a fast-forward at
all, so it is skipped exactly as branch creation has always tolerated it.
The rollback's freeze-ref read is taken after the branch delete and
tolerates a missing ref, which is what makes the trunk restore a natural
no-op. `open-pr` gains an explicit same-SHA guard: a collapsed topology now
fails with a named cause instead of an opaque GitHub refusal, which is the
regression assert a local-git simulation cannot express (#1206).
The prepare job's `dev_sha` output becomes `freeze_sha` (it is the freeze
commit under either model) and a new bats case runs actionlint over the
trunk-rendered workflows, the render class that now substitutes a ${{ }}
expression into workflow env values.
Refs: #1479
c-vigo
force-pushed
the
bugfix/1479-trunk-release-branch-topology
branch
from
August 13, 2026 08:05
879e44f to
116e1a5
Compare
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
Fixes the trunk release train. Under
DEVKIT_WORKFLOW=trunk,render_workflow_model()was a pure literaldev->mainrewrite, soprepare-release.ymlfroze the CHANGELOG ontomainand then cutrelease/X.Y.Zfrom that same post-freeze SHA, while the draft PR was stillopened
--base main --head release/X.Y.Z. Head and base resolved to one commitand
gh pr createfailed with "No commits between main and release/X.Y.Z".The same freeze was also a direct push to the protected trunk.
vig-os/org-configis blocked on exactly this; itsv1.0.0/v1.0.1werehand-cut, so the train has never executed there and the defect stayed latent.
Type of Change
fix-- Bug fixChanges Made
The shipped (gitflow) asset is restructured into a model-agnostic ordering,
so the trunk render stays a literal substitution with no step reordering in sed:
prepare_start_sha= base head (dev; trunk:main)release/X.Y.Zat that pre-freeze SHA — moved ahead of the freezeTARGET_BRANCH=refs/heads/dev(trunk: the release branch)freeze_wait— the [BUG] prepare-release can branch release/X.Y.Z at pre-freeze dev SHA (read-after-write race) #617 read-after-write loop, now watchingFREEZE_REFrelease/X.Y.Zonto the freeze commit (force=false); undertrunk the SHAs already match and the step short-circuits
open-prgained an explicit same-SHA guard beforegh pr create— theregression assert the issue asks for, since a local-git simulation cannot express
GitHub's server-side refusal (which is why the #1206 spike could not catch this).
Verified on the actual trunk render: base reads resolve to
heads/main, thefreeze
TARGET_BRANCHandFREEZE_REFresolve to the release branch, therollback's restore target likewise, and there are zero residual bare
devtokens. The freeze therefore never touches the trunk, so no Commit App bypass
on
mainis required — consistent with how #1227 was resolved.gitflow is behaviourally unchanged: the freeze still lands on
devand therelease branch still ends at the freeze commit (now by fast-forward instead of by
late creation).
test_gitflow_scaffold_matches_default_pathandtest_gitflow_render_files_are_byte_identical_to_templatestill pass.Incidental improvement: a failure between the freeze and branch creation used
to leave
dev_shaempty, silently skipping the rollback's changelog restore;freeze_shais now emitted immediately after the freeze.Changelog Entry
(full entry with sub-bullets is in
CHANGELOG.md)Testing
uv run pytest tests/test_workflow_model.py-> 12 failed before the fix, 32 passed afteruv run pytest tests/test_workflow_model.py tests/test_workflow_prepare_extension.py tests/test_release_core.py tests/test_release_rollback_guard.py tests/test_scaffold_lint.py tests/test_scaffold_drift.py-> 136 passeduv run pytest -m "not integration"-> 1355 passed, 20 skippedjust test-bats-> 506 ok, 0 not ok — including a new case running actionlint over the trunk-rendered workflows (previously only gitflow renders were linted)prek run --all-files-> onlycheck-expirationsfails;.vulnixignoreis byte-identical todevon this branch. Fixed by fix(security): renew the glibc exception block to 2026-09-02 #1482 — merge that first.Manual Testing Details
Rendered a trunk scaffold and read the resulting
prepare-release.ymldirectly toconfirm the branch/freeze/PR topology and the absence of
devresidue.No live CI proof exists in this repo —
devkit-smoke-testis gitflow, so everyautomated leg here exercises only the unchanged gitflow path. Live proof will be
vig-os/org-config's next release train.Closes #1479
Refs: #1479