Skip to content

fix(automerge): use a repo-allowed merge method; surface enable_auto_merge errors - #110

Open
toufali wants to merge 2 commits into
mainfrom
fix/automerge-merge-method
Open

fix(automerge): use a repo-allowed merge method; surface enable_auto_merge errors#110
toufali wants to merge 2 commits into
mainfrom
fix/automerge-merge-method

Conversation

@toufali

@toufali toufali commented Jul 30, 2026

Copy link
Copy Markdown
Member

Fixes #109.

Problem

enable_auto_merge hardcodes mergeMethod: SQUASH, which fails on repos that disable squash merges (e.g. mozilla/fxa, merge-commit-only). approve_and_merge ignores the returned error and logs Auto-merge enabled regardless, so PRs are approved but never auto-merge — silently.

Fix

  • github_utils.py: add _allowed_merge_method() — pick a method the repo permits (prefer SQUASH, else MERGE, else REBASE) and pass it to the mutation as a variable.
  • automerge_dependabot.py: approve_and_merge now checks enable_auto_merge's return and raises SkipPR(...) with the real error, so a failure is reported honestly instead of logged as success.

Testing

Not run in the Actions context (needs app creds). Both files py_compile clean. Behavior on squash-enabled repos is unchanged (SQUASH is still preferred); merge-commit-only repos now fall back to MERGE.

🤖 Generated with Claude Code

toufali and others added 2 commits July 29, 2026 19:40
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…alse success

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@toufali
toufali requested a review from groovecoder as a code owner July 30, 2026 02:40
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): use a repo-allowed merge method; surface enable_auto_merge errors

1 participant