Skip to content

CI: fix claude-code-review checkout failure + enable track_progress - #15

Merged
jnasbyupgrade merged 3 commits into
Postgres-Extensions:masterfrom
jnasbyupgrade:track-progress-claude-review
Aug 5, 2026
Merged

CI: fix claude-code-review checkout failure + enable track_progress#15
jnasbyupgrade merged 3 commits into
Postgres-Extensions:masterfrom
jnasbyupgrade:track-progress-claude-review

Conversation

@jnasbyupgrade

@jnasbyupgrade jnasbyupgrade commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Two independent fixes to the Claude review workflow:

  1. Checkout was failing on every PR (Makefile: cat_tools install override (CAT_TOOLS_GIT_REF/CAT_TOOLS_SKIP_INSTALL), default unchanged #10, Update pgxntool to 2.3.0 #14, and this PR's own first
    run) — actions/checkout's new allow-unsafe-pr-checkout guard (added
    in v4.4.0, backported to all major tags) blocks checking out fork-PR
    code under pull_request_target unless explicitly opted into. Added
    allow-unsafe-pr-checkout: true with a comment explaining why it's safe
    here (job already gated to the trusted fork, checked-out code is only
    ever read, never built or executed).
  2. track_progress: true on the review step, so it posts a live-updating
    checklist comment instead of staying silent until the whole run
    finishes (pattern from cat_tools PR #69).

Confirmed via actual failed-run logs that the checkout error is the only
thing failing — nothing else lurking behind it.

Note: this workflow runs on pull_request_target, which always
executes from master — so this PR's own claude-review check can't
verify either fix. Both need a follow-up PR after merge to confirm.

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>
@coderabbitai

coderabbitai Bot commented Aug 4, 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: dbd9bae4-aef8-46fd-914e-f1bff7b36d2c

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

Copy link
Copy Markdown
Contributor Author

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:

```
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.
```

This is actions/checkout@v4 enforcing a newer security guard against checking out fork code under pull_request_target, even for the trusted jnasbyupgrade fork this workflow is gated to. It's orthogonal to the track_progress fix in this PR (which lives in the later "Run Claude Code Review" step, never reached). Flagging for visibility — separate fix, separate PR.

All substantive checks (the PostgreSQL 9.3–17 matrix and all-checks-passed) pass.

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.
@jnasbyupgrade jnasbyupgrade changed the title claude-code-review.yml: enable track_progress for the review step claude-code-review.yml: fix checkout failure + enable track_progress Aug 5, 2026
… check

The head.repo.owner.login check is the entire security boundary that
makes allow-unsafe-pr-checkout: true safe on the checkout step below.
Make that explicit and unmissable, not just implied by a comment on
the checkout step referencing it.
@jnasbyupgrade
jnasbyupgrade merged commit f3b7d8e into Postgres-Extensions:master Aug 5, 2026
14 of 15 checks passed
@jnasbyupgrade jnasbyupgrade changed the title claude-code-review.yml: fix checkout failure + enable track_progress CI: fix claude-code-review checkout failure + enable track_progress Aug 5, 2026
jnasbyupgrade added a commit to jnasbyupgrade/extension_tools that referenced this pull request Aug 5, 2026
jnasbyupgrade added a commit to jnasbyupgrade/extension_tools that referenced this pull request Aug 5, 2026
jnasbyupgrade added a commit that referenced this pull request Aug 5, 2026
#28)

PR #15's `allow-unsafe-pr-checkout: true` fix silenced the
checkout-refusal
error but was solving the wrong problem, and traded it for a new one:
after merging, review runs on #10 and #16 failed with a different error,
`fatal: couldn't find remote ref pull/10/head`.

Root cause: `anthropics/claude-code-action`'s own `docs/security.md`
explicitly names our checkout step's pattern (checking out the PR's own
untrusted ref, from the fork, into the workspace root) as the
anti-pattern
to avoid, and its "preferred" fix is a plain checkout of the base ref
with
no override. The action fetches and reads the PR's actual content itself
-- confirmed by reading its source (`src/github/operations/branch.ts`):
for
a fork PR it runs `git fetch origin ... pull/<n>/head`, a ref GitHub
maintains on the BASE repo for any PR (fork or not), so it never needs
direct access to the fork's remote. Our step redirecting `origin` to the
fork broke that internal fetch, since `refs/pull/<n>/head` doesn't exist
there.

Fix: remove the `repository:`/`ref:`/`allow-unsafe-pr-checkout` overrides
entirely -- just `uses: actions/checkout@v7` with no inputs, checking out
this repo's own base branch. Updated the surrounding comments (the
top-of-file SECURITY note and the job's trust-check warning) to match --
they previously described the now-removed manual fork-checkout.
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