Merge fails with a conflict that isn't there #245

Closed
opened 2026-10-27 15:30:58 -04:00 by cmoriarty · 1 comment
Owner

What happens
git.pr.merge fails with "no longer merges into main: the base moved". But main hadn't moved, and a plain retry merged fine.

Why
Forgejo answered "Please try again later" while its mergeable check was still running. Braid read the PR once, saw mergeable: false, and called it a conflict.

Cost
4 of 9 merges in the pinball test. Each one waited for a manual retry: 18.6 min in all.

Fix

  • Re-read the PR until the mergeable check settles.
  • Only call it a conflict if main actually moved.

Done when
A merge Forgejo defers retries on its own and goes through.

Where to look: src/osf/forgejo.py, around line 2721 (the path from #221).

From the Braid vs Claude Code pinball test, 2026-10-27 (runs 110–120).

**What happens** `git.pr.merge` fails with "no longer merges into main: the base moved". But main hadn't moved, and a plain retry merged fine. **Why** Forgejo answered "Please try again later" while its mergeable check was still running. Braid read the PR once, saw `mergeable: false`, and called it a conflict. **Cost** 4 of 9 merges in the pinball test. Each one waited for a manual retry: 18.6 min in all. **Fix** - Re-read the PR until the mergeable check settles. - Only call it a conflict if main actually moved. **Done when** A merge Forgejo defers retries on its own and goes through. Where to look: `src/osf/forgejo.py`, around line 2721 (the path from #221). _From the Braid vs Claude Code pinball test, 2026-10-27 (runs 110–120)._
Author
Owner

What shipped

  • When Forgejo refuses a merge and reads the PR as not mergeable, the step checks the run's clone: if main's head is already in the branch, the two cannot conflict, so it reads the PR again until Forgejo says it merges, then merges.
  • Only a base that really moved fails at once as a conflict.

Test
tests/forge/test_merge.py (real git): a deferred merge goes through; a moved base fails as before.

Shipped in 5598ddf (OpenSpec change reliable-dispatch-merge-and-ci-evidence, archived).

**What shipped** - When Forgejo refuses a merge and reads the PR as not mergeable, the step checks the run's clone: if main's head is already in the branch, the two cannot conflict, so it reads the PR again until Forgejo says it merges, then merges. - Only a base that really moved fails at once as a conflict. **Test** `tests/forge/test_merge.py` (real git): a deferred merge goes through; a moved base fails as before. _Shipped in 5598ddf (OpenSpec change `reliable-dispatch-merge-and-ci-evidence`, archived)._
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
cmoriarty/braid#245
No description provided.