CI: claude-code-review.yml: add missing --comment flag - #3
Open
jnasbyupgrade wants to merge 3 commits into
Open
Conversation
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.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
…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.
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
/code-reviewplugin only prints its findings to the job log by default; it needs--commentto 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.show_full_outputon a canary PR with a deliberately injected bug: the review agent found the bug correctly, but its own final line read "No--commentargument was provided, so no GitHub comments were posted." Adding--commentfixed it there; this is the same one-line fix ported here unchanged.originto the PR's fork viarepository:/ref:+allow-unsafe-pr-checkout: true. That breaksanthropics/claude-code-action's own internalgit 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.track_progress: true(live-updating tracking comment instead of a silent run until completion -- cat_tools PR #69) and aclaude-debugPR label toggle (skips the cost gate + turns onshow_full_outputfor a fast debug iteration -- cat_tools PR #64).permissions: actions: write(there's no narrower "cache-write-only" scope; without itclaude-code-action's own setup step silently fails to save its Actions cache every run -- cat_tools PR #47) andclaude_args: --allowedTools mcp__github_inline_comment__create_inline_comment(agent-modeclaude-code-actiononly 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).claude-code-review.yml, which already has all of them.Test plan
--commentfix was live-verified against pgxntool-test's identical workflow before being ported here unchanged.pull_request_target-workflows-can't-verify-themselves rule: this PR's ownclaude-reviewcheck still runs the OLD workflow offmainand can't demonstrate any of these fixes on itself. Verification (fork-checkout no longer errors, tracking comment appears,claude-debuglabel works, cache-write warning gone, inline comments post) only happens on a subsequent PR after this merges.