fix(queue): reclose ambiguous padded reopens - #2470
Conversation
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-02 06:40:24 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 6 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 #2470 +/- ##
=======================================
Coverage 95.93% 95.93%
=======================================
Files 225 225
Lines 25338 25340 +2
Branches 9218 9219 +1
=======================================
+ Hits 24308 24310 +2
Misses 417 417
Partials 613 613
🚀 New features to boost your workflow:
|
The reopener-supersede check collapsed two different outcomes of
getLastReopenerLogin/getLastCloserLogin into the same
{ login: null, coveredAllPages: false } shape: a bounded scan that
ran to completion and simply found no matching event in its window
(the padded-timeline case this PR fixes), and a caught read error
(network/auth/rate-limit) that proves nothing at all. Collapsing them
meant a transient GitHub API error during the reopener re-check now
re-closed a PR instead of failing closed.
getLastActorForEvent (src/github/pr-actions.ts) now returns a third
field, `errored`, set only in the catch block. The reopener-supersede
check in recloseDisallowedReopenIfNeeded (src/queue/processors.ts)
treats an errored read as superseded (deny the re-close, fail
closed) before falling through to the existing covered/bounded-window
logic, restoring the original fail-closed guarantee for genuine
errors while keeping the padded-window fix intact.
Updates every existing getLastCloserLogin/getLastReopenerLogin
assertion in test/unit/github-pr-actions.test.ts to the new three-field
shape, and reverts the reopener-timeline-read-error regression test in
test/unit/queue.test.ts to assert the safe (fail-closed) outcome
instead of locking in the unsafe re-close.
Caught by gate review on #2470.
Motivation
Description
recloseDisallowedReopenIfNeededso an uncovered bounded timeline with no visiblereopenedevents no longer counts as proof the original reopen was superseded; only a fully-covered timeline with a different reopener or an observed different latest reopener denies the re-close (src/queue/processors.ts).unknownfallback when the login is null.test/unit/queue.test.ts).Testing
npx vitest run test/unit/queue.test.ts -t "one-shot reopen prevention"and targeted-tpatterns).npm run typecheckand it completed with no TypeScript errors.npm run test:cibut it could not finish in this environment due to external network/actionlint setup issues;npm audit --audit-level=moderatealso failed to run because the registry audit endpoint returned 403 from this environment.Codex Task