queue: generate-tests checkbox and text-command both missing the pr.state !== "open" guard #9020 added to their retrigger sibling - #9399
Conversation
…tate !== "open" guard JSONbored#9020 added to their retrigger sibling Fixes JSONbored#9311
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Warning ⏸️ LoopOver review result - manual review recommendedReview updated: 2026-07-27 17:16:39 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. Decision record
🟩 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 #9399 +/- ##
==========================================
+ Coverage 75.46% 76.53% +1.07%
==========================================
Files 275 276 +1
Lines 58030 61438 +3408
Branches 6199 7432 +1233
==========================================
+ Hits 43790 47021 +3231
- Misses 13970 14032 +62
- Partials 270 385 +115
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Summary
maybeProcessPrPanelRetriggerinsrc/queue/processors.ts(~line 14016) has an explicitpr.state !== "open"guard, added for #9020 ("panel re-run checkbox on a closed/merged PRdoes real work, then silently no-ops"). Its doc comment explains why: the PR-panel comment is
deliberately preserved after merge/close, its checkboxes stay interactive on GitHub forever, and
without the guard a post-merge click would spend a real gate evaluation and live CI reads before
dying deep in the pipeline with no user-visible feedback.
Two structurally identical handlers never got the same guard:
maybeProcessPrPanelGenerateTests(~line 14175, the checkbox handler,#4589) — goesstraight from authorization → feature-flag check → mode check →
runE2eTestGenerationAndDeliver,with no PR-state check anywhere in the function. On a merged/closed PR whose checkbox is still
checkable, this spends a real AI test-generation call, and in
commitdelivery mode callscommitE2eTestToPrBranch(src/github/e2e-test-commit.ts:43), which only declines if the livehead SHA/ref no longer matches the cached PR — it does not check PR state, so it can
silently push a new commit onto an already-merged branch.
maybeProcessGenerateTestsCommand(~line 13466, the@loopover generate-teststext-commandtwin) has the identical gap: no
pr.state !== "open"check before authorization/generation.test/unit/queue-5.test.ts's"PR-panel generate-tests checkbox (#4589)"block(
seedCheckboxPr) hardcodesstate: "open"in every case — no test exercises a closed/merged PRfor either handler.
Deliverables
maybeProcessPrPanelGenerateTestsinsrc/queue/processors.tsgains thepr.state !== "open"guard with a"pr_not_open"skip outcome, mirroringmaybeProcessPrPanelRetrigger's orb(review): panel re-run checkbox on a closed/merged PR does real work, then silently no-ops #9020 fix exactly.maybeProcessGenerateTestsCommandinsrc/queue/processors.tsgains the identical guard.test/unit/queue-5.test.ts's generate-tests checkbox suite gains a case with a closed/mergedPR asserting the handler skips with
"pr_not_open"and never calls the AI generation path.maybeProcessGenerateTestsCommandgains the sameclosed/merged-PR skip assertion.
All four deliverables are required in this single PR.
Test plan
This repo enforces 99%+ Codecov patch coverage, branch-counted, on every changed line/branch in
src/**. Both new guards and their two new test cases above must be covered.Fixes #9311