Skip to content

Exclude PR author's own reviews from review count - #248

Merged
st3penta merged 1 commit into
conforma:mainfrom
st3penta:exclude-pr-author-reviews
Jul 1, 2026
Merged

st3penta merged 1 commit into
conforma:mainfrom
st3penta:exclude-pr-author-reviews

Conversation

@st3penta

@st3penta st3penta commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

PR authors responding to bot feedback (e.g. fullsend, coderabbit) generate
COMMENTED reviews that get counted as peer reviews. A PR with only bot
reviews and author self-comments appears as fully reviewed on the dashboard
when no team member has actually looked at it.

Add Login to the review author GraphQL query and skip reviews where the
reviewer matches the PR author.

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com

PR authors responding to bot feedback (e.g. fullsend, coderabbit) generate
COMMENTED reviews that were counted as peer reviews. A PR with only bot
reviews and author self-comments appeared as fully reviewed on the dashboard
when no team member had actually looked at it.

Add Login to the review author GraphQL query and skip reviews where the
reviewer matches the PR author.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

extractReviews in internal/github/query.go gains a second skip condition that discards reviews where the reviewer's login matches the PR author's login. The GraphQL query struct is updated to fetch Login on review authors. Tests update makeReviewNode to carry a login parameter and add two new test functions covering the PR-author exclusion scenarios.

Changes

Self-review exclusion in extractReviews

Layer / File(s) Summary
GraphQL struct and extractReviews skip condition
internal/github/query.go
Adds Login string field to the Reviews.Nodes[].Author struct in the GraphQL query and adds a skip guard in extractReviews that excludes reviews where the reviewer login matches the PR author login.
Test helper update and new exclusion test cases
internal/github/query_test.go
Refactors makeReviewNode to accept an explicit login argument; updates all existing call sites to pass login values; adds TestExtractReviewsExcludesPRAuthor and TestExtractReviewsAuthorAndBotsMixed to verify self-review and mixed bot/author exclusion.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Exclude PR author's own reviews from review count' directly describes the main change in the changeset, which filters out self-reviews from PR review counts.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The PR description clearly explains the problem (author self-reviews counted as peer reviews), the root cause (bot feedback responses), and the proposed solution (excluding author reviews).

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@st3penta
st3penta merged commit f645d5e into conforma:main Jul 1, 2026
4 checks passed
@st3penta
st3penta deleted the exclude-pr-author-reviews branch July 1, 2026 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants