fix(queue): terminalize active-review tracking in synchronize-amendment close guard - #8044
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-22 15:06:22 UTC
Review summary Nits — 2 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 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 LoopOver, 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 #8044 +/- ##
=======================================
Coverage ? 94.59%
=======================================
Files ? 1
Lines ? 259
Branches ? 116
=======================================
Hits ? 245
Misses ? 3
Partials ? 11
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Summary
src/queue/review-evasion.tshas six close-enforcement guards. Four of them —closeReviewEvasionSelfCloseIfReviewed,closeReviewEvasionDraftConversionIfReviewed,closeRepeatedDraftCyclingIfDetected, andcloseDraftPrIfPolicyEnabled— callterminalizeActiveReviewTracking(env, repoFullName, pr.number, { onlyIfHeadSha: pr.headSha })right after a successful enforcement close, so the PR's active-review tracking row is marked
terminal rather than left dangling.
closeSynchronizeAmendmentIfPolicyEnabled(maybeCloseSynchronizeAmendment, the#synchronize-close-policyguard) closed the PR and recorded its audit event but never madethat cleanup call — leaving the active-review row for the PR's reviewed head dangling. This is
the guard most likely to fire while a review is still actively tracked (it fires on the
author pushing an additional commit, "regardless of what CI/review state that push
interrupts"), yet it was the one guard skipping the cleanup. The skip had no justification
anywhere in the file, unlike the separately-documented, intentional omission of the
moderation-strike call for this guard (which is left untouched).
What changed
src/queue/review-evasion.ts: added the identicalawait terminalizeActiveReviewTracking(env, repoFullName, pr.number, { onlyIfHeadSha: pr.headSha }).catch(() => undefined);call (with the same
v8 ignore nextbest-effort annotation the four siblings use) as thefinal step of
closeSynchronizeAmendmentIfPolicyEnabled, in the same position relative tothe close/audit-event calls as its siblings. No other behavior changed; the intentional
moderation-strike omission is unaffected.
test/unit/queue-lifecycle-guards.test.ts: added a test in the existingone-shot synchronize-amendment close policy (#synchronize-close-policy)block that startsactive-review tracking on the PR's head, drives a synchronize-amendment enforcement close,
and asserts the tracking row is left terminal (no dangling active row) — mirroring how the
self-close / draft-conversion / draft-cycling / draft-PR sibling tests assert their own
terminalizeActiveReviewTrackingcall.Tests
test/unit/queue-lifecycle-guards.test.tssuite: 224 passed (includes the new test).hasActiveReviewForHeadSha(...)istruebefore the close andfalseafter — the row is terminalized exactly as with the four sibling guards.
Verified locally
npm run typecheck— clean.npx turbo run build --filter=@loopover/engine— clean (fresh--forcerun).git diff --check origin/main— clean.origin/main;git merge-base --is-ancestor origin/main HEAD— true.cleanup annotated
v8 ignore next(matching all four siblings); no added line is uncovered,100% patch coverage on the diff.
Closes #8015