claude-code-review.yml: enable track_progress for the review step - #15
claude-code-review.yml: enable track_progress for the review step#15jnasbyupgrade wants to merge 2 commits into
Conversation
The review step's `prompt:` input puts claude-code-action into automation mode, which by default posts nothing to the PR until the whole run finishes. Combined with the cost gate that waits for sibling CI, a review can look silently stuck for the better part of an hour with no visible progress. track_progress: true posts a live-updating tracking comment with a checklist instead. Pattern modeled on Postgres-Extensions/cat_tools PR #69. Note: because this workflow runs on pull_request_target, GitHub always executes the workflow file from the base branch (master), never a PR's own version -- so this PR's own claude-review check will still run the old workflow without track_progress. The new behavior can only be verified on a subsequent PR, after this one merges. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
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 |
|
Note on CI: the `claude-review` check is failing here, but it's a pre-existing issue unrelated to this change — it fails identically on other recent PRs (#10, #14) at the "Check out PR head" step, before the step this PR modifies ever runs: ``` This is All substantive checks (the PostgreSQL 9.3–17 matrix and |
actions/checkout v4.4.0 (backported to all major-version tags) added a new default-on refusal for checking out a fork PR's head under pull_request_target, since it can't see that this job is already gated to the trusted jnasbyupgrade fork only (see the if: condition and SECURITY comment above) and never builds or executes the fetched code. Root-caused via the actual failed run logs on PRs Postgres-Extensions#10/Postgres-Extensions#14/Postgres-Extensions#15, which all failed at this checkout step with: Refusing to check out fork pull request code from a 'pull_request_target' workflow. ... set 'allow-unsafe-pr-checkout: true' on the actions/checkout step. Without this, track_progress: true (added in the prior commit) never had a chance to matter -- the workflow was failing before the review step ever ran.
Summary
prompt:input putsclaude-code-actioninto automation mode, which by default posts nothing to the PR until the whole run finishes. Combined with the cost gate that waits for sibling CI, a review can look silently stuck for the better part of an hour with zero visible progress, indistinguishable from a hung job.track_progress: truealongside theprompt:input in the "Run Claude Code Review" step so the action posts (and keeps live-updating) a tracking PR comment with a checklist as Claude works.Postgres-Extensions/cat_toolsPR #69, which made the identical fix in its ownclaude-code-review.yml..github/workflows/claude.yml(the other Claude Code workflow, triggered by@claudementions): it has noprompt:input, so it runs in the default interactive mode, not automation mode, and does not have this issue. No change needed there.Follow-up fix: the review job was failing before it ever ran
track_progress: trueabove turned out to be moot on its own: theclaude-reviewjob has been failing on every recent PR (#10, #14, and this PR's own first run) for an unrelated, more fundamental reason — it never got past the checkout step. Confirmed from the actual failed run logs (gh run view <id> --log-failedon run 30940000508):Root cause:
actions/checkoutshipped a breaking change (v4.4.0, backported to every major-version tag includingv4— see https://github.blog/changelog/2026-06-18-safer-pull_request_target-defaults-for-github-actions-checkout/) that added a new default-on refusal: checking out a fork PR's head/merge ref underpull_request_targetis now blocked unlessallow-unsafe-pr-checkout: trueis explicitly set. Since our "Check out PR head" step intentionally tracks the@v4tag (to pick up upstream fixes automatically), it silently picked up this new guard.This isn't a case of the workflow being unsafe — it's that
actions/checkoutcan't see the safeguards this workflow already has: the job'sif:condition restricts the entire job to PRs from the trustedjnasbyupgradefork only, and the checked-out code is only ever read (fed to the Claude review action), never built or executed.allow-unsafe-pr-checkout: trueis the officially documented, conspicuously-named opt-in for exactly this already-mitigated case, so this commit adds it to the checkout step with a comment explaining why it's safe here.The pull_request_target self-verification catch
This workflow runs on
pull_request_target, which always executes the workflow file from the base branch (master), never the PR's own copy. That means this PR's ownclaude-reviewcheck will still run the old, broken workflow (pre-allow-unsafe-pr-checkout), since it reads frommaster, not from this branch — so this PR's own check is expected to keep failing at the same checkout step, even after this fix. That is not a sign the fix is wrong; it's a structural limitation ofpull_request_targetself-testing. Full verification requires merging tomasterand observing a subsequent PR'sclaude-reviewrun succeed.Test plan
python3 -c "import yaml; yaml.safe_load(...)")claude.ymldoes not need the same fix (noprompt:input present)actions/checkout's own release notes and GitHub's changelog posttrack_progressbehavior on a subsequent PR (cannot be verified on this PR itself, see above)master(cannot be verified on this PR itself, see above)