Skip to content

fix(review): avoid repeat PR findings#6

Merged
ephor merged 1 commit into
mainfrom
fix/review-discussion-dedup
Jul 2, 2026
Merged

fix(review): avoid repeat PR findings#6
ephor merged 1 commit into
mainfrom
fix/review-discussion-dedup

Conversation

@ephor

@ephor ephor commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • fetch existing PR review summaries and inline discussions before review
  • inject prior discussion as untrusted context so repeat findings are avoided
  • suppress duplicate inline comments by finding fingerprint

Tests

  • npm run typecheck
  • npm test -- src/lib/pr-discussion.test.ts src/lib/post-review.test.ts src/workflows/tests/review-pr.test.ts

@mimir-code-assist

Copy link
Copy Markdown

Mimir review — 🟡 Comments

Well-structured PR that adds fingerprint-based duplicate inline comment suppression across review cycles. The core logic is clean, error-handling is thorough (graceful degradation when discussion fetch fails), and tests cover the key paths including legacy unmarked comments. Two minor issues worth fixing: the pagination fallback can silently miss comments on very large PRs, and human reply text in the LLM prompt creates a prompt-injection surface that could be better mitigated. Two nits for transparency and testability.

Findings: 0 critical · 0 major · 2 minor · 2 nit (suppressed)

General findings

  • [minor] Unpaginated fallback may miss comments beyond page 1 (src/lib/pr-discussion.ts) — paginateOrFetch only falls back to fetching the first page (per_page=100) when Octokit lacks built-in pagination. PRs with more than 100 review comments or 100 issue comments would have incomplete dedup data, causing the suppression logic to miss earlier findings and potentially post duplicate inline comments. In practice, Octokit's paginate plugin is usually available (it's bundled with @octokit/rest), but the fallback silently degrades rather than attempting multi-page fetch.

💰 Review cost: $0.0104 — primary deepseek/deepseek-v4-flash $0.0104

Comment thread src/lib/pr-discussion.ts

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a mechanism to suppress duplicate inline comments by fetching, parsing, and tracking existing PR review discussions. It adds fingerprinting logic for findings, integrates this context into the review workflow, and includes comprehensive tests. The review feedback highlights opportunities to improve robustness and efficiency, specifically by using a lazy regex match to handle titles with asterisks, wrapping decodeURIComponent in a try-catch block to prevent potential URIError crashes, and refactoring redundant map lookups in the discussion parser.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/lib/pr-discussion.ts
Comment thread src/lib/pr-discussion.ts
Comment thread src/lib/pr-discussion.ts
@ephor ephor merged commit f63ce82 into main Jul 2, 2026
2 checks passed
@ephor ephor deleted the fix/review-discussion-dedup branch July 2, 2026 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant