Repository navigation
refactor(ci): move the lane-token revoke and pinned PyYAML install into lib scripts - #15970
Conversation
…to lib scripts Add .github/scripts/lib/revoke-lane-token.sh (the DELETE installation/token call with its stdin-only auth header, a success line on 204 and a warning otherwise, always exit 0) and .github/scripts/lib/install-pinned-pyyaml.sh (the `pyyaml==` block of the requirements-ci.txt next to it, the same hashed pip install, and the caller's warning text with exit 1 on failure). The 13 "Revoke the lane token" steps in intake-triage, pr-merge, work-unblock, maintenance-measure-skill-edit, maintenance-tidy-code-upkeep and upstream-apply-changelog, and the 4 "Install the pinned YAML reader" steps in pr-merge, pr-feedback-dispatch and pr-unblock-dispatch, now run those scripts from .base, keeping each step's name, if:, continue-on-error and env:. The hill-climb workflow test matches the script name instead of DELETE. Closes #15963 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 #15970 (incremental, c359578 → efc6f20)I found no security issues in this push. I read every hunk of the one file it changes, What changed. The push adds
Trust controls. The test changes no workflow, token request, trusted-actor list, kill switch or merge-hold script. It only exercises the scripts the previous review already checked. Nothing is widened. PR text. The PR context holds no embedded instructions to this lane. Scope. Every other file is unchanged since c359578, which this lane reviewed with no findings. This was a blocking-only review: only CRITICAL and IMPORTANT findings would be posted. critical-findings: 0 |
|
claude-review reviewed Code review: PR #15970, incremental (c359578 → efc6f20)Scope. This is an incremental, blocking-only review, because this lane already reviewed an earlier head. One file changed since then: the new Prior finding resolved. This lane's earlier finding was that no test ran either new script (discussion_r4564811444). It is resolved, and this push adds the test that finding asked for. What the new test checks:
What I checked in the test itself:
With this test in place, the closing issue's criterion "Behavior is unchanged except the one success log line the terse revoke copies gain" now has a test that can fail. Unverified. The owner says that two deliberate breakages each fail 3 of the 5 checks: Other checks.
No new findings. Verifier dropped 0 of 0 candidates. |
scripts/lane-lib-scripts.test.sh runs revoke-lane-token.sh with a stub curl answering 204 and 401 (the success line and the warning, exit 0 both times) and install-pinned-pyyaml.sh from a copied .base-shaped tree with a stub python3 (exactly the pyyaml== block of the requirements file two directories up, the hashed binary-only pip flags, and on a failed install the caller's warning and exit 1). Moving the requirements path or making the revoke exit non-zero fails it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Post-merge mutation testingKilled 6, survived 1, timeout 0, no coverage 0, invalid 0, not run 0.
Surviving mutants
The run's summary has the full report. |
Closes #15963
session: Simplify E2 A
Summary
Moves two shell bodies that were written out by hand in several workflows into
.github/scripts/lib/(restructuring pass #15695). The "Revoke the lane token" body had 13 copies in 6 workflows. The "Install the pinned YAML reader" body had 4 copies in 3 workflows.Fix
New
.github/scripts/lib/revoke-lane-token.sh(mode 100755,#!/usr/bin/env bash). It readsGH_TOKENandGITHUB_API_URLand sends the samecurlDELETE toinstallation/token, with the auth header on stdin so the token never shows in a process listing. A 204 prints "the lane token is revoked"; any other status prints the existing::warning::line. It always exits 0.New
.github/scripts/lib/install-pinned-pyyaml.sh(mode 100755). It reads thepyyaml==block from therequirements-ci.txttwo directories up (.base/.github/requirements-ci.txtwhen called from.base) into$RUNNER_TEMP/pyyaml-requirements.txt, then runs the samepip install --only-binary=:all: --require-hashes. On failure it prints::warning::with its one argument and exits 1.Every step keeps its name,
if:,continue-on-errorandenv::intake-triage.yml(2),pr-merge.yml(2),work-unblock.yml(3),maintenance-measure-skill-edit.yml(2),maintenance-tidy-code-upkeep.yml(2) andupstream-apply-changelog.yml(2) now runbash .base/.github/scripts/lib/revoke-lane-token.sh;pr-merge.yml(2),pr-feedback-dispatch.ymlandpr-unblock-dispatch.ymlnow runbash .base/.github/scripts/lib/install-pinned-pyyaml.sh '<their own warning text>'.Every one of those jobs checks main out to
.basein full before it can hold a lane token.hill-climb-workflow.test.mjs:68matchesrevoke-lane-token.shinstead ofDELETE.The one output change: the 6 revoke copies that only warned (the measure-skill-edit, tidy-code-upkeep and upstream-apply-changelog steps) now also print "the lane token is revoked" on success.
Left as they are, per the issue:
request-lane-token's internal revoke;pr-require-checks.yml's full-requirements install, which shares the step name "Install the pinned YAML reader" but installs the whole requirements file.Verification
shellcheckwith the repo's.shellcheckrcandshfmt -d.curlanswering 204 prints "the lane token is revoked" and exits 0;python3writes a requirements block byte-identical (cmp) to the old inlineawkoutput on the real file and passes the samepipflags;python3prints the given warning and exits 1.actionlinton the 8 workflows: clean.node scripts/check-artifact-retention.mjs: 152 upload steps match.node --test --test-concurrency=4on the 79 node test files that name these workflows, the step names orscripts/lib/: 6637/6637 pass.test_merge_holds_sync.py, which scrapes the scripts these workflows load: 21 passed..githubsuite (ci-status).Related
Part of restructuring pass #15695 (child R2-1). Blocks #15964 and #15966.
🤖 Generated with Claude Code