Skip to content

test(release): supply the runner's GNU tools when release workflow tests run off Linux - #9138

Merged
bokelley merged 2 commits into
adcontextprotocol:mainfrom
KonstantinMirin:test/release-workflow-macos
Nov 21, 2026
Merged

bokelley merged 2 commits into
adcontextprotocol:mainfrom
KonstantinMirin:test/release-workflow-macos

Conversation

@KonstantinMirin

@KonstantinMirin KonstantinMirin commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

npm run test:release-workflow now passes on macOS. The tests still run the exact run: scripts from .github/workflows/release.yml and the scripts those steps call; off Linux, they now put small stand-ins for the two GNU tools those scripts need on PATH.

Revised 2026-11-21: after --kill-after sends SIGKILL, the stand-in exits 137, and the test checks the status a shell sees, so it holds for GNU coreutils and for the uutils timeout on ubuntu-latest.

What failed and why

The release steps assume the ubuntu-latest runner. On macOS, 87 tests failed in four files:

  • timeout doesn't exist. scripts/fence-changesets.cjs wraps every git and gh call in timeout --kill-after=5s <limit>s, and the release inventory step runs timeout 60s gh api .... The fence reported git command failed or timed out and refused.
  • BSD stat rejects -c. scripts/backfill-cdn-artifacts.sh checks the private immutable body with stat -c '%a', so publication refused.

Two fixture details also depended on the host:

  • Apple's git starts a new repository on main, but git on the runner starts on master. The manual recovery test in release-publication-ordering creates main itself, so it failed with a branch named 'main' already exists.
  • The git stub in maintenance-release-publication reads 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 of timeout [--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) and stat -c FORMAT FILE... with %a. Each one exits with an error on any other option or specifier.
  • tests/helpers/gnu-runner-tools.cjs exports runnerPath(), which prepends that directory to PATH only when process.platform !== 'linux'. The four test files use it where they build the environment for the executed steps. On Linux, PATH is unchanged and the runner's own tools run.
  • The ordering fixture runs git init --initial-branch=master, which is what the runner's git does by default.
  • The maintenance git stub reads /proc/<ppid>/cmdline on Linux and asks ps elsewhere.
  • tests/gnu-runner-tools.test.cjs tests 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 %a for plain and sticky modes. On Linux, the same cases also run against the system timeout and stat. It's part of test: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. flock is also missing on macOS, but no test runs the wrapper's git log path that uses it, so it doesn't get one either.

.github/workflows/release.yml and every script CI runs are unchanged. This PR changes only test files and the test:release-workflow script, so it needs no changeset.

Results on macOS

File Before (pass/total) After
changesets-fence 28/76 76/76
maintenance-release-publication 94/118 118/118
release-publication-ordering 71/80 80/80
cdn-artifacts 12/18 18/18
gnu-runner-tools (new) 8/8

The other files in test:release-workflow passed before and still pass. release-supersession skips 2 tests, both before and after, because the supersession marker is already consumed.

…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.
@mintlify

mintlify Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Preview approval required

This pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit 8c6d246.

Approve preview

aao-secretariat[bot]
aao-secretariat Bot previously approved these changes Nov 20, 2026

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-approval: no reviewable delta since the prior approval; re-submitting after stale-review dismissal.

@bokelley
bokelley merged commit a40fbe3 into adcontextprotocol:main Nov 21, 2026
59 checks passed
KonstantinMirin added a commit to KonstantinMirin/adcp that referenced this pull request Nov 21, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants