Repository navigation
fix(ci): cache ci-workflows pins in test-node instead of fetching them every run - #18710
Conversation
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. |
|
claude-security-review reviewed Security review: PR #18710 (incremental, head
|
|
claude-review reviewed Code review: PR #18710, changes since 8cb9cb4 (now at d5340e2)I found no blocking findings in this push. This lane already reviewed an earlier head, so this review was blocking only: I dropped advisory findings. What changed:
What I checked in the changed lines:
Prior findings: the one earlier inline finding (discussion_r4685485278) was found fixed in the last round, and this push does not undo that fix. Other notes:
Verifier dropped 0 of 0 candidates. |
… in credential-legs credential-legs.test.mjs loaded select-model-credential's contract through contractAtPin, which runs git ls-remote and git fetch against melodic-software/ci-workflows. A merge-group run failed when that fetch returned HTTP 403. loadSelect takes an optional root, a local copy of the contract files, and loads it with eval-handoff's loadContract; without one it calls contractAtPin as before. The suite writes fixtures/ci-workflows-<sha>.json, the nine files contract-files.txt names keyed by path, to a temporary root and passes it. The content is ci-workflows at 394af27bda4bda2e02e0ef0691eacd120389108f: each entry's git blob hash matches that commit's tree. lane.cjs is stored as plain text and the other files base64-encoded: the vendored text then passes the comment lint and the vocabulary check, and gitleaks reads lane.cjs as the code it is (its base64 form tripped generic-api-key on entropy alone). The suite declares the fixture in its test-scope header. Co-Authored-By: Claude Opus 5.5 <[email protected]>
14e2e68 to
62a659c
Compare
|
The pr-verify verifier failed head What it wrote (34 lines)This pull request leaves the merge queue, and ci-status holds it out while it carries |
|
claude-review's blocking finding (loosened check at |
|
Held with the do-not-merge label for an owner decision. pr-verify failed head 62a659c on substance. Freezing the select-model-credential contract in a fixture loosens what this suite checks, and that needs an owner-decisions record quoted on #14293, which a body section does not replace. The verifier also could not read the base64-stored test code in the diff. No further head is pushed until the owner chooses between recording the loosening and dropping the fixture for a retry on the live fetch. |
Keep main's removal of the credential-legs suite comments and the branch's test-scope declaration for the contract fixture. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…t lint The comment lint gains comment_lint_exclude, a team-file list of repository-relative path globs it skips, each skip named on stderr. * and ? stay within one path segment, ** spans segments, every other character is literal. It is read through comment-settings.sh --list, the path comment_lint_allow already takes, and the plugin ships no entries. This repository sets one entry, the directory of ci-workflows contract files vendored byte-identical to a pinned commit for the offline credential-legs test, whose comments are upstream's (owner decision Q156). Refs: #14293 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…fixture The credential-legs test reads ci-workflows' contract from files byte-identical to the pinned commit, so it runs offline, replacing the JSON fixture. The fixture directory is excluded from the comment lint by comment_lint_exclude (owner decision Q156, row L408). Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ixture The suites that read ci-workflows through .github/scripts/lib/ci-workflows-at-pin.mjs fetched every pinned commit over the network on each CI run, because its cache lives in os.tmpdir(), which starts empty on a runner. A fetch failure there ejected merge groups (#14293). test-node now restores /tmp/ci-workflows-at-pin from the Actions cache and saves it on main. Each pin is its own directory named by commit sha, and a commit's content never changes, so a restored directory cannot be stale; a pin is fetched once per new pin. restore-keys carries earlier pins forward, so the save keeps the 20 newest directories. This replaces the vendored copy of the ci-workflows contract files (about 3,770 lines) and the loadSelect fixture branch: the owner chose the cache over the fixture in session on 2026-11-24. The comment-lint exclusion for that fixture directory goes with it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A key built from this repository's workflow files never changed when ci-workflows main moved, so a new main tip was fetched on every run and never saved. Each run now restores the newest entry by prefix under a per-run key, lists the restored pins, and on main saves only when the run fetched a pin it did not restore, after keeping the 20 newest. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Hold lifted: the owner decided in session on 2026-11-24 to replace the vendored fixture with a CI cache keyed by the pinned commit (8cb9cb4). The frozen-contract loosening that pr-verify failed at 62a659c is gone: credential-legs.test.mjs and model-credential.mjs match main, and the fixture's comment-lint exclusion entry is removed. Both hosted lanes report 0 findings at this head; pr-verify and pr-review-main judge it next. |
…keep the ones in use A restored pin was trusted as is: its files and its .git (config, hooks) came from the Actions cache, not from the sha it is named for. Each restored pin is now rebuilt into a fresh repository by a file:// fetch of that sha with transfer.fsckObjects on, so every object is hashed and nothing from the cached .git carries over; a pin that does not rebuild is dropped and fetched again. The loader also marks a pin used on a cache hit, so the prune keeps the pins runs still read instead of the ones fetched most recently. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Refs: #14293
Summary
The suites that read ci-workflows through
.github/scripts/lib/ci-workflows-at-pin.mjsfetched every pinned commit over the network on each CI run: its cache lives underos.tmpdir(), which starts empty on a runner. Merge-group run 45160314776 (for #18415) failed when that fetch returned HTTP 403, one of the merge-queue ejections #14293 tracks. The test-node job now restores that cache from the Actions cache and saves it on main, so a pinned commit is fetched once per new pin rather than on every run.An earlier head vendored a copy of the ci-workflows contract files (about 3,770 lines) as a test fixture instead. The owner chose the cache over the fixture in session on 2026-11-24, reversing his Q155 (A) answer: the cache keeps ci-workflows as the one copy of those files, and needs no size-check or comment-lint exclusion.
Fix
.github/workflows/pr-require-checks.yml, jobtest-node:Restore the ci-workflows pin cache(actions/cache/restore@v6, path/tmp/ci-workflows-at-pin, keyci-workflows-at-pin-<run id>, restore-keysci-workflows-at-pin-) restores the newest saved entry before any suite.Rebuild each restored ci-workflows pin from its checked objectsthen rebuilds every restored pin into a fresh repository by afile://fetch of its sha withtransfer.fsckObjectson, so every object is hashed against the sha and nothing from the cached.git(config, hooks) carries over; a pin that does not rebuild is dropped and fetched again. It records the pins that survive..github/scripts/lib/ci-workflows-at-pin.mjs: a cache hit sets the pin directory's modification time, so the prune ranks pins by last use and keeps the ones suites still read. On main, after the suites,Keep the 20 newest ci-workflows pinsruns only when the run fetched a pin it did not restore (a new ci-workflows main tip, or a new SHA pin), prunes the directory to the 20 newest, andSave the ci-workflows pin cachesaves it under the run's key. Each pin is its own directory named by commit sha, written once behind areadymarker, and a commit's content never changes, so a restored directory cannot be stale.git fetchof a pinned commit (git fetch of ci-workflows 8972ed0d… failed … 403).commitOf("main")still runs onegit ls-remotea run for themain-ref callers, with its 3 attempts; the cache removes the commit fetch, which is the call that failed.ci-workflows-at-pin.mjsruns in this job:credential-legs.test.mjs,ci-workflows-at-pin.test.mjs,eval-handoff.test.mjs,parity.test.mjs(throughTest the other Node packages) andresolve-config/callers.test.mjs(throughTest resolve-config).docs/conventions/code-tidying.yaml: thecomment_lint_excludeentry for the fixture directory is removed, since that directory no longer exists. The setting itself, shipped in feat(code-tidying): add comment_lint_exclude path globs to the comment lint #18811, stays with no entries.model-credential.mjsandcredential-legs.test.mjsmatch main.Verification
node --test --test-concurrency=4 .github/scripts/pr-unblock/credential-legs.test.mjs: tests 3, pass 3, fail 0.core.fsmonitorplanted in a cached pin's config is absent after the rebuild and its command never ran.ci-workflows-at-pin.test.mjs3/3,credential-legs.test.mjs3/3,eval-handoff.test.mjs15/15,parity.test.mjs20/20; strict trace over the four, no gap.resolve-config/callers.test.mjsneeds theyamlpackage, which this host lacks; CI runs it.new=truewritten.actionlint .github/workflows/pr-require-checks.yml: no findings.scripts/run-zizmor.sh: no findings.scripts/check-lane-coverage.sh --check,scripts/ci-ordered-skips.test.sh(26 passed): pass at the final head.scripts/check-affected.sh --base HEAD~1: 18 passed, 6 skipped.scripts/check-lane-coverage.sh --check: all 13 lanes reachable, all 94 gate steps fed.scripts/check-convention-yaml.sh --check: 21 files validate.scripts/ci-ordered-skips.test.sh: 26 passed.scripts/check-lane-coverage.test.sh: 41 passed.scripts/ci-test-node-stop-commands.test.shandscripts/check-workflow-template-size.sh(their Python and npm dependencies are not installed on this host); CI runs both.Remaining
Related
comment_lint_exclude, whose one entry this PR removes.🤖 Generated with Claude Code