fix(ci-tooling): keep release auto-commit on release branch, not main#322
Merged
Conversation
The ship flow (git_ops::git_push) committed the 'chore: development vX.Y.Z' auto-commit on the current branch (main), then required 'git reset --hard origin/main' after the squash-merge because the squash rewrites the SHA. This left local main diverged from origin/main after every ship. Now the auto-commit lives on release/vX.Y.Z only: git_push switches onto the release branch (ensure_on_release_branch, replacing detect_current_branch), rebases onto origin/main, opens the PR against BASE_BRANCH (main), and returns the working tree to main (new return_to_base_branch helper). Local main never drifts, so the post-merge step becomes a plain 'git pull --ff-only origin main' instead of a destructive reset; the operator hint is updated to match. ensure_on_release_branch uses plain 'git switch' (not -C) so a resumed ship lands on the existing release branch holding the auto-commit. Closes the main-drift problem the ship flow had after squash-merges.
The open_release_pr body still described the retired step-09 behavior ('Binaries + GitHub Release already live') and told operators to recover with 'git reset --hard origin/main' — both contradict the new flow.
Now the body explains binaries are built post-merge by auto-tag-release.yml -> release.yml, and that local main never drifts so syncing is a plain 'git pull --ff-only'. Matches the helper logic changed in this same branch.
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
The
just shipflow (scripts/ci-pipeline→git_ops::git_push) created thechore: development vX.Y.Zauto-commit on the current branch (main), then told the operator to rungit reset --hard origin/mainafter the release PR squash-merged (the squash rewrites the SHA). That left localmaindiverged fromorigin/mainafter every ship and required a destructive reset to recover.Fix
release/vX.Y.Z, never onmain.git_pushswitches onto the release branch (ensure_on_release_branch, replacingdetect_current_branch), rebases it ontoorigin/main, opens the PR againstBASE_BRANCH(main), then returns the working tree tomain(newreturn_to_base_branchhelper).mainno longer drifts → post-merge step is a plaingit pull --ff-only origin maininstead ofgit reset --hard; the operator hint printed at the end ofgit pushis updated to match.ensure_on_release_branchuses plaingit switch(not-C) so a resumed ship lands on the existing release branch that already holds the auto-commit rather than resetting it to a commit-lessHEAD.Verification
--no-verify): fmt, clippy (lint-ci/-no-default/-prod/-tests/-windows),cargo-check,rustdoc,doc-tests,tests,smoke, plus all drift/policy gates.CHANGELOG.md[Unreleased]updated under Fixed.