Skip to content

fix(queue): skip generate-tests on closed PRs with pr_not_open - #9341

Closed
joaovictor91123 wants to merge 1 commit into
JSONbored:mainfrom
joaovictor91123:fix/generate-tests-pr-not-open-9311-v2
Closed

fix(queue): skip generate-tests on closed PRs with pr_not_open#9341
joaovictor91123 wants to merge 1 commit into
JSONbored:mainfrom
joaovictor91123:fix/generate-tests-pr-not-open-9311-v2

Conversation

@joaovictor91123

Copy link
Copy Markdown
Contributor

Summary

Closes #9311

Scope

  • Focused queue-only change with Closes #9311.

Validation

  • Closed-PR skip tests for command + checkbox in test/unit/queue-5.test.ts.
  • Full CI (local Node v24; repo pins Node 22).

Safety

  • No secrets or UI changes.

UI Evidence

N/A.

Notes

Mirror maybeProcessPrPanelRetrigger's JSONbored#9020 guard on both the @Loopover generate-tests command and the PR-panel checkbox so post-merge clicks never spend AI generation or commit work.

Closes JSONbored#9311
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@codecov

codecov Bot commented Jul 27, 2026

Copy link
Copy Markdown

❌ 2 Tests Failed:

Tests completed Failed Passed Skipped
3933 2 3931 11
View the top 2 failed test(s) by shortest run time
test/unit/selfhost-pg-retention.test.ts > runRetentionPrune + processJob on the Postgres backend (#977) > processJob prune-retention deletes eligible rows and records a success audit event on Postgres
Stack Traces | 0.00737s run time
AssertionError: expected 3 to be +0 // Object.is equality

- Expected
+ Received

- 0
+ 3

 ❯ test/unit/selfhost-pg-retention.test.ts:119:44
test/unit/selfhost-pg-retention.test.ts > pruneExpiredRecords on the Postgres backend (#977) > deletes across multiple bounded batches and stops at the per-table cap, same as the SQLite path
Stack Traces | 0.0122s run time
AssertionError: expected +0 to be 4 // Object.is equality

- Expected
+ Received

- 4
+ 0

 ❯ test/unit/selfhost-pg-retention.test.ts:76:33

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 27, 2026
@loopover-orb

loopover-orb Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Caution

🛑 LoopOver review result - fixes required

Review updated: 2026-07-27 13:34:53 UTC

2 files · 1 AI reviewer · no blockers · CI failing · unstable

🛑 Suggested Action - Fix Blockers

Review summary
This PR adds a `pr.state !== "open"` guard to `maybeProcessGenerateTestsCommand` and `maybeProcessPrPanelGenerateTests`, mirroring the existing `pr_not_open` pattern already used by `maybeProcessPrPanelRetrigger` (#9020). The guard is placed before authorization/AI-generation work and records the skip via `recordGenerateTestsSkip`, closing #9311. Both call sites are covered by new tests in `queue-5.test.ts` that assert the model is never invoked and no comment is posted, which is the correct way to prove this path is actually exercised.

Nits — 3 non-blocking
  • nit: `src/queue/processors.ts` — confirm the guard's placement relative to the `cached_pr_missing` check in both functions is consistent (it appears to be, immediately after, per the diff) so ordering doesn't diverge between the two call sites over time.
  • The two new tests in `test/unit/queue-5.test.ts` are near-duplicates (command vs. checkbox variant) with the same title string — consider a shared helper to reduce duplication, though this is purely stylistic.
  • Consider extracting the `pr.state !== "open"` + `recordGenerateTestsSkip(..., "pr_not_open")` pair into a small shared helper since it's now duplicated in three call sites total (including the orb(review): panel re-run checkbox on a closed/merged PR does real work, then silently no-ops #9020 `maybeProcessPrPanelRetrigger` precedent), to avoid future drift if the skip reason or ordering ever needs to change.

CI checks failing

  • validate
  • validate-tests

Decision drivers

  • ✅ Code review — No blockers (1 reviewer)
  • ✅ Gate result — Passing (No configured blocker found.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ✅ Linked #9311, #9333
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (2 linked issues).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 130 registered-repo PR(s), 57 merged, 4 issue(s).
Contributor context ✅ Confirmed Gittensor contributor joaovictor91123; Gittensor profile; 130 PR(s), 4 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: moderate
Linked issue satisfaction

Addressed
The diff adds a pr.state !== "open" guard with a "pr_not_open" skip via recordGenerateTestsSkip to both maybeProcessGenerateTestsCommand and maybeProcessPrPanelGenerateTests, positioned right after the cached-PR-missing check and before authorization, matching the retrigger precedent, and adds closed-PR test cases in queue-5.test.ts for both the checkbox and text-command handlers asserting the AI

Review context
  • Author: joaovictor91123
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: Python, JavaScript, MDX, TypeScript, C++, CSS, Rust
  • Official Gittensor activity: 130 PR(s), 4 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Start here: Triage stale or unlinked PRs.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
🧪 Chat with LoopOver

Ask 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.

  • @loopover ask <question> answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat <question> answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover mention with a real question is routed to the closest matching read-only command automatically — no exact syntax required.

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.

  • Re-run LoopOver review

@loopover-orb

loopover-orb Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

LoopOver is closing this pull request on the maintainer's behalf (CI is failing (validate, validate-tests)). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed.

@loopover-orb loopover-orb Bot closed this Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

queue: generate-tests checkbox and text-command both missing the pr.state !== "open" guard #9020 added to their retrigger sibling

1 participant