test(review): cover extractReviewSummary suggestions-merge and sole-reviewer-consensus branches#6673
Conversation
…-reviewer-consensus branches (JSONbored#6634) `extractReviewSummary` (src/review/unified-comment.ts) had two untested branches: its `suggestions`-into-`nits` merge (line 136) was never exercised because the shared test helper always defaulted `suggestions: []`, and its documented "a sole reviewer's blocker still counts as consensus" rule (`valid.length === 1 && reviewersWithBlockers === 1`, line 140) was reachable but never asserted on `.consensusBlocker`. Adds three cases to test/unit/unified-comment.test.ts (test-only, no production change): a reviewer's non-empty `suggestions` array is merged into the output `nits`; a sole valid reviewer reporting a blocker yields `consensusBlocker: true` (and a blocked status); and `consensusBlocker` stays `false` when no reviewer reports a blocker. Closes JSONbored#6634
|
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 #6673 +/- ##
==========================================
- Coverage 93.65% 89.99% -3.66%
==========================================
Files 681 681
Lines 68099 68108 +9
Branches 18699 18701 +2
==========================================
- Hits 63777 61296 -2481
- Misses 3347 5288 +1941
- Partials 975 1524 +549
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-16 18:34:37 UTC
Review summary Nits — 3 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
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.
|
What
extractReviewSummary(src/review/unified-comment.ts, lines 130-143) had two untested branches:suggestionsarray into the renderednitslist — never exercised, because the shared test helper always defaultedsuggestions: [].valid.length === 1 && reviewersWithBlockers === 1) was reachable but never asserted on.consensusBlocker.Resolves #6634. Test-only — no production code change (
extractReviewSummary's logic is not in question, only its coverage).Tests added (
test/unit/unified-comment.test.ts)suggestionsarray is merged into the outputnits(alongside an explicit nit).consensusBlocker: true(and ablockedstatus).consensusBlockerstaysfalsewhen no reviewer reports a blocker.Locally green:
npx vitest run test/unit/unified-comment.test.ts→ 101/101. Since there's nosrc/**change, the codecov patch gate has no diff to score; these tests close the coverage gap on the already-shipped branches.