fix: review-agent dedup bot review bodies with inline comments#78134
Conversation
The comment analyzer flags review bodies and review threads independently. When an approved bot (e.g. CodeRabbit) submits a review with both a body and inline comments, both get flagged as separate needs_attention items. Claude addresses each independently, producing duplicate responses. Observed on openshift/hypershift#8280: CodeRabbit review #4146142149 had a body ("Actionable comments posted: 1") and one inline comment about trust bundle sync stalling. The analyzer returned both as separate items. Claude posted an inline reply to the thread at 11:04:10Z, then two issue comments at 11:04:20Z and 11:06:19Z — both "Re: #pullrequestreview-4146142149" with overlapping content. Root cause: analyze_review_bodies uses per-comment reply matching (checking if any bot comment references the review ID/URL). Since no bot comment had yet referenced review 4146142149, it was flagged. Meanwhile, analyze_review_threads independently flagged the same review's inline thread. Both items entered the needs_attention list. Fix: add comments { totalCount } to the reviews GraphQL query and skip approved bot review bodies when inline comments exist. Bot review bodies are machine-generated summaries of their inline comments (already handled by analyze_review_threads). Human review bodies are always kept since they often contain distinct feedback. Verified against PR openshift#8280: - CodeRabbit review 4146142149: SKIPPED (approved_bot, inline_count=1) - CodeRabbit review 4138831511: SKIPPED (approved_bot, inline_count=1) - csrwng review 4144456157: KEPT (human, inline_count=2) Co-Authored-By: Claude Opus 4.6 <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: openshift/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
WalkthroughA bash script is modified to expand a GraphQL query to fetch inline comment counts and add conditional logic that skips flagging review bodies when approved bots have corresponding inline comments, reducing duplicate handling. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 12✅ Passed checks (12 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
[REHEARSALNOTIFIER]
Prior to this PR being merged, you will need to either run and acknowledge or opt to skip these rehearsals. Interacting with pj-rehearseComment: Once you are satisfied with the results of the rehearsals, comment: |
|
/pj-rehearse skip |
|
@bryan-cox: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel. |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bryan-cox, csrwng The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@bryan-cox: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
…hift#78134) The comment analyzer flags review bodies and review threads independently. When an approved bot (e.g. CodeRabbit) submits a review with both a body and inline comments, both get flagged as separate needs_attention items. Claude addresses each independently, producing duplicate responses. Observed on openshift/hypershift#8280: CodeRabbit review #4146142149 had a body ("Actionable comments posted: 1") and one inline comment about trust bundle sync stalling. The analyzer returned both as separate items. Claude posted an inline reply to the thread at 11:04:10Z, then two issue comments at 11:04:20Z and 11:06:19Z — both "Re: #pullrequestreview-4146142149" with overlapping content. Root cause: analyze_review_bodies uses per-comment reply matching (checking if any bot comment references the review ID/URL). Since no bot comment had yet referenced review 4146142149, it was flagged. Meanwhile, analyze_review_threads independently flagged the same review's inline thread. Both items entered the needs_attention list. Fix: add comments { totalCount } to the reviews GraphQL query and skip approved bot review bodies when inline comments exist. Bot review bodies are machine-generated summaries of their inline comments (already handled by analyze_review_threads). Human review bodies are always kept since they often contain distinct feedback. Verified against PR openshift#8280: - CodeRabbit review 4146142149: SKIPPED (approved_bot, inline_count=1) - CodeRabbit review 4138831511: SKIPPED (approved_bot, inline_count=1) - csrwng review 4144456157: KEPT (human, inline_count=2) Co-authored-by: Claude Opus 4.6 <[email protected]>
…hift#78134) The comment analyzer flags review bodies and review threads independently. When an approved bot (e.g. CodeRabbit) submits a review with both a body and inline comments, both get flagged as separate needs_attention items. Claude addresses each independently, producing duplicate responses. Observed on openshift/hypershift#8280: CodeRabbit review #4146142149 had a body ("Actionable comments posted: 1") and one inline comment about trust bundle sync stalling. The analyzer returned both as separate items. Claude posted an inline reply to the thread at 11:04:10Z, then two issue comments at 11:04:20Z and 11:06:19Z — both "Re: #pullrequestreview-4146142149" with overlapping content. Root cause: analyze_review_bodies uses per-comment reply matching (checking if any bot comment references the review ID/URL). Since no bot comment had yet referenced review 4146142149, it was flagged. Meanwhile, analyze_review_threads independently flagged the same review's inline thread. Both items entered the needs_attention list. Fix: add comments { totalCount } to the reviews GraphQL query and skip approved bot review bodies when inline comments exist. Bot review bodies are machine-generated summaries of their inline comments (already handled by analyze_review_threads). Human review bodies are always kept since they often contain distinct feedback. Verified against PR openshift#8280: - CodeRabbit review 4146142149: SKIPPED (approved_bot, inline_count=1) - CodeRabbit review 4138831511: SKIPPED (approved_bot, inline_count=1) - csrwng review 4144456157: KEPT (human, inline_count=2) Co-authored-by: Claude Opus 4.6 <[email protected]>
…hift#78134) The comment analyzer flags review bodies and review threads independently. When an approved bot (e.g. CodeRabbit) submits a review with both a body and inline comments, both get flagged as separate needs_attention items. Claude addresses each independently, producing duplicate responses. Observed on openshift/hypershift#8280: CodeRabbit review #4146142149 had a body ("Actionable comments posted: 1") and one inline comment about trust bundle sync stalling. The analyzer returned both as separate items. Claude posted an inline reply to the thread at 11:04:10Z, then two issue comments at 11:04:20Z and 11:06:19Z — both "Re: #pullrequestreview-4146142149" with overlapping content. Root cause: analyze_review_bodies uses per-comment reply matching (checking if any bot comment references the review ID/URL). Since no bot comment had yet referenced review 4146142149, it was flagged. Meanwhile, analyze_review_threads independently flagged the same review's inline thread. Both items entered the needs_attention list. Fix: add comments { totalCount } to the reviews GraphQL query and skip approved bot review bodies when inline comments exist. Bot review bodies are machine-generated summaries of their inline comments (already handled by analyze_review_threads). Human review bodies are always kept since they often contain distinct feedback. Verified against PR openshift#8280: - CodeRabbit review 4146142149: SKIPPED (approved_bot, inline_count=1) - CodeRabbit review 4138831511: SKIPPED (approved_bot, inline_count=1) - csrwng review 4144456157: KEPT (human, inline_count=2) Co-authored-by: Claude Opus 4.6 <[email protected]>
Summary
analyze_review_threadscomments(first: 0) { totalCount }to the reviews GraphQL query to check for inline comment existenceProblem
The comment analyzer has three independent functions:
analyze_review_threads,analyze_review_bodies, andanalyze_issue_comments. When a bot like CodeRabbit submits a review with both a body ("Actionable comments posted: 1") and inline code comments, both get flagged as separateneeds_attentionitems. Claude addresses each independently, producing duplicate responses.Observed on openshift/hypershift#8280:
CodeRabbit review
#4146142149had a body and one inline comment about trust bundle sync stalling. The analyzer flagged both. Claude posted:Fix
Skip approved bot review bodies when
totalCount > 0inline comments exist. Bot review bodies are machine-generated summaries of their inline comments. Human review bodies are always kept since they often contain distinct architectural feedback.Verified against PR #8280 data:
Test plan
🤖 Generated with Claude Code
Summary by CodeRabbit