Skip to content

Collapse superseded Claude review comments as outdated#246

Merged
d-morrison merged 2 commits into
mainfrom
claude/awesome-meitner-sex27c
Jun 14, 2026
Merged

Collapse superseded Claude review comments as outdated#246
d-morrison merged 2 commits into
mainfrom
claude/awesome-meitner-sex27c

Conversation

@d-morrison

Copy link
Copy Markdown
Member

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 OUTDATED so 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

  1. use_sticky_comment: 'false' — fresh tracking comment per run.
  2. New "Collapse previous Claude review comments" step minimizes prior review comments via the GraphQL minimizeComment mutation (classifier: OUTDATED).

Distinguishing review comments from @claude task comments

Both 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's path is .github/workflows/claude-code-review.yml. This:

  • excludes @claude task comments (those link to claude.yml runs),
  • excludes non-Claude bots (codecov, pkgdown),
  • never collapses the current run's own fresh comment (run_id == github.run_id),
  • needs no fragile body-text matching.

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

claude added 2 commits June 14, 2026 00:23
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

codecov Bot commented Jun 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

@d-morrison d-morrison marked this pull request as ready for review June 14, 2026 00:56
@d-morrison d-morrison enabled auto-merge June 14, 2026 00:59
@d-morrison d-morrison disabled auto-merge June 14, 2026 00:59
@d-morrison d-morrison merged commit b304bab into main Jun 14, 2026
14 of 16 checks passed
@d-morrison d-morrison deleted the claude/awesome-meitner-sex27c branch June 14, 2026 00:59
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.

2 participants