Skip to content

Retry auto-merge enablement in the approval workflow.#35

Open
vorporeal wants to merge 1 commit intomainfrom
david/retry-auto-merge
Open

Retry auto-merge enablement in the approval workflow.#35
vorporeal wants to merge 1 commit intomainfrom
david/retry-auto-merge

Conversation

@vorporeal
Copy link
Copy Markdown
Contributor

@vorporeal vorporeal commented Apr 28, 2026

Description

The approve workflow's auto-merge enable step (gh pr merge --auto --squash) occasionally fails with the GraphQL error Base branch was modified. Review and try the merge again. when the base branch is updated concurrently with our request — typically when another sync PR in the queue merges at the same moment. The previous code silently swallowed all failures via check=False, leaving the PR approved but without auto-merge enabled, which can stall the queue until some later event re-triggers the workflow.

This change wraps the auto-merge enablement in a retry loop: on stderr containing Base branch was modified, sleep 10s and retry, up to 3 attempts total. Non-retryable failures still fall through after a single attempt with a warning log, matching the prior behavior.

Example failure: https://github.com/warpdotdev/warp-internal/actions/runs/25027455954/job/73301658617

Testing

New unit tests in tests/workflows/test_approve_logic.py cover:

  • success on the first attempt (no retries, no sleeps)
  • retry-then-succeed when the first attempt hits the transient error
  • give up after max_attempts without raising (so the escalation workflow can recover later)
  • no retry for unrelated errors

Existing test suite still passes.

Co-Authored-By: Oz oz-agent@warp.dev

@cla-bot cla-bot Bot added the cla-signed label Apr 28, 2026
Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@vorporeal vorporeal requested a review from captainsafia April 28, 2026 22:39
@vorporeal vorporeal marked this pull request as ready for review April 28, 2026 22:40
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