Skip to content

fix(review): persist a manual retrigger's forceAiReview intent across a CI-pending defer - #7680

Merged
JSONbored merged 1 commit into
mainfrom
fix/pr-panel-retrigger-force-review
Jul 21, 2026
Merged

fix(review): persist a manual retrigger's forceAiReview intent across a CI-pending defer#7680
JSONbored merged 1 commit into
mainfrom
fix/pr-panel-retrigger-force-review

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

  • Checking "Re-run LoopOver review" while CI is still pending for the current head SHA lost the forceAiReview intent entirely: prReadyForReview would defer, the retrigger handler recorded the defer and returned, and the eventual natural re-evaluation once CI settled had no idea a manual retrigger was pending — a frozen or one-shot-cadence PR with a degraded cached review kept showing stale content forever.
  • Persists a one-shot marker keyed by (repoFullName, prNumber, headSha) in the existing transient KV cache (getTransientKey/putTransientKey, same store used elsewhere in this file), consumed by whichever natural re-evaluation path (reReviewStoredPullRequest or handlePullRequestWebhookEvent) reaches this PR next once CI settles — threading forceAiReview: true into that pass exactly like the retrigger handler's own immediate-readiness path already does.
  • prReadyForReview's own CI-wait/staleness-cap/dirty-base internals are completely untouched — this only reads its existing return value at the two call sites.

Closes #7626

Test plan

  • npx vitest run test/unit/pr-panel-retrigger-pending-force-review.test.ts — 7/7 passing, covering: deferred retrigger forces a fresh review once CI settles, immediate-readiness path unaffected, new commit doesn't inherit an old marker, both natural re-evaluation entry points consume the marker, storage-unavailable fail-open, fallback for an adapter with no delete method
  • Broader regression sweep across every test file touching the three modified functions (ci-completion-fork-resume, queue, queue-2/3/4) — 549/549 passing
  • Coverage scoped to the diff: 100% of changed lines and branches covered (verified via lcov DA/BRDA against the diff hunks)
  • npx tsc --noEmit clean
  • npm audit --audit-level=moderate clean

… a CI-pending defer

Checking "Re-run LoopOver review" while CI is still pending for the current head
SHA used to lose the forceAiReview intent entirely: prReadyForReview would defer,
the retrigger handler recorded the defer and returned, and the eventual natural
re-evaluation once CI settled had no idea a manual retrigger was pending, so a
frozen or one-shot-cadence PR with a degraded cached review kept showing stale
content forever.

Persists a one-shot marker keyed by (repoFullName, prNumber, headSha) in the
existing transient KV cache, consumed by whichever natural re-evaluation path
(reReviewStoredPullRequest or handlePullRequestWebhookEvent) reaches this PR
next once CI settles, threading forceAiReview: true into that pass exactly like
the retrigger handler's own immediate-readiness path already does.

Closes #7626
@superagent-security

Copy link
Copy Markdown
Contributor

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

@JSONbored JSONbored self-assigned this Jul 21, 2026
@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.50%. Comparing base (22c2c4a) to head (c6927f4).
⚠️ Report is 6 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7680      +/-   ##
==========================================
- Coverage   88.51%   88.50%   -0.01%     
==========================================
  Files         724      724              
  Lines       76001    76019      +18     
  Branches    22619    22624       +5     
==========================================
+ Hits        67272    67281       +9     
- Misses       7681     7687       +6     
- Partials     1048     1051       +3     
Flag Coverage Δ
shard-1 36.41% <42.10%> (+0.69%) ⬆️
shard-2 36.01% <52.63%> (+3.02%) ⬆️
shard-3 31.19% <36.84%> (+2.55%) ⬆️
shard-4 38.88% <31.57%> (-1.74%) ⬇️
shard-5 32.51% <100.00%> (-1.50%) ⬇️
shard-6 33.52% <42.10%> (-2.51%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/queue/processors.ts 95.70% <100.00%> (+0.09%) ⬆️

... and 2 files with indirect coverage changes

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

loopover-orb Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Important

🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪

🔍 LoopOver is reviewing…

AI analysis is in progress. This comment will update when the review is complete.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed · 🟪 Reviewing

@JSONbored
JSONbored merged commit 8bcf5be into main Jul 21, 2026
17 checks passed
@JSONbored
JSONbored deleted the fix/pr-panel-retrigger-force-review branch July 21, 2026 07:47
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.

fix(review): a manual re-run request loses its forceAiReview intent when deferred for pending CI

1 participant