Repository navigation
refactor(ci): give lane scripts one GitHub client module in scripts/lib - #18310
Conversation
Move createGitHub, retryServerErrors, paginate, GitHubError and the rest of the client out of check-trusted-trigger.mjs into .github/scripts/lib/github-client.mjs, a sibling of github-rest.mjs so it keeps the trust floor class without raising budgetedClient's, and point 68 static and 4 dynamic importers at it. Every sparse checkout of the trust gate lists the module from the same base checkout; the floor gains a trust row synced by sync-hold-floor.py. retry-fetch.mjs stays separate: pr-run-activity-write copies it alone, where the client's rate-guard import cannot resolve. The moved comments meet the necessary posture: public declarations carry JSDoc, the rest are deleted.
Reasons kept from deleted comments:
- Every sparse checkout of check-trusted-trigger must list github-client.mjs, which it imports statically.
- appCloseKind imports done-evidence.mjs at call time so a job whose sparse checkout lacks it still runs the gate.
- GitHubError keeps responseDetail's line in `detail`, not the message, so callers that log only the message log what they did before.
- A retry line names only an error's name and cause code because undici puts whole header values, the token included, in some messages.
- With 20 s attempts and the 60 s budget a retried call adds at most about 46 s, inside the shortest step that runs one (3 minutes: pr-merge.yml report-gate-checks and clear-escalations).
- The latch's wait comes before an attempt's timeout and clock start, so it neither aborts the attempt nor counts against the retry budget.
- Only idempotent requests are timed out: a write GitHub accepted slowly must not look failed.
- The RESEND flag tells the rate guard a refused attempt will be resent, so it fails nothing for it; the latch waits out the reset on its own budget.
- An empty success body is a 204 or the 201 a workflow re-run answers.
- A list keeps its Link header for merge-holds.mjs branchActivity's cursor paging; an answer keeps its ETag for verifyRecordedRerun's conditional re-read.
- COMMIT_PULLS_QUERY is the fallback because GET /commits/{sha}/pulls answered 200 with an empty body while this query read the PR (2026-10-22).
- A missing GraphQL list is `incomplete` so a lane may hold on it (resolve-pr.mjs closing); another page is not, since every re-read meets it again.
- REST spells an App's login `app[bot]`, GraphQL `app`, so the GraphQL login gains `[bot]`.
- A document can hold several operations and a request pick one by name, so graphqlQuery needs all three conditions.
- isFault is element 2 of the outage posture; a lost permission or missing label is no fault because a retry meets it again.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review Summary: ✅ CompletedThis 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. |
Lane run report
Run 45105262997, attempt 1
Failed GitHub API callsNo failed call recorded by the run job's scripts. |
|
claude-review reviewed Chunk 1 of 3 (40 files)Code review: chunk 1 of 3 (40 files)No blocking findings in this chunk. This lane already reviewed an earlier head ( What I checked at this head:
Context:
Verifier dropped 0 of 0 candidates. Chunk 2 of 3 (40 files)Code review: chunk 2 of 3 (40 files)No blocking findings in this chunk. This lane already reviewed an earlier head, and the prior-findings file says What I checked at this head:
Context:
Verifier dropped 0 of 0 candidates. Chunk 3 of 3 (20 files)Code review: chunk 3 of 3 (20 files)No blocking findings in this chunk. This lane already reviewed an earlier head ( What I checked at this head:
Context:
Verifier dropped 0 of 0 candidates. critical-findings: 0 |
|
claude-security-review reviewed Chunk 1 of 3 (40 files)Security review: chunk 1 of 3 (40 files)I found no security issues in the 40 files of this chunk. This lane already reviewed an earlier head, so this review is blocking only: it reports only CRITICAL and IMPORTANT findings, and there are none. The only earlier post is a summary comment with no line anchor, and it held no finding to restate. What this chunk changes. The lane GitHub client moves out of the trust-gate action into a new module,
Trust controls checked
Instruction surface: this chunk deletes and trims code comments only. No standing instruction (CLAUDE.md, a skill or agent body, a hook's block list or allowlist) is narrowed. PR context: it holds no embedded directive aimed at the review lane. Chunk 2 of 3 (40 files)Security review: chunk 2 of 3 (40 files)I found no security issues in the 40 files of this chunk. This lane already reviewed an earlier head, so this review was blocking only: it reports CRITICAL and IMPORTANT findings, and there are none. The only prior post is a summary comment with no line anchor, and it holds no finding to restate. What this chunk changes. In 39 of the 40 files, the only code change is where the GitHub client is imported from. Those files now take The trust-verdict helpers ( Trust controls checked
No new or changed instruction surface, plugin manifest, workflow permission or token request is in this chunk. Chunk 3 of 3 (20 files)Security review: chunk 3 of 3 (20 files)I found no security issues in this chunk's 20 files. This lane already reviewed an earlier head, so this review reports only blocking findings (CRITICAL and IMPORTANT), and there are none. The only prior post is a summary comment with no line anchor. It held no finding to restate. What this chunk changes
Trust controls checked
Spend: none beyond normal CI. No changed line here adds a run, a model or a schedule. critical-findings: 0 |
callers.test.mjs follows imports outside .github/actions by their repository path instead of reading them as action directories, so it checks the intake-triage sparse list for lib/github-client.mjs. The floor pins in test_floor_paths.py and test_diff_risk.py count the new trust row, and four touched suites declare the files their strace showed they read. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…client # Conflicts: # .github/workflows/pr-review-hosted.yml # .github/workflows/pr-review-security-hosted.yml
|
The pr-unblock lane stopped
When a retry on this head can change the outcome, the lane runs one on its own, up to its per-head cap, and edits this comment if it stops again; a run that does not stop clears the status. When no retry can (a review thread the lane does not take or settle, or a failing check after the retries are spent), a person resolves the threads or gets the checks green, then dispatches the workflow below: that run finds the cause gone and clears the status. On a pull request the lanes App opened, the dispatchers start that run once per stop; on any other, a person does. A new commit to the branch starts clean. To run it again on this head now, dispatch the gh workflow run pr-unblock.yml -R melodic-software/claude-code-plugins -f pr-number=18310 -f activity=resolve-conflicts |
Lane run report
Run 45111125626, attempt 1
Failed GitHub API callsNo failed call recorded by the run job's scripts. |
|
The unattended merge path is about to ask GitHub to enqueue this pull request at head |
…files the babysit suites read Main's new credential-leg scripts and demotion-record vectors are read by test_merge_holds_sync.py, engine.test.sh and engine-d.test.sh, which this branch's change selects; their test-scope lines now name them so Test Selection rule R8 holds. Co-Authored-By: Claude Opus 5.5 <[email protected]>
No related issue: candidate 2 (stage 1) of an
/architecture:improvedeepening pass over the CI lanes, run in a local session.Summary
The GitHub client most lane scripts use (
createGitHub, its retry, pagination,GitHubError, the GraphQL readers) lived inside the trigger trust-gate action,.github/actions/check-trusted-trigger/check-trusted-trigger.mjs, so 72 lane scripts imported their client from a trust gate. Any client change edited the trust gate's file. This PR gives the client its own module in.github/scripts/lib.Fix
.github/scripts/lib/github-client.mjsholds the client code. With comments stripped, it is byte-identical to the moved region: the retry delays, timeouts, errors and rate-guard routing do not change.check-trusted-trigger.mjskeeps only the trust verdict and imports the client from lib.github-client.mjsgets its ownclass: trustfloor row indocs/conventions/pr-pipeline.yaml, the same class as the action, andsync-hold-floor.pyregeneratedHOLD_PATH_FLOOR, the review callers' hold-path lists and theci-statushold patterns. Every base sparse-checkout list that holds the trust gate now also holds the client: intake-triage, pr-dispatch-feedback, pr-require-checks (two lists) and both pr-review hosted callers. Every job still loads both from the same base checkout.necessaryposture (ADR 0108, 0110): 25 deleted, 15 shortened to doc comments on public declarations, 1 kept. The commit message keeps the 15 reasons those comments recorded.retry-fetch.mjsstays separate:pr-run-activity-write.ymlcopies it alone into$RUNNER_TEMP/lib, where the client's rate-guard import would not resolve.Left for stage 2: converging the four
createGitHubApicopies,fetchGitHub,actionsClient, enable-auto-merge's retry,collect.mjs's client,budgetedClientandretryFetchon this module.Verification
node --test --test-concurrency=4over the 60 suites the change touches plus every rewired importer's suite: 5529 pass, 0 fail, after merging current main.sync-hold-floor.py --checkpasses. A scan after the merge finds no importer that still takes the client from the trust gate.test_merge_holds_sync.py: the floor-count pin is updated from 89 to 90, plus an assert that the import closure includes the client. Its 18TheCostDecisionIsTheGatescases failed locally the same way on base inputs; CI's Python lane is the authority there.Reasons kept from deleted comments
The squash commit takes this body, so the reasons the deleted comments recorded are kept here (
docs/review/comments.md):detail, not the message, so callers that log only the message log what they did before.incompleteso a lane may hold on it (resolve-pr.mjs closing); another page is not, since every re-read meets it again.app[bot], GraphQLapp, so the GraphQL login gains[bot].Related
Next PRs in this series build on this module (stage 2, then the lane-run reader and the carry store).
🤖 Generated with Claude Code