fix(queue): retry policy closes on PR lock contention - #2471
Conversation
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-02 05:45:32 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 5 non-blocking
Review context
Contributor next steps
Signal definitions
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2471 +/- ##
=======================================
Coverage 95.93% 95.93%
=======================================
Files 225 225
Lines 25332 25336 +4
Branches 9217 9217
=======================================
+ Hits 24302 24306 +4
Misses 417 417
Partials 613 613
🚀 New features to boost your workflow:
|
Motivation
converted_to_draftandreopenedenforcement to be silently skipped when maintenance held the lock.Description
PrActuationLockContendedErrorand propagate it whenclaimPrActuationLockfails for policy enforcement paths so the queue will retry rather than record the webhook as processed. (src/queue/processors.ts)maybeCloseDraftDodgeAttemptandmaybeRecloseDisallowedReopento throw the new error on lock contention instead of silently returning, and update comments to document the retryable behavior. (src/queue/processors.ts)lock_contendedenum path fromReopenRecloseOutcome, and make only an actual"reclosed"outcome short-circuit the normal webhook flow to avoid falling through to normal re-review when contention occurs. (src/queue/processors.ts)converted_to_draftandreopeneddeliveries now reject with the lock-contended error and do not mutate GitHub or record a false audit; concurrent race tests assert exactly one success and one retryable failure. (test/unit/queue.test.ts)Testing
npx vitest run test/unit/queue.test.ts -t "draft-dodge|reopen-reclose"and broader unit suite affected by the changes; the modified tests passed (reopened/draft-dodge regression tests updated and green). ✅npm run typechecksucceeded with no errors. ✅npm audit --audit-level=moderatebut the registry audit endpoint returned403 Forbiddenin this environment, so audit could not complete here (environment issue, not code failure).Codex Task