fix(review): honor autoCloseExemptLogins in closeDraftDodgeAttemptIfBlocked - #9375
Conversation
Follows JSONbored#9276, which fixed 8 files / 12 cases and left these 4 files / 5 cases still red on main (and therefore red on every open PR). Each diagnosed to its introducing commit; two are real source gaps, two are stale sibling tests a deliberate behavior change never updated. SOURCE fixes: - selfhost/metrics.ts: register two counters emitted since JSONbored#9243 and JSONbored#9245 but never added to DEFAULT_METRIC_META, so renderMetrics() emitted them as bare undocumented samples with no HELP/TYPE — exactly what that drift guard exists to catch. Both commits even name the counter in their own body text; a pure registration miss, not a behavior decision. TEST fixes (source verified correct in both cases): - selfhost-pg-retention: the fake Postgres still matched the pre-JSONbored#9083 ctid semi-join, so every DELETE fell through to rowCount 0. JSONbored#9083 deliberately moved retention to an index-backed PK range delete with ORDER BY (the fix for prune-retention blowing its timeout and stalling permanently); it updated the SQLite twin but not the Postgres one. Regex now captures whichever key column is in play, keeping BOTH the mapped-PK and ctid-fallback paths exercised. - salvageability: JSONbored#9085 made an absent blocker confidence degrade to CONFIDENCE_WHEN_UNSTATED (0.5) instead of 1.0, so it is sub-floor against the 0.93 default and the low-confidence hold owns the case. It renamed both sibling assertions in rules.test.ts but missed this third consumption site. Both calls kept — they are the only coverage of the default-floor arm and the nullish-confidence arm respectively. - worker-entry-boundary: false positive, not a real dependency leak. The check grepped whole-file text, so JSONbored#9230's user-facing string "crossed the visual-diff threshold" failed a green tree over a sentence, in a file worker-reachable since JSONbored#4120 that imports none of these deps. Narrowed to scan module specifiers (reusing the file's own parseImportSpecifiers) — the only way a Node-only dep can actually reach the bundle. Added a discriminating test so it cannot pass vacuously; verified by injecting a real `import sharp` and confirming it fails, naming the file and specifier.
…locked closeDraftDodgeAttemptIfBlocked was the one remaining review-evasion auto-close guard that skipped isProtectedAutomationAuthor and isAutoCloseExempt, so authors on the operator allowlist or protected automation bots were still draft-dodge closed despite every sibling guard honoring those exemptions (JSONbored#6165 pattern). Closes JSONbored#9294
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9375 +/- ##
==========================================
+ Coverage 75.38% 75.52% +0.13%
==========================================
Files 275 277 +2
Lines 58023 58402 +379
Branches 6181 6320 +139
==========================================
+ Hits 43739 44106 +367
- Misses 14014 14017 +3
- Partials 270 279 +9
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-27 15:11:20 UTC
Review summary Nits — 3 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.
|
Summary
closeDraftDodgeAttemptIfBlockedwas the one remaining review-evasion auto-close guard that did not callisProtectedAutomationAuthororisAutoCloseExempt. Authors on the operator'sautoCloseExemptLoginsallowlist, or protected automation bots, were still draft-dodge closed even though every sibling guard honors those exemptions (#6165 pattern).Adds both exemption checks before the close decision, matching the other five guards in
src/queue/review-evasion.ts.Test plan
queue-lifecycle-guards.test.ts: integration regressions forautoCloseExemptLoginsanddependabot[bot]authorsreview-evasion-per-repo-admin.test.ts: directmaybeCloseDraftDodgeAttemptcoverage for both exemption paths with a gate block recordedCloses #9294