Repository navigation
test(release): supply the runner's GNU tools when release workflow tests run off Linux - #9138
Conversation
…sts run off Linux The release workflow tests execute release.yml's run scripts and the scripts they call, which assume ubuntu-latest. On macOS, `timeout` is missing and BSD `stat` rejects `-c`, so 87 tests failed in four files. Off Linux, the tests now prepend tests/helpers/gnu-runner-tools to PATH. It holds Node implementations of exactly the forms the scripts use: `timeout [--kill-after=D] D COMMAND...` and `stat -c FORMAT FILE...` with `%a`. Each refuses any other option. On Linux, PATH is unchanged. Two fixtures also depended on the host: the ordering fixture now starts on master as the runner's git does (Apple's git starts on main), and the maintenance git stub reads its caller's command line with ps where /proc is missing. release.yml and the scripts CI runs are unchanged.
Preview approval requiredThis pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit |
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — test-only PR with no blocking findings.
This PR adds Node stand-ins for GNU timeout and stat -c %a so npm run test:release-workflow passes off Linux, gated by runnerPath() to process.platform !== 'linux'. The reviewer verified the load-bearing new code: timeout's duration parse, detached process-group signaling, 124/125/126/127 exit codes and kill-after path, and stat's %a-only handling with & 0o7777 all match GNU behavior. The new gnu-runner-tools.test.cjs exercises both stand-in and system tools on Linux CI.
No wire surface touched (no static/schemas/source/**, docs/reference/**, dist/**, or package.json version edits), so no changeset is required — the author's claim holds. No schema↔docs coherence, oneOf, artifact-immutability, or governance concerns apply.
Gate checks: no critical/high/medium findings (row 1 N/A); gated_paths false (row 2 N/A); high_risk false (rows 3/5 N/A); no escalation category findings (row 4 N/A); no prior decision (row 6 N/A); no no-auto-approve team match (row 7 N/A); fewer than three medium findings (row 8 N/A). Falls through to row 9 → approve.
Note: review_decision is REVIEW_REQUIRED, but gated_paths is false, so row 2 does not fire.
The system timeout case failed on the runner: it exited 137 rather than dying by SIGKILL, and it took 20 s. ubuntu-latest is now Ubuntu 26.04, whose coreutils are uutils. Its timeout sends SIGKILL only to the command and then exits 137. GNU timeout also kills its process group, itself included, which a shell reports as 137 too; its manual says the two cases can't be distinguished. - The stand-in now exits 137 when the command dies by SIGKILL after the timeout, as GNU's status rule reads, instead of killing itself. - The test asserts the status a shell sees, 137, so it holds for the stand-in, uutils, and GNU. - The command execs sleep after `trap '' TERM`. Before, sh's child `sleep 30` ignored TERM too, outlived the KILL that reached only sh, and held stdout open until spawnSync's 20 s limit. The test now also checks that the case ends within 5 s.
Brings in 23 commits from main, among them the 3.2.12 hosted registration, the @adcp/sdk 17.0.0-beta.31 bump (adcontextprotocol#9132), the inventory-tenant creative library (adcontextprotocol#9116, adcontextprotocol#9143), the macOS runner tools for the release tests (adcontextprotocol#9138) and the hook split in adcontextprotocol#9126. The hooks stay as this branch has them: pre-commit runs the root suite, the staged-file-scoped server suite, the checks and the node:test files as one vitest run under a 120 s budget, and pre-push runs the storyboard queue under 180 s. With the shared workers, caches and queue, both fit in about 200 s on an M4 Pro, so this branch keeps the suites in the hooks. adcontextprotocol#9126's additive pieces stay: npm run verify:local and precommit-server-unit.cjs --full. Resolution ledger: - mechanical: package-lock.json -> main's (identical to main after the merge). - semantic: - package.json -> this branch's precommit script, plus main's verify:local. - .husky/pre-push (auto-merged) -> this branch's storyboard block; the matrix runs when its sources change, ADCP_SKIP_STORYBOARD_MATRIX=1 skips it. - .agents/playbook.md -> this branch's Local Hooks text, plus a verify:local paragraph; main's auto-merged hook description removed. - scripts/precommit-server-unit.cjs -> union: main's --full switch runs this branch's single-run full plan. - scripts/verify-local.cjs -> main's, with its header no longer saying the hooks run only fast checks. - server/tests/unit/training-agent-inventory-tenants.test.ts -> union: main's new cases with this branch's static import and state resets. - tests/cdn-artifacts, changesets-fence, maintenance-release-publication, release-publication-ordering -> union: this branch's git-env isolation, main's runnerPath() as the one GNU-tools mechanism; this branch's tests/helpers/gnu-tools.cjs and its shims are removed as unused.
npm run test:release-workflownow passes on macOS. The tests still run the exactrun:scripts from.github/workflows/release.ymland the scripts those steps call; off Linux, they now put small stand-ins for the two GNU tools those scripts need onPATH.Revised 2026-11-21: after
--kill-aftersends SIGKILL, the stand-in exits 137, and the test checks the status a shell sees, so it holds for GNU coreutils and for the uutilstimeoutonubuntu-latest.What failed and why
The release steps assume the
ubuntu-latestrunner. On macOS, 87 tests failed in four files:timeoutdoesn't exist.scripts/fence-changesets.cjswraps every git and gh call intimeout --kill-after=5s <limit>s, and the release inventory step runstimeout 60s gh api .... The fence reportedgit command failed or timed outand refused.statrejects-c.scripts/backfill-cdn-artifacts.shchecks the private immutable body withstat -c '%a', so publication refused.Two fixture details also depended on the host:
main, but git on the runner starts onmaster. The manual recovery test inrelease-publication-orderingcreatesmainitself, so it failed witha branch named 'main' already exists.maintenance-release-publicationreads its caller's command line from/proc, which macOS doesn't have.What the tests do now
tests/helpers/gnu-runner-tools/holds Node implementations oftimeout [--kill-after=D] D COMMAND...(duration suffixes, exit status passed through, 124 on timeout, SIGKILL after the grace period and then 137, 125/126/127 for its own errors, signals sent to the command's process group) andstat -c FORMAT FILE...with%a. Each one exits with an error on any other option or specifier.tests/helpers/gnu-runner-tools.cjsexportsrunnerPath(), which prepends that directory toPATHonly whenprocess.platform !== 'linux'. The four test files use it where they build the environment for the executed steps. On Linux,PATHis unchanged and the runner's own tools run.git init --initial-branch=master, which is what the runner's git does by default./proc/<ppid>/cmdlineon Linux and askspselsewhere.tests/gnu-runner-tools.test.cjstests the stand-ins through their command line: exit status pass-through, 124, 137 after--kill-after, 127, 125 for a bad interval or an unsupported option, and%afor plain and sticky modes. On Linux, the same cases also run against the systemtimeoutandstat. It's part oftest:release-workflow.I checked the other tools the executed scripts call (
sha256sum,shasum -a 256 -c,mktemp -d TEMPLATE,du -sk,find -type f,wc,cut,tail,date +%s,sleep 0.05), and they all behave the same on macOS, so they don't get stand-ins.flockis also missing on macOS, but no test runs the wrapper'sgit logpath that uses it, so it doesn't get one either..github/workflows/release.ymland every script CI runs are unchanged. This PR changes only test files and thetest:release-workflowscript, so it needs no changeset.Results on macOS
changesets-fencemaintenance-release-publicationrelease-publication-orderingcdn-artifactsgnu-runner-tools(new)The other files in
test:release-workflowpassed before and still pass.release-supersessionskips 2 tests, both before and after, because the supersession marker is already consumed.