Skip to content

fix(ci): keep release back-merges out of the squash auto-merge - #580

Merged
github-actions[bot] merged 1 commit into
developfrom
fix/automerge-skip-backmerge
Aug 22, 2026
Merged

fix(ci): keep release back-merges out of the squash auto-merge#580
github-actions[bot] merged 1 commit into
developfrom
fix/automerge-skip-backmerge

Conversation

@tomymaritano

Copy link
Copy Markdown
Collaborator

Problem

#566 made every non-draft PR into develop squash auto-merge. That breaks the release flow, and I found it by hitting it twice.

A back-merge exists for its topology, not its content. Squashing one replays main's changes as a fresh commit, so main never becomes an ancestor of develop. main's ruleset has strict_required_status_checks_policy: true, so the promotion PR #571 stays BEHIND forever.

Both #578 and #579 hit it. On #579 I explicitly ran gh pr merge --auto --merge, and the workflow re-armed auto-merge with --squash and overrode it. The resulting commit 00ac6d5 has a single parent, and git merge-base --is-ancestor origin/main origin/develop still fails.

Fix

Skip PRs whose head branch starts with chore/backmerge-. Those get merged by hand with a merge commit.

Also documents the back-merge recipe in docs/RELEASE.md next to the promotion steps, since the failure mode is silent — the PR just sits at BEHIND with every check green and no explanation.

Not changed

The auto-merge policy itself, permissions, and the concurrency/live-recheck hardening from earlier in #566 all stay as they are. This is one if: clause plus docs.

🤖 Generated with Claude Code

Blanket squash auto-merge into develop makes back-merging main impossible.
A squash replays main's changes as a fresh commit, so main never becomes an
ancestor of develop and the develop -> main promotion PR stays BEHIND under
main's up-to-date requirement. #578 and #579 both hit this: the workflow
re-armed auto-merge with --squash and overrode the merge method.

Skip PRs whose head starts with chore/backmerge-, and write the back-merge
recipe into docs/RELEASE.md.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 22, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@tomymaritano, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 39 minutes

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

Wait for the limit to reset, then comment @coderabbitai review or push new commits to the PR.

An organization admin can change what happens after included review limits in Billing.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: f3945a09-ba79-4025-8f33-f145a8880aad

📥 Commits

Reviewing files that changed from the base of the PR and between 00ac6d5 and 008018d.

📒 Files selected for processing (2)
  • .github/workflows/automerge.yml
  • docs/RELEASE.md

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions
github-actions Bot enabled auto-merge (squash) August 22, 2026 22:08
@github-actions
github-actions Bot merged commit 5ecd9fc into develop Aug 22, 2026
16 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.17.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

tomymaritano added a commit that referenced this pull request Aug 23, 2026
…585)

## Context

I enabled **Allow GitHub Actions to create and approve pull requests**
at the org and repo level, which unblocked `sync-develop` — it had been
failing with `GitHub Actions is not permitted to create or approve pull
requests` since forever. Re-running it against the v0.17.0 build now
succeeds.

But it immediately produced #584, which **cannot merge**.

## The problem

`sync-develop` opened a `develop ← main` PR. That shape deadlocks:
`develop` requires the head branch to be up to date, and `main` falls
behind `develop` the moment anything lands after the release — #582 and
#583 did exactly that. #584 has been sitting at `BEHIND` since it was
created. I hit the same wall by hand earlier tonight with #577.

Even if it could merge, the squash auto-merge would replay the content
as a fresh commit and **not** establish ancestry, which is the entire
point of a back-merge. That is what went wrong in #578 and #579.

## The fix

Push a branch descended from `develop` with `main` merged into it, then
open that against `develop`. Same thing that finally worked manually in
#581.

- Named `chore/backmerge-main-<tag>`, which matches the exclusion added
in #580 so `automerge.yml` leaves it alone.
- The job arms auto-merge itself with `--merge`, so it lands as a merge
commit.
- Exits early when `main` is already an ancestor, or when the branch
already exists, so re-runs are safe.

## Follow-up

#584 should be closed — this replaces it. The next release will exercise
this path for real.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant