Commit bd273c1
authored
fix(queue): retry a transient GitHub mergeable_state read before deferring to the next sweep (#8560)
Live incident: metagraphed#8037 (and others) sat unmerged for ~6 minutes
after being approved, gate-passing, and fully-autonomous-merge-configured
(autonomy.merge: auto, requireApprovals: 0). GitHub computes mergeable_state
ASYNCHRONOUSLY after a push/review and can return "unknown" (still
computing) even on the forced live re-fetch taken moments after posting the
approving review -- the disposition correctly refused to merge into an
unconfirmed state, but simply deferred to the next scheduled regate sweep
(~6 minutes later) instead of retrying. That multi-minute window is exactly
where an overlapping sibling PR can land first and base-conflict the
original PR out from under it.
refreshLiveMergeState now retries a short, bounded number of times (2)
SPECIFICALLY on "unknown" -- "dirty"/"blocked"/"behind" are real, stable,
non-computing states and are never retried -- before falling through to the
same defer-to-sweep behavior as before. Mirrors the identical GitHub-lag
pattern already used for diff/files computation
(fetchAndStorePullRequestFilesForReview).
Test-only delay override via the same vitest-setup.ts suite default this
session's other perf fixes use, so the retry's own logic is exercised
without adding real wall-clock time to the suite.1 parent 0c19927 commit bd273c1
3 files changed
Lines changed: 89 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
339 | 339 | | |
340 | 340 | | |
341 | 341 | | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
342 | 379 | | |
343 | 380 | | |
344 | 381 | | |
| |||
356 | 393 | | |
357 | 394 | | |
358 | 395 | | |
359 | | - | |
| 396 | + | |
360 | 397 | | |
361 | 398 | | |
362 | 399 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| 15 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
| 9 | + | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
| |||
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
23 | 72 | | |
24 | 73 | | |
25 | 74 | | |
| |||
0 commit comments