Skip to content

sync_all_siblings: optional --auto-merge for update --pr - #32

Merged
SDNick484 merged 1 commit into
mainfrom
audit/sync-auto-merge
Nov 10, 2026
Merged

SDNick484 merged 1 commit into
mainfrom
audit/sync-auto-merge

Conversation

@SDNick484

Copy link
Copy Markdown
Owner

Refs #16 (optional --auto-merge for sync_all_siblings.py update --pr).

Change

update --pr --auto-merge runs gh pr merge <url> --auto --squash on each new sync PR. It is off by default, and argparse refuses it without --pr. It never fails a sibling, because the PR is open either way. The status row says what happened:

Situation Row says
auto-merge allowed and checks required (classic protection or ruleset) auto-merge on (squash, once test (3.11), alpine pass)
repo setting off (allow_auto_merge: false) auto-merge skipped: turned off for the repo (Settings > General > Allow auto-merge)
no required checks auto-merge skipped: main requires no status checks, so it would merge before CI ran
protection / rulesets unreadable (a 404 from protection just means "not protected") auto-merge skipped: couldn't read main's required checks (…)
gh pr merge refuses auto-merge failed (<gh's message>)

Not touched: a sync PR that was already open (the "PR already open" skip).

Current state of the siblings (read from the API today)

All nine have "Allow auto-merge" off and no required checks (no branch protection, no rulesets). So the flag would currently skip every sibling, which is the safe outcome. To use it, each sibling needs:

  1. a ruleset on main requiring the CI jobs (e.g. test (3.11)…test (3.14), alpine, shared-drift); and
  2. Settings → General → Allow auto-merge.

I haven't changed any repo settings. Say if you want that as part of C2.

Tests

  • One test covers six siblings, one per row of the table above. It also asserts that every PR still opens and that gh pr merge … --auto --squash runs for exactly the three where it should.
  • Another test checks the flag is off by default (no API calls, no merge) and that --commit / --push with --auto-merge are refused.
  • required_checks() and the allow_auto_merge lookup were also run against the real mcp-server-onkyo: [] and false, matching the fake.
  • 23 sibling-script tests pass; ruff, format and mypy are clean.

🤖 Generated with Claude Code

With --auto-merge, each new sync PR gets `gh pr merge --auto --squash`, so it
merges itself once the sibling's CI passes. Off by default; only with --pr.

It never fails a sibling (the PR is open either way) and says in the status
table why it didn't turn auto-merge on:
- the repo has "Allow auto-merge" off (allow_auto_merge from the REST API);
- the default branch requires no status checks, from classic protection or
  rulesets: GitHub's auto-merge would then merge at once, before CI ran;
- the required checks can't be read (a 404 from branch protection just means
  "not protected");
- `gh pr merge` refused, with its message.
When it is on, the row names the checks it waits for.

Today all nine siblings have auto-merge off and require no checks (checked
against the API), so the flag would skip every one of them; README says what
it takes.

Refs #16

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@SDNick484
SDNick484 merged commit 9449e9f into main Nov 10, 2026
4 checks passed
@SDNick484
SDNick484 deleted the audit/sync-auto-merge branch November 10, 2026 22:04
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