feat: switch issue-comments fetch to GraphQL with isMinimized filter - #150
Merged
twistedmelonman merged 2 commits intoMay 2, 2026
Merged
Conversation
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>
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>
|
No blocking issues found. The GraphQL helper correctly reshapes PR comment nodes into the REST-compatible shape the downstream Python parser expects, the VERDICT: PASS |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Coordinating change to smartwatermelon/github-workflows#83 (tracking issue: #82). That upstream PR taught the CI
claude-blocking-reviewworkflow to call GraphQLminimizeComment(classifier: RESOLVED)on its own PASS comment after posting it, so PASS comments end up collapsed in the PR thread (audit trail preserved, visual noise reduced).However,
scripts/post-push-status.shwas still fetching issues/comments via the REST API, and the REST endpoint does not returnisMinimized— that field is GraphQL-only. The result: the scraper kept surfacing those minimized PASS comments asFINDINGlines, polluting the post-push loop with phantom findings.What changed
_fetch_issue_comments_gqlhelper that:pullRequest.comments(last: 100)query selectingbody,createdAt,isMinimized, andauthor { __typename, login }.--jqto filter out minimized comments (select(.isMinimized == false)) and reshape GraphQL nodes into the REST-compatible JSON shape (user.login,created_at,body,path,line) the existing python parser already expects.[bot]toBot-typename logins (GraphQL strips it), soBOT_PATTERN(claude\[bot\]|sentry\[bot\]|coderabbit\[bot\]) keeps matching.[]on any failure (matches_safe_api_arraysemantics)._safe_api_array "repos/.../issues/<N>/comments"call with the new helper.Why pulls/comments stays on REST
Pulls/comments are inline diff review comments — they're typically real findings (e.g., from sentry[bot]), they're not subject to the new minimization workflow, and the REST shape works fine. Switching that path too would be churn without benefit.
Test plan
bash -n scripts/post-push-status.sh— cleanshellcheck -S info scripts/post-push-status.sh scripts/tests/test-post-push-status.sh— zero findingsbash scripts/tests/test-post-push-status.sh— 17/17 pass (added 1 new assertion:assert_not_contains "minimized PASS comment dropped" "VERDICT: PASS"). The test mock now extracts--jqfrom the call's argv and pipes the raw GraphQL response through the real production filter viajq -c, so the test exercises the actual projection (Bot→<login>[bot]reshape + minimized drop) rather than baking that behavior into the fixtures.🤖 Generated with Claude Code