Skip to content

fix(automerge): stop re-approving every sweep; direct-merge when already clean - #120

Open
toufali wants to merge 3 commits into
mainfrom
fix/automerge-idempotent-and-direct-merge
Open

fix(automerge): stop re-approving every sweep; direct-merge when already clean#120
toufali wants to merge 3 commits into
mainfrom
fix/automerge-idempotent-and-direct-merge

Conversation

@toufali

@toufali toufali commented Aug 4, 2026

Copy link
Copy Markdown
Member

Fixes #117.

Two related auto-merge issues:

1. Re-approves the same PR every sweep (no idempotency). approve_and_merge submitted a fresh APPROVED review every run, so a PR whose enable_auto_merge kept failing collected 100+ duplicate approvals. Now it checks blender_approved_head(pr) — an existing BLEnder APPROVED review on the current head SHA — and skips re-approving.

2. Never merges on repos with no required status checks. Such repos (e.g. mozilla/fxa) go clean immediately, so enablePullRequestAutoMerge is refused with "Pull request is in clean status" and the PR never merges. Now, on that specific error, BLEnder merges directly via a new merge_pr GraphQL helper (using the repo-allowed merge method). Other enable errors still SkipPR (bounded, and no longer re-approve thanks to #1).

Files: scripts/github_utils.py (new blender_approved_head, merge_pr), scripts/automerge_dependabot.py (approve_and_merge). Both py_compile clean.

🤖 Generated with Claude Code

toufali and others added 2 commits August 4, 2026 13:38
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@toufali
toufali requested a review from groovecoder as a code owner August 4, 2026 20:38
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

fix(automerge): re-approves the same PR every sweep when enable_auto_merge fails (no backoff)

1 participant