Repository navigation
Conversation
The Thread Transfer Report paged through every successful main CI run (up to ten requests of 100) and then kept 20. List the exact-base runs and the newest runs with one request each instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a narrowly scoped CI-only optimization that replaces exhaustive workflow-run pagination with two bounded parallel queries and updates coverage for the fallback baseline case. The changed code is confined to the CI publisher and its test harness, with no product-facing behavior or sensitive configuration changes. You can add or adjust custom eligibility rules. Learn more. |
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
…-page- Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Problem
The Thread Transfer Report workflow runs after every pull request CI run. To pick a baseline,
resolve()callsgithub.paginateonlistWorkflowRunsfor every successful push CI run on the base branch, then keeps the first 20. Main has 2,500 such runs, so each report that gets this far pages up to the API's 1,000-result cap. That took 11 requests in the live check below, to use 20 runs.Those requests come out of the shared
GITHUB_TOKENquota that.github/actions/ci-changes/action.ymlalready works to save ("every job that runs this shares the repository's 1,000 requests/hour GITHUB_TOKEN quota"). The workflow ran 1,413 times in the 24 hours before this PR.Change
Replace the paginated listing with two single-page requests of 20 runs each, made in parallel:
head_shais the PR's base SHA, which the code already puts first;The ordered list is the same as before: exact-base runs first, then the newest other runs, cut to 20. Any run in the old top 20 that isn't at the base SHA is among the 20 newest runs, so it is still found. One case improves: an exact-base run older than the 1,000-result cap was missed before and is found now.
The comment, artifact checks and outputs don't change.
Scope and approval
There is no issue for this. It is a small, self-contained change to one CI script, with no product code and no user-facing behavior. Output stays the same and API use drops. The
ci-changesaction already avoids REST calls for the same quota reason.Verification
Focused test:
The existing "resolves a fallback PR with a redacted head repo and exact main baseline" test now serves 1,000 main runs from a one-page
listWorkflowRunsfake, with the exact-base run at position 900. Itspaginatefake no longer handleslistWorkflowRuns. On main the test fails withunexpected pagination callatthread-transfer-report.cjs:304. On this branch all 7 tests pass and the baseline is the exact-base run. The test uses no timers and checks outputs, not call arguments.The updated test fails on main and passes on this branch:
Live check: I ran
resolve()from main and from this branch against the real, read-only GitHub API with@octokit/rest22.0.1 (the lockfile version) for the same five recent pull request CI runs. A request hook counted every GET and rejected any other method. For the four runs that target main, main made 14 requests (11 tolistWorkflowRuns) and this branch made 5 (2 tolistWorkflowRuns). Outputs were identical, includingbaseline_run_idandbaseline_matches_base=true. The fifth, a fork PR with no open match, returns early after 1 request in both.Request counts and outputs for the same five CI runs, main ("base") and this branch ("candidate"):
vp lint --report-unused-disable-directivesandvp fmt --checkon the two changed files: both exit 0 with no findings.Not checked:
resolve()against the same API.upsertCommentForCurrentHeadpath. This PR doesn't touch it.Prior PRs: no open or closed PR or issue makes this change. #22232 by Theo Browne changed other parts of this file. Open #21514 by maria trims a neighboring comment and does not touch this change.
Production fix, tests, PR description and images written with Claude Opus 5.5 in T3 Code Nightly.
🤖 Generated with Claude Opus 5.5 in T3 Code Nightly