Collapse superseded Claude review comments as outdated#246
Merged
Conversation
Disable the sticky review comment so each run posts a fresh, separately notified comment, then fold the prior review comments up as OUTDATED via the minimizeComment GraphQL mutation so only the latest stays expanded. Review comments are distinguished from `@claude` task comments (both authored by claude[bot]) by the workflow run each comment links to: only comments whose linked run path is this workflow file are collapsed.
Codecov Report✅ All modified and coverable lines are covered by tests. |
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.
What
Changes the Claude Code Review workflow so that each run posts a fresh review comment (instead of editing one sticky comment in place), and then collapses the previous review comments as
OUTDATEDso only the latest stays expanded.Why
Previously
use_sticky_comment: 'true'meant each run silently edited a single comment near the top of the PR. The review for a new commit didn't surface as new PR activity and generated little/no notification — easy to miss (this is exactly what happened on #241, where the latest commit was reviewed but the result was only folded into the original top-of-PR comment).Switching to fresh-comment-per-run restores per-push notifications and a visible review history; collapsing the older ones keeps the thread from accumulating clutter.
How
use_sticky_comment: 'false'— fresh tracking comment per run.minimizeCommentmutation (classifier: OUTDATED).Distinguishing review comments from
@claudetask commentsBoth are authored by
claude[bot], so author alone can't tell them apart. The step keys off the workflow run each comment links to: every tracking comment ends its header with[View job](…/actions/runs/<run_id>), and a comment belongs to this workflow iff that run'spathis.github/workflows/claude-code-review.yml. This:@claudetask comments (those link toclaude.ymlruns),run_id == github.run_id),The step is gated on
steps.claude-review.outcome == 'success'so a failed review never collapses the last good one, and the mutation is idempotent (re-minimizing is a no-op, guarded with|| true).Migration note
The first run after this merges will also collapse the existing sticky comment on any open PR (it links to a review-workflow run), leaving the new fresh comment as the only expanded review — a clean transition.
https://claude.ai/code/session_01SGATUaqXVJ8w11NxYoFhVq
Generated by Claude Code