Skip to content

t1406: Filter out approving reviews from quality-debt issue creation#3926

Merged
marcusquinn merged 3 commits intomarcusquinn:mainfrom
johnwaldo:bugfix/t1406-filter-approvals
Mar 9, 2026
Merged

t1406: Filter out approving reviews from quality-debt issue creation#3926
marcusquinn merged 3 commits intomarcusquinn:mainfrom
johnwaldo:bugfix/t1406-filter-approvals

Conversation

@johnwaldo
Copy link
Copy Markdown
Contributor

Summary

  • Replaces the weak body-length filter (> 100 chars) for APPROVED reviews with content analysis that detects actionable language
  • APPROVED reviews without suggestions, warnings, security concerns, or code fix proposals are now excluded from quality-debt issue creation
  • Non-APPROVED reviews (CHANGES_REQUESTED, COMMENTED, DISMISSED) are unaffected — always kept

Problem

scan-merged creates quality-debt issues for ALL review feedback, including purely positive APPROVED reviews from bots (CodeRabbit, Gemini). Example false positive: #3900 — Gemini's review was entirely positive ("well-executed and improve both documentation clarity") but generated a medium-severity quality-debt issue.

The previous filter (select(.state != "APPROVED" or (.body | length) > 100)) only skipped APPROVED reviews with short bodies (≤100 chars). Bot reviews typically have 500-2000 char bodies even when purely positive.

Fix

For APPROVED reviews, scan the body for actionable language patterns before creating a finding:

Kept (actionable): should, consider, instead, suggest, recommend, warning, caution, avoid, don't, do not, vulnerable, insecure, injection, xss, csrf, nit:, todo:, fixme, hardcoded, deprecated, race condition, deadlock, leak, overflow, workaround, hack, ```suggestion, ```diff

Removed from filter (ambiguous in positive context): bug, error, fix, patch, missing, incorrect, wrong, broken — these commonly appear in positive descriptions of what a PR accomplishes ("This PR fixes the bug", "corrects the error").

Testing

Verified with jq against 4 scenarios:

  1. Purely positive APPROVED review → filtered out (correct)
  2. APPROVED with actionable suggestion ("you should consider...") → kept (correct)
  3. CHANGES_REQUESTED review → always kept regardless of content (correct)
  4. APPROVED with security concern ("vulnerable to injection") → kept (correct)

ShellCheck clean (only SC1091 external source, pre-existing).

Closes #2958

…1406)

Replace the weak body-length filter (>100 chars) for APPROVED reviews
with content analysis that detects actionable language. APPROVED reviews
without suggestions, warnings, security concerns, or code fix proposals
are now excluded from quality-debt issue creation.

Actionable patterns kept: should, consider, instead, suggest, recommend,
warning, caution, avoid, don't, vulnerable, insecure, injection, xss,
csrf, nit:, todo:, fixme, hardcoded, deprecated, race condition,
deadlock, leak, overflow, workaround, hack, suggestion/diff blocks.

Ambiguous words removed from filter (common in positive descriptions):
bug, error, fix, patch, missing, incorrect, wrong, broken.

Closes marcusquinn#2958
@johnwaldo
Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 8, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refines the logic for creating quality-debt issues from pull request reviews. It introduces a more intelligent filtering mechanism for 'APPROVED' reviews, moving beyond a basic body length check to analyze review content for actionable language. This change aims to significantly reduce false positive quality-debt issues, particularly those generated by purely positive bot reviews, while ensuring that genuine feedback across all review states is captured.

Highlights

  • Refined 'APPROVED' Review Filtering: Implemented a sophisticated content analysis for 'APPROVED' reviews to identify actionable feedback, replacing the previous simple body-length filter.
  • Actionable Language Detection: Introduced a regex-based detection mechanism for specific keywords (e.g., 'should', 'consider', 'warning', 'vulnerable', 'nit:', '```suggestion') to determine if an 'APPROVED' review contains substantive feedback.
  • Reduced False Positives: Ensured that purely positive 'APPROVED' reviews, especially those from automated bots, no longer trigger the creation of quality-debt issues.
  • Unaffected Non-Approved Reviews: Maintained the existing behavior for 'CHANGES_REQUESTED', 'COMMENTED', and 'DISMISSED' reviews, which are always considered for quality-debt regardless of their content.
Changelog
  • .agents/scripts/quality-feedback-helper.sh
    • Modified the _scan_single_pr function to update the review filtering logic.
    • Replaced the select(.state != "APPROVED" or (.body | length) > 100) condition with a conditional if .state == "APPROVED" block.
    • Introduced a regular expression to check for actionable keywords within the review body for 'APPROVED' reviews.
    • Ensured that non-approved reviews are always processed.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 8, 2026

Important

Review skipped

Auto reviews are limited based on label configuration.

🚫 Review skipped — only excluded labels are configured. (1)
  • no-review

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: fd1b8852-a8d8-4792-b67c-64a1693b7f1d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 8, 2026

Warning

Rate limit exceeded

@johnwaldo has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 17 minutes and 38 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d55e486b-7a4f-400f-9003-23e364e28485

📥 Commits

Reviewing files that changed from the base of the PR and between f4a502c and 4cfc580.

📒 Files selected for processing (1)
  • .agents/scripts/quality-feedback-helper.sh
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link
Copy Markdown

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

Choose a reason for hiding this comment

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

Code Review

This is a great improvement for filtering quality-debt issues, moving from a simple length check to a more intelligent content analysis. The regex approach for detecting actionable feedback is solid. I've added a couple of suggestions to make the regular expressions even more robust to handle common variations like typos and extra whitespace.

- Match 'dont' (no apostrophe) via (don ?'?t|do not) group
- Allow whitespace between backticks and language identifier
  in code block detection (e.g., '``` suggestion')
@marcusquinn
Copy link
Copy Markdown
Owner

This PR is from an external contributor (@johnwaldo). Auto-merge is disabled for external PRs — a maintainer must review and merge manually.

@marcusquinn marcusquinn added the external-contributor PR from external contributor, requires maintainer review label Mar 8, 2026
@marcusquinn
Copy link
Copy Markdown
Owner

Framework Validation failed due to ShellCheck errors in .agents/scripts/quality-feedback-helper.sh:

  • Line 624: SC1073 - Couldn't parse brace group
  • Line 844: SC1089 - Parsing stopped (keyword not matched)
  • Line 1013: SC1056/SC1072 - Missing/mismatched }

Daily PR cap reached for aidevops today. Fix worker will be dispatched at next UTC day reset.

@marcusquinn
Copy link
Copy Markdown
Owner

Maintainer review of Gemini suggestions

Both Gemini Code Assist suggestions were valid and have been applied correctly across commits e122f69 and dfd1854:

  1. \bdon.t\b regex (line 725): Replaced with \b(don ?'?t|do not)\b — correctly matches don't, dont, don t, and do not. The original . wildcard was too broad. Verified with jq test cases.

  2. Code block whitespace (line 730): Added \s* between backticks and language identifier — correctly handles ```suggestion and ``` suggestion. Verified with jq test cases.

The initial application (e122f69) introduced ShellCheck parse errors due to single-quote escaping inside the jq heredoc. These were fixed in dfd1854 using the '"'"' shell idiom. ShellCheck now passes cleanly (only pre-existing SC1091 info).

Both review threads resolved. Removing needs-review-fixes label.

@marcusquinn
Copy link
Copy Markdown
Owner

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 9, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@marcusquinn
Copy link
Copy Markdown
Owner

Dispatching fix worker to address 2 unresolved bot review suggestions before merge.

  • Model: sonnet (anthropic/claude-sonnet-4-6)
  • Scope: Address unresolved inline review suggestions from bots on this PR
  • Attempt: 1 of 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external-contributor PR from external contributor, requires maintainer review needs-review-fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

t1406: quality-feedback-helper.sh: filter out approving reviews with no actionable findings

2 participants