Repository navigation
fix(promote): accept hotfix releases already merged back to main - #18
Merged
Merged
Conversation
Promotion refused any latest release whose commit is not an ancestor of main. A hotfix cut from an older release tag never is: merging it back with a squash merge or a cherry-pick gives main new commits. invest-v3 v3.3.5 hit this on 2026-10-21. Its changes had been squash-merged to main the day before (#363 in apps-invest), yet promotion failed with "not on main" and the release went out through rollback.yml. When the tag is not on main, the check now takes the release's delta from its merge-base with main and requires it to reverse-apply cleanly to main's tree, i.e. every change the hotfix carries is already on main. Releases on main pass as before. A hotfix with any change missing from main (added, edited or deleted files) is still refused, and the error names the files. Also updates the README gate description, including the latest-tag dispatch allowed since #14, and records the rule in CLAUDE.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GNMKQZ7D8fHsi98P76jU5Z
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.
Problem
app-promote-production.ymlrefuses any latest release whose tag commit is not an ancestor ofmain. A hotfix cut from an older release tag can never pass that check, even after it is merged back, because squash merges and cherry-picks givemainnew commits with new SHAs.This blocked invest-v3
v3.3.5on 2026-10-21 (failed run):v3.3.5was cut fromv3.3.3onhotfix/basin_allow_listbecausemaincarried unreleased work (the SDK snapshot bump and others). Its two commits were already onmainas squash/cherry-pick equivalents (centrifuge/apps-invest#363 and centrifuge/apps-invest#341;git cherry origin/main v3.3.5marks both-), merged the day before the release was published. The release went out throughrollback.ymlinstead, which has no on-main check at all.Change
When the tag is not on
main, the check now:main(git merge-base),--binary --no-renames),main's tree (git apply --cached --check --reverseagainst a temporary index; nothing is written).So a hotfix promotes only once every change it carries is on
main, however it got there (squash merge, merge commit, cherry-pick, multi-commit branch squashed into one PR). Releases onmaintake the unchanged ancestry fast path.Still refused, with
git applynaming the files:mainhas since rewritten (rollback.yml stays the escape hatch for that case),main.Also updated: the Slack failure reason, the workflow header, the README gate description (which also gains the latest-tag dispatch allowed since #14), and a CLAUDE.md note so the check is not reverted to ancestry-only.
Validation
actionlint1.7.7 (with shellcheck) andyamllint(relaxed, line-length off): clean.run:block, extracted from the workflow, against apps-invest history:v3.3.5vs currentmain: passes (hotfix delta already on main).v3.3.3vs currentmain: passes (on main).v3.3.5vsmainbefore centrifuge/apps-invest#363 merged: refused, naminginstantRedemptionWhitelist.tsand its test.mainmoving on elsewhere in the same file passes; empty delta passes; unmerged added file, deleted file, removed line and rewritten hotfix lines are all refused.Rollout
No contract change: inputs, secrets and permissions are untouched, so callers need nothing. Takes effect on the next promote run after merge.
Generated by Claude Code