Skip to content

fix(review): pr comments report zero findings for orchestrated reviews #657

Closed

Description

@dan-petty

Summary

Found in the release/v0.2.23 review (line numbers at 7fdaa9d).

devops review pr <n> --post always posts "Zero findings identified.", even when review.md lists a verified HIGH finding. The comment is 153 characters and contains none of the findings.

Two related symptoms:

  • The FINDINGS_TOTAL metric is never emitted.
  • The comment's "Analyzers:" line lists tools found on PATH or implied by file suffixes, not the analyzers that actually ran. It still claims "Gitleaks" under --no-static-scan or --dry-run.

Root Cause

  1. _make_review_clients always builds an LLMClient, so reviews take the orchestrator path. That path returns the consolidated Markdown report as a plain string (src/devops_cli/ai/review/runner.py:2027-2029).
  2. _has_review_findings (runner.py:507-520) only recognises ReviewResult objects or JSON blocks with a findings key. format_pr_review_comment therefore always takes the zero-findings branch (:622-625).
  3. _record_review_metrics counts only ReviewResult findings, so the orchestrated path emits no findings metric.
  4. The analyzer list (runner.py:545-564) is inferred from binaries on PATH and file suffixes, not from the static-scan stage results.
  5. tests/test_review_pr_post.py only feeds mocked ReviewResult objects, so it never exercises the real report shape.

Remediation Plan

  1. Have the orchestrated path hand the structured findings to the PR comment formatter and to the metrics recorder alongside the Markdown report.
  2. Build the "Analyzers:" line from the stages and scanners that actually ran.
  3. Add tests that post from real _build_consolidated_markdown_report output:
    • a verified HIGH finding appears in the comment;
    • FINDINGS_TOTAL is recorded;
    • --no-static-scan lists no scanners.

Activity

  1. added this to the v0.2.23 milestone on Sep 28, 2026
  2. added
    type/bug
    scope/review
    priority/p1-high
    on Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority/p1-highscope/reviewtype/bug

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions