fix(review): persist a manual retrigger's forceAiReview intent across a CI-pending defer - #7680
Merged
Merged
Conversation
… 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
Contributor
|
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 #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
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
forceAiReviewintent entirely:prReadyForReviewwould 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.(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 (reReviewStoredPullRequestorhandlePullRequestWebhookEvent) reaches this PR next once CI settles — threadingforceAiReview: trueinto 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 methodci-completion-fork-resume,queue,queue-2/3/4) — 549/549 passingDA/BRDAagainst the diff hunks)npx tsc --noEmitcleannpm audit --audit-level=moderateclean