Skip to content

ci: retry direct merge while GitHub recomputes mergeability#369

Merged
christineschen merged 1 commit into
mainfrom
fix/auto-merge-mergeability-race
Jul 10, 2026
Merged

ci: retry direct merge while GitHub recomputes mergeability#369
christineschen merged 1 commit into
mainfrom
fix/auto-merge-mergeability-race

Conversation

@christineschen

Copy link
Copy Markdown
Contributor

TL;DR

Follow-up to #367. With the Verify examples blocker fixed, the first clean regen run (29115606490, PR #368) exposed a race in the auto-merge step: the doc-sync push invalidates GitHub's cached mergeability, so the immediate merge attempt fails with GraphQL: Pull Request is not mergeable (mergePullRequest) — even though the PR settles to MERGEABLE/CLEAN seconds later (I merged #368 manually right after with no changes).

Fix

  • Add not mergeable to the auto-merge noop pattern so the transient error takes the wait-then-direct-merge path instead of hard-failing.
  • Wrap the direct squash in merge_with_retry: retry not mergeable errors every 15s for up to 8 attempts (~2 min); any other error still fails immediately.

Testing

The failure is only reproducible inside a live Generate run (needs the doc-sync push + immediate merge). The next regen PR (nightly, or the next spec change) exercises this path; logic is a straight retry loop around the existing gh pr merge call.

The doc-sync push on the regen branch invalidates GitHub's cached
mergeability; a merge attempt in that window fails with "Pull Request
is not mergeable" even though the PR settles to CLEAN moments later
(run 29115606490 / PR #368). Treat that error as retryable: match it
in the auto-merge noop pattern and retry the direct squash for up to
~2 minutes instead of failing the run.
@christineschen christineschen merged commit 623bb5e into main Jul 10, 2026
@christineschen christineschen deleted the fix/auto-merge-mergeability-race branch July 10, 2026 19:00
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