Skip to content

feat: minimize PASS review comments via GraphQL - #83

Merged
twistedmelonman merged 1 commit into
mainfrom
claude/feat-minimize-pass-comments-20260501
May 2, 2026
Merged

feat: minimize PASS review comments via GraphQL#83
twistedmelonman merged 1 commit into
mainfrom
claude/feat-minimize-pass-comments-20260501

Conversation

@twistedmelonman

Copy link
Copy Markdown
Member

Problem

The CI-side claude-blocking-review workflow posts a PR comment for every review — PASS or BLOCK. The local post-push-status.sh tool scrapes bot comments to surface unresolved findings but has no way to distinguish PASS verdicts from BLOCK findings on its own. Result: every PASS comment gets surfaced as a phantom "finding" in the post-push loop, drowning out real signals.

Fix

Add a new workflow step IMMEDIATELY AFTER "Check review verdict". When the verdict is PASS, the step locates the just-posted claude-blocking-review comment for the current SHA (matched via the <!-- claude-blocking-review sha=<HEAD_SHA> ... --> marker) and minimizes it via GraphQL minimizeComment(classifier: RESOLVED).

BLOCK comments are NOT minimized — humans need to act on them. The audit trail is preserved either way: the comment body stays in the PR thread under the standard "Resolved" disclosure.

Design choices:

  • if: always() so the step runs even after the verdict-check step exits 0 normally.
  • All non-PASS / no-verdict / no-comment paths short-circuit cleanly with exit 0 (non-fatal).
  • [skip-claude-review] escape hatch is honored (no comment to minimize when the bot didn't run).
  • classifier: RESOLVED is the right semantics — the verdict is settled, not stale (which would be OUTDATED).
  • Pattern mirrors the existing "Minimize prior review comments" step at lines 283-335 (same gh api graphql idiom, same -f / -F flags, same --jq filter style).

Coordinating work

A separate PR in claude-config will teach post-push-status.sh to skip minimized comments via the GraphQL isMinimized field. That work is out of scope for this PR — this PR is purely the workflow-side change.

CI behavior on this PR

The CI claude-review will SKIP automatically due to the workflow-self-modification protection (lines 154-175 in this same workflow file): the anthropics/claude-code-action refuses to run against a PR that modifies its own workflow file. That's by design and is documented in those lines. Local pre-commit and pre-push reviewers ran cleanly (code-reviewer + adversarial-reviewer + full-diff codebase review all PASS).

Test plan

  • yamllint .github/workflows/claude-blocking-review.yml — only pre-existing line-length warnings on lines that mirror the existing pattern; no errors
  • Visual diff matches the template in the task brief
  • Local pre-commit reviewers PASS
  • Local pre-push full-diff + codebase review PASS
  • On the next non-workflow PR after merge, watch for a PASS comment getting collapsed in the PR conversation

After the verdict check, when verdict is PASS, locate the just-posted
claude-blocking-review comment for the current SHA and minimize it as
RESOLVED. BLOCK comments stay un-minimized — humans need to see them.

Why: downstream tooling (post-push-status.sh) scrapes bot comments to
surface unresolved findings, but it has no way to distinguish PASS
from BLOCK on its own. Minimizing PASS comments lets the scraper
skip them via the GraphQL isMinimized field (coordinating PR in
claude-config). The comment body is preserved in the PR thread under
the standard "Resolved" disclosure, so the audit trail is intact.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@twistedmelonman
twistedmelonman merged commit 16020f4 into main May 2, 2026
3 checks passed
@twistedmelonman
twistedmelonman deleted the claude/feat-minimize-pass-comments-20260501 branch May 2, 2026 00:09
twistedmelonman added a commit to twistedmelonman/claude-config that referenced this pull request May 2, 2026
…150)

* feat: switch issue-comments fetch to GraphQL with isMinimized filter

Coordinating change to smartwatermelon/github-workflows#83, which now
minimizes PASS review comments via GraphQL minimizeComment(RESOLVED).
The REST issues/comments endpoint does not return isMinimized, so the
scraper still treated those minimized PASS comments as unresolved
findings.

Switch the issues/comments fetch to GraphQL with `isMinimized` and
filter out minimized comments via jq before the existing python parser
sees them. The jq projection reshapes GraphQL nodes into the REST-
compatible JSON shape the parser already expects, so no parser changes
are needed. Pulls/comments (inline review comments) stay on REST —
they're typically real findings and don't have the minimization
pollution issue.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* test: update post-push-status test mock for GraphQL issue-comments fetch

The previous commit switched issue-comments fetch from REST to GraphQL,
but the test mock only routed REST `issues/<N>/comments` patterns. The
new GraphQL call fell through to the UNEXPECTED-call fallback, causing
`[]` to be returned and the existing SQL-injection assertion to fail.

Update the mock to detect the GraphQL comments query (by the `comments(last:`
selector in a `pullRequest(number:` operation), return raw GraphQL-shaped
JSON for PRs 42, 43, and 99, and apply the actual `--jq` filter from the
call's args to the raw response. Applying the real production projection
in the mock means the test exercises the real Bot→`<login>[bot]` login
reconstruction and the `isMinimized==false` filter, rather than baking
that behavior into the mock fixtures.

Add a new assertion that the minimized claude[bot] PASS comment in PR 42
is dropped — this is the headline behavior of the GraphQL switch and
needs explicit coverage.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Code Bot <claude-code@smartwatermelon.github>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant