Skip to content

fix(ci-tooling): keep release auto-commit on release branch, not main#322

Merged
githubrobbi merged 2 commits into
mainfrom
fix/ship-release-branch-flow
May 31, 2026
Merged

fix(ci-tooling): keep release auto-commit on release branch, not main#322
githubrobbi merged 2 commits into
mainfrom
fix/ship-release-branch-flow

Conversation

@githubrobbi
Copy link
Copy Markdown
Collaborator

Problem

The just ship flow (scripts/ci-pipelinegit_ops::git_push) created the chore: development vX.Y.Z auto-commit on the current branch (main), then told the operator to run git reset --hard origin/main after the release PR squash-merged (the squash rewrites the SHA). That left local main diverged from origin/main after every ship and required a destructive reset to recover.

Fix

  • Auto-commit now lives on release/vX.Y.Z, never on main. git_push switches onto the release branch (ensure_on_release_branch, replacing detect_current_branch), rebases it onto origin/main, opens the PR against BASE_BRANCH (main), then returns the working tree to main (new return_to_base_branch helper).
  • Local main no longer drifts → post-merge step is a plain git pull --ff-only origin main instead of git reset --hard; the operator hint printed at the end of git push is updated to match.
  • ensure_on_release_branch uses plain git 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-less HEAD.

Verification

  • Full pre-push suite green (no --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.

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.
@githubrobbi githubrobbi enabled auto-merge (squash) May 31, 2026 13:37
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.
@githubrobbi githubrobbi merged commit 0e87d56 into main May 31, 2026
27 checks passed
@githubrobbi githubrobbi deleted the fix/ship-release-branch-flow branch May 31, 2026 13:55
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