Skip to content

CI: claude-code-review.yml: add missing --comment flag - #3

Open
jnasbyupgrade wants to merge 3 commits into
mainfrom
fix-claude-review-comment-flag
Open

CI: claude-code-review.yml: add missing --comment flag#3
jnasbyupgrade wants to merge 3 commits into
mainfrom
fix-claude-review-comment-flag

Conversation

@jnasbyupgrade

@jnasbyupgrade jnasbyupgrade commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Same issue as claude-code-review.yml: add missing --comment flag pgxntool-test#61 and claude-code-review.yml: add missing --comment flag pgxntool#84: the /code-review plugin only prints its findings to the job log by default; it needs --comment to post a PR comment. This workflow's prompt was missing that flag, so every automated review has run (real API cost, correct analysis) but never posted anything visible to the PR.
  • Root cause confirmed on the pgxntool-test side by temporarily enabling show_full_output on a canary PR with a deliberately injected bug: the review agent found the bug correctly, but its own final line read "No --comment argument was provided, so no GitHub comments were posted." Adding --comment fixed it there; this is the same one-line fix ported here unchanged.
  • Also fixes the fork-checkout step, which redirected origin to the PR's fork via repository:/ref: + allow-unsafe-pr-checkout: true. That breaks anthropics/claude-code-action's own internal git fetch origin pull/<N>/head (a ref that only exists on the base repo) with "couldn't find remote ref pull//head" -- same bug root-caused and fixed in CI: fix claude-code-review by removing the fork-checkout step entirely extension_tools#28. Fixed the same way: drop the override, just check out the base branch.
  • Also adds track_progress: true (live-updating tracking comment instead of a silent run until completion -- cat_tools PR #69) and a claude-debug PR label toggle (skips the cost gate + turns on show_full_output for a fast debug iteration -- cat_tools PR #64).
  • Also adds permissions: actions: write (there's no narrower "cache-write-only" scope; without it claude-code-action's own setup step silently fails to save its Actions cache every run -- cat_tools PR #47) and claude_args: --allowedTools mcp__github_inline_comment__create_inline_comment (agent-mode claude-code-action only starts the inline-comment MCP server if this is listed here, not from the plugin's own frontmatter; without it every review silently falls back to one consolidated comment instead of real inline comments -- cat_tools PR #62).
  • All five follow-on fixes were ported from cat_tools' current, live claude-code-review.yml, which already has all of them.

Test plan

  • This change only affects a GitHub Actions workflow file.
  • The --comment fix was live-verified against pgxntool-test's identical workflow before being ported here unchanged.
  • Per the pull_request_target-workflows-can't-verify-themselves rule: this PR's own claude-review check still runs the OLD workflow off main and can't demonstrate any of these fixes on itself. Verification (fork-checkout no longer errors, tracking comment appears, claude-debug label works, cache-write warning gone, inline comments post) only happens on a subsequent PR after this merges.

Same issue as pgxntool-test#61/pgxntool#84: the /code-review plugin
only prints its findings to the job log by default; it needs --comment
to post a PR comment. Every automated review here has run correctly
but never posted anything visible on the PR.
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: ce27046e-634c-48d6-9cd7-adb4b61560b7

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@jnasbyupgrade jnasbyupgrade changed the title claude-code-review.yml: add missing --comment flag CI: claude-code-review.yml: add missing --comment flag Aug 5, 2026
…oggle

Three fixes to claude-code-review.yml, folded into this PR alongside the
--comment fix since they all touch the review workflow:

- The existing checkout step redirected `origin` to the PR's fork via
  `repository:`/`ref:` + `allow-unsafe-pr-checkout: true`. That breaks
  anthropics/claude-code-action's own internal PR fetch (it runs
  `git fetch origin pull/<N>/head`, a ref that only exists on the base
  repo) with "couldn't find remote ref pull/<N>/head" -- the same bug
  root-caused and fixed in Postgres-Extensions/extension_tools#28. Fix:
  drop the override entirely and just check out the base branch; the
  action fetches the actual PR head itself.
- Add `track_progress: true` so a long review posts a live-updating
  tracking comment instead of staying silent until the whole run
  finishes (cat_tools PR #69).
- Add a `claude-debug` PR label toggle: skips the cost gate and turns on
  `show_full_output` for a fast, fully-verbose debug iteration instead of
  a 5-20+ minute wait per attempt (cat_tools PR #64).

Ported from cat_tools' current claude-code-review.yml, which already has
all three fixes live.
Two more fixes from cat_tools' current claude-code-review.yml, per
~/security-notice.md's two newly-added addenda:

- actions: write permission -- without it, claude-code-action's own
  setup step fails to save its Actions cache with a silent warning
  ("Cache reservation failed: cache write denied"), not a hard failure,
  so the job still passes while being slower/less-cached every run.
  There's no narrower "cache write only" scope GitHub offers.
- claude_args --allowedTools for mcp__github_inline_comment__create_inline_comment
  -- agent mode (a bare prompt: with no @claude mention) only starts
  the inline-comment MCP server if this tool is listed in an
  --allowedTools flag inside claude_args; it does not consult the
  code-review plugin's own allowed-tools frontmatter. Without it every
  review silently falls back to one consolidated PR comment instead of
  real inline line comments, with no error to notice (cat_tools PR #62).

Ported from cat_tools PR #47 and #62 respectively.
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