Skip to content

ci(back-merge): realign next onto main to kill drift#374

Merged
blafourcade merged 1 commit into
nextfrom
ci/back-merge-realign
Jun 30, 2026
Merged

ci(back-merge): realign next onto main to kill drift#374
blafourcade merged 1 commit into
nextfrom
ci/back-merge-realign

Conversation

@blafourcade

Copy link
Copy Markdown
Contributor

🎯 What & why

Stop the rebase-promote hash drift from accumulating. After each release the back-merge now realigns next onto main (when next holds no unreleased work), instead of only merging, so next never diverges into a giant conflicting promote again.

🛠️ How it works

After git merge origin/main: if the result is content-identical to main (next had nothing unreleased), force-push next to main's hashes; else keep the merge and push normally (no work lost). The bot's always bypass on the next ruleset permits the force-push.

🧪 How to verify

Next release: the back-merge run leaves next at main's exact HEAD (zero divergence), with no back-merge-failed issue.

✅ I certify

  • I DO CERTIFY I READ EACH LINE OF THE PULL REQUEST BECAUSE I AM A SOFTWARE ENGINEER, NOT A AI PUPPY.

When the post-release merge leaves next content-identical to main (next held
no unreleased work, the normal case), force-push next to main's hashes so the
hash divergence from rebase-merged promotes cannot accumulate into a giant
conflicting promote. When next has real unreleased work, keep the merge and
push normally, so nothing is ever lost. The bot's always-bypass on the next
ruleset lets it force-push.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@blafourcade blafourcade merged commit d81a568 into next Jun 30, 2026
7 checks passed
@blafourcade blafourcade deleted the ci/back-merge-realign branch June 30, 2026 18:55

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4c0fa47ddf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

# accumulate into a giant conflicting promote later. Otherwise next
# has real unreleased work, so keep the merge and push normally.
if git diff --quiet origin/main HEAD; then
git push --force origin "origin/main:refs/heads/next"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve concurrent updates when force-realigning next

In this release workflow, actions/checkout snapshots next before the merge; if any PR or Dependabot merge lands on next while the job is running, this new unconditional --force can still reset refs/heads/next to the previously fetched origin/main, discarding those newer commits. I checked git push -h: --force is only “force updates”, while --force-with-lease requires the old ref value, so using a lease or refetching/rechecking would turn this race into a failed back-merge issue instead of history loss.

Useful? React with 👍 / 👎.

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