Repository navigation
perf(pr-review-cli): read PR files and pulls.get once per review run - #869
Conversation
The scope step now passes the pull request's file list (names, old names and hunk ranges) to the status job as a job output, so publish and the hold no longer list the files again; the hold reuses scope's changed-file count instead of its own pulls.get. Publish keeps one pulls.get to catch a head that moved during the review. The full diff reuses scope's merge base instead of a second compare, the publish gate comes through an anonymous git clone instead of three REST calls, and publish lists review comments only when it has an inline comment to post. Every reuse falls back to the old live read when scope's list is absent, malformed, too large or for another head. A whole review with an inline comment drops from 15 job-token requests to 8; a test pins the count for five run shapes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Claude finished @kyle-sexton's task in 4m 7s —— View job Security review complete
No security issues found in this diff. What I focused on, since this PR restructures the trust boundary the hold/publish steps rely on:
No GitHub Actions hardening findings to add beyond zizmor's lane (no trigger, permissions, or pin changes here), and no critical-findings: 0 claude-lane-summary: lane=claude-security-review sha=bf413a54191df72cbbcc4bb6e707c64134c4d354 run=39976842362 |
|
Claude finished @kyle-sexton's task in 6m 24s —— View job Code review
Scope note: this repository runs a dedicated security lane ( PR body contract: compliant — opens with Closing issue: none declared ( Paved paths / manifests: no What I checkedI traced through the core correctness claims by hand rather than just reading the summary:
I was not able to execute No correctness, design, or maintainability issues met the bar for a finding. claude-lane-summary: lane=claude-review sha=bf413a54191df72cbbcc4bb6e707c64134c4d354 run=39976842362 |
|
claude-security-review has reviewed this pull request through bf413a5; a later push is reviewed from there. |
|
claude-review has reviewed this pull request through bf413a5; a later push is reviewed from there. |
…contract (#853) No related issue: registers the pr-review-cli contract at ci-workflows v0.64.2 so claude-code-plugins' review callers can repin to it. ## Summary Registers `pr-review-cli.yml@6d6cb798e7cb7560a0f9327d8a22398961c23b31` (ci-workflows [v0.64.2](https://github.com/melodic-software/ci-workflows/releases/tag/v0.64.2)). ## Fix v0.64.2 changes only how pr-review-cli's steps read the GitHub API ([ci-workflows#869](melodic-software/ci-workflows#869)): the PR file list is read once instead of three times, and pulls.get twice instead of three times. Inputs, secrets and routing are unchanged, so the contract copies the v0.64.1 entry forward verbatim. ## Verification - `node --test runner-policy.test.mjs` in `components/runner-policy`: 340 pass, including the new copy-forward test. ## Related - Same shape as [#851](#851) (v0.64.1). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
No related issue: the org's GITHUB_TOKEN bucket for pull_request jobs ran dry three times on 2026-10-23, and a security-review publish failed on it (claude-code-plugins run 39931559612,
PATCH .../issues/comments/... - 403, "API rate limit exceeded for installation"). This cuts the requests each review-lane run spends.Summary
Each
pr-review-cli.ymlrun read the pull request's file list three times (scope, publish, hold) andpulls.getthree times. It also spent three REST calls fetching the publish gate and a second compare for the merge base. Now the file list is read once andpulls.gettwice. A whole review with an inline comment drops from 15 job-token requests to 8.Fix
pr-filesoutput: each name, its rename's old name, the patch's hunk ranges, and the PR'schanged_files. It writes it only when the live head is the run's head and the JSON fits 100,000 bytes, the same cap as the review output and one environment string's limit. Both model jobs expose it, so the jobs' steps and outputs stay identical. The status job reads it fromreview-key, as it already does for every other scope output.hunkLines, which a test holds equal tocommentableLineson fixtures). It keeps onepulls.getto catch a head that moved during the review. It lists review comments only when it has an inline comment to post: the rerun de-duplication stays, and a run with no inline comment skips a read whose result nothing uses.changed_files. Without a usable list (absent, malformed, too large, another head, scope failed) it does its ownlistFilesandpulls.getas before, so a missing list can never drop a trust-gate hold. A test pins that.--filter=blob:none --no-checkoutclone of claude-code-plugins plusgit show <tip>:lib/publish-gate.mjs. That is the route the plugin staging step already takes, and it spends no REST request. The import check and the tip log are unchanged.pr-filesis a step output of the scope step, which runs before any model step. The runner gives each step its own outputs file, so the later model step, which has no shell or write tool, cannot rewrite it. The status job already trusts the same step's outputs for its skip decisions. The SECURITY MODEL header andpublish-review/action.ymlnow describe this.claude-lane-review-completenotice and the lane records.Verification
.github/scripts/pr-review-cli-api-calls.test.cjsruns the shipped scope, full-diff and gate steps, then publish and the hold. The env comes from the workflow's own expressions, and one counting fake stands in for the API. The same harness, copied into agit archiveof v0.64.1 (9aca743), measured the before column.The counts assume one page per list. Per run,
pulls.listFilesgoes from 3 to 1 andpulls.getfrom 3 to 2 (1 on a skip). The gate goes from 3 calls to 0, and the full-diff compare from 1 to 0. Checkout and the PR-context GraphQL query are the same before and after, so neither column counts them.At about 22 reviewing runs an hour per lane, that saves about 7 requests per reviewing run, roughly 150 an hour per lane and 300 an hour for both lanes.
Local:
node --test --test-concurrency=1 .github/scripts/*.test.cjsgave 644 pass, 0 fail.actionlintandzizmor --offlineon the changed workflow and actions were clean, andbiome ci --error-on-warnings .github/scripts .github/actionswas clean.Related
review-subscriptionjob still repeats the whole scope step after a handoff, about 5 to 8 requests more on those runs. Handoffs are rare: 0 of 13 sampled runs between 14:26Z and 14:58Z, 1 at 09:24Z today.pr-review-hosted.ymlandpr-review-security-hosted.yml; a follow-up PR repins both.🤖 Generated with Claude Code