Repository navigation
Conversation
…shold A review filtered down to nothing posted only "Looks good to me", which reads as a clean pass even though the agent found issues the configured threshold withheld. Append a disclosure naming the threshold and the number of findings that were not posted. The counts come from the existing filter, so the disclosed number cannot disagree with what was posted. A review with nothing filtered is left unchanged. Signed-off-by: Benjamin Kapner <bkapner@redhat.com>
PR Summary by QodoDisclose findings omitted by the severity threshold
AI Description
Diagram
High-Level Assessment
Files changed (3)
|
|
🤖 Finished Review · ⏭️ Skipped (PR #1826 is already closed) · Started 1:27 PM UTC · Completed 1:27 PM UTC Commit: Effort: high |
|
Review skipped — this PR is already closed. The Posted by fullsend pre-review check |
Code Review by Qodo
1. Threshold tests can miss wrong findings
|
| run_body_count_test "severity-threshold-discloses-fully-filtered" \ | ||
| "${THRESHOLD_ALL_HIDDEN}" \ | ||
| 'No findings at or above `high` severity; 2 lower-severity finding(s) were not posted.' "1" "high" |
There was a problem hiding this comment.
1. Threshold tests can miss wrong findings 🐞 Bug ⚙ Maintainability
run_body_count_test only counts the expected text in .body, so the two new threshold cases never inspect the posted action or findings payload. A regression that leaves a blocking request-changes action or drops or retains the wrong findings would still pass these tests as long as the disclosure sentence remains.
Agent Prompt
### Issue description
The new severity-threshold integration tests validate only that the disclosure text appears in the posted body. They do not verify the structured result that the post script sends, so incorrect action downgrades or finding filtering could pass unnoticed.
### Fix Focus Areas
- scripts/post-review-test.sh[1609-1664]
- scripts/post-review-test.sh[1718-1725]
### Recommended Fix
Extend the helper or add a dedicated assertion helper that reads the captured posted JSON and checks the fully filtered case has action `comment` with no `findings` key, while the partially filtered case retains only the high-severity finding. Keep the existing body assertions so the disclosure wording and structured payload are both covered.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Closes #1800.
Problem
When
REVIEW_FINDING_SEVERITY_THRESHOLDfilters away every finding, the posted review reads only "Looks good to me". To a PR author that is indistinguishable from a clean pass, even though the agent reported findings that the configured threshold withheld.Change
post-reviewalready filters the structuredfindingsarray as defense-in-depth, and already computesoriginal_countandfiltered_count. This appends a disclosure to the review body when, and only when, that filter actually dropped something:No findings at or above `high` severity; 13 lower-severity finding(s) were not posted.2 finding(s) below the `high` severity threshold were not posted.Both counts are derived from the same filter that drops the findings, so the disclosed number cannot disagree with what was posted. The body-append uses the existing
jq '.body = (.body + $notice)'idiom already used for the label and footer notices.Why the post-script and not the template
The "Looks good to me" body comes from the agent, via the template in
skills/pr-review/SKILL.md. The agent cannot know what the post-script will filter, because filtering runs afterwards. Putting the disclosure in the post-script is what makes the count consistent with what was actually posted, which is the issue's third acceptance criterion. It also keeps this change out ofSKILL.md, which #1813 is scheduled to rewrite.Acceptance criteria
highand only medium/low/info findings, the body states the threshold and the count of omitted findings.findingsarray.Tests
Three cases added to
scripts/post-review-test.sh, using the existingrun_body_count_testhelper, which asserts against the body actually handed to the forge:severity-threshold-discloses-fully-filteredseverity-threshold-discloses-partially-filteredseverity-threshold-silent-when-nothing-filteredrun_body_count_testgained an optional 5th parameter for the threshold, defaulting tolowso every existing caller is unaffected.bash scripts/post-review-test.shpasses (444 tests).make check-bundleandmake lintare clean, andpre-commit runpasses on the changed files. The generatedpost-review.shwas produced bymake script-build, not edited directly.Notes for review
<details>list of omitted findings mentioned in the issue is deliberately left out to keep the change minimal. Happy to add it as a follow-up if wanted.post-review.src.shto test against directly. Pointers welcome if there is one I missed.