ci: the smoke job compares the floor, not the major number (#2488) #2497

Merged
jaylouisw merged 2 commits from fix/1124-0002 into main 2026-11-24 01:03:24 +00:00
Owner

Fixes #2488

#2491 landed the part the issue described: the smoke job downloads and asserts a floor runtime instead of using the runner image's Node 20. But the assertion it landed was a major-number test:

case "$(node --version)" in
  v22.*|v23.*|v24.*|v25.*|v26.*) ;;
  *) echo "::error ... below the 22.18 floor the repo declares"; exit 1 ;;
esac

That accepts 22.0.0 through 22.17.9, every one of which is below the floor and is exactly the runtime that cannot require('./segment.ts') - the failure the step was added to catch, reported as a pass. The same block stood in the Typecheck job.

The comparison now lives once, in scripts/check-node-floor.js: it reads the >=X.Y.Z form out of engines.node, compares three numbers, refuses a spec or a version it cannot parse (never "at or above"), and takes --title so each job keeps the ::error title= tag that names the check. Both jobs call it; the pinned tarball and the symlink-over are untouched.

test/node-floor.test.js (12 assertions) holds it: 22.17.9 and 21.99.0 refused, 22.18.0 and 22.20.0 accepted, v22.23.5 accepted, 22 / v22.18 / banana refused, the job title reaches the log, the smoke job provisions its runtime before it starts the smoke client, and no case "$(node --version)" line comes back to ci.yml.

Verified: node scripts/syntax-check.js 555 files (550 JavaScript, 5 TypeScript); node-floor 12, ci-disk-hygiene 13, classify-change 6, node-surface 8, doc-citations 11 - 50 assertions, 0 failures; audit-port-types, audit-devices and check-control-bytes.ts clean. The 472-suite full run does not fit this host's 420 s foreground cap and background node is unusable here (the wrapper prints stdin is not a tty and exits 1), so the whole suite is left to CI.

Fixes #2488 #2491 landed the part the issue described: the smoke job downloads and asserts a floor runtime instead of using the runner image's Node 20. But the assertion it landed was a major-number test: ```sh case "$(node --version)" in v22.*|v23.*|v24.*|v25.*|v26.*) ;; *) echo "::error ... below the 22.18 floor the repo declares"; exit 1 ;; esac ``` That accepts 22.0.0 through 22.17.9, every one of which is below the floor and is exactly the runtime that cannot `require('./segment.ts')` - the failure the step was added to catch, reported as a pass. The same block stood in the `Typecheck` job. The comparison now lives once, in `scripts/check-node-floor.js`: it reads the `>=X.Y.Z` form out of `engines.node`, compares three numbers, refuses a spec or a version it cannot parse (never "at or above"), and takes `--title` so each job keeps the `::error title=` tag that names the check. Both jobs call it; the pinned tarball and the symlink-over are untouched. `test/node-floor.test.js` (12 assertions) holds it: 22.17.9 and 21.99.0 refused, 22.18.0 and 22.20.0 accepted, `v22.23.5` accepted, `22` / `v22.18` / `banana` refused, the job title reaches the log, the smoke job provisions its runtime before it starts the smoke client, and no `case "$(node --version)"` line comes back to ci.yml. Verified: `node scripts/syntax-check.js` 555 files (550 JavaScript, 5 TypeScript); node-floor 12, ci-disk-hygiene 13, classify-change 6, node-surface 8, doc-citations 11 - 50 assertions, 0 failures; `audit-port-types`, `audit-devices` and `check-control-bytes.ts` clean. The 472-suite full run does not fit this host's 420 s foreground cap and background node is unusable here (the wrapper prints `stdin is not a tty` and exits 1), so the whole suite is left to CI.
ci: the smoke job compares the floor, not the major number (#2488)
Some checks failed
CI / Typecheck (pull_request) Successful in 18s
CI / Server smoke and Docker build (pull_request) Successful in 44s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 6s
CI / Test (Node 22) (pull_request) Failing after 51s
CI / Test (Node 24) (pull_request) Failing after 54s
CI / Arm auto-merge (pull_request) Successful in 9s
2e3256170d
#2491 gave the smoke and typecheck jobs a pinned runtime and an assertion. The
assertion was `case "$(node --version)" in v22.*|v23.*|...)`, which is a
major-number test wearing the floor's name: it accepts 22.0.0 through 22.17.9,
every one of which is below the 22.18 floor and is exactly the runtime that
cannot `require('./segment.ts')`. A step that names 22.18 in its message while
comparing the major number reports the floor as held when it is not.

Both jobs now call `scripts/check-node-floor.js`, which parses the `>=X.Y.Z`
form out of `engines.node`, compares the running interpreter - or a `--version`
given on the command line - as three numbers, and refuses anything it cannot
parse rather than reading it as "at or above". `--title` keeps the `::error
title=` tag each job put on the check, so the log still names what failed.

`test/node-floor.test.js` holds the shape: 22.17.9 and 21.99.0 refused, 22.18.0
and 22.20.0 accepted, `v22.23.5` accepted, `22`/`v22.18`/`banana` refused, the
title in the log, and no `case "$(node --version)"` back in ci.yml.

docs/CI.md says what the smoke job runs on.
test(node-floor): say that skipping a comment is control flow, not an exemption
All checks were successful
CI / Typecheck (pull_request) Successful in 25s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 18s
CI / Server smoke and Docker build (pull_request) Successful in 56s
CI / Test (Node 22) (pull_request) Successful in 56s
CI / Test (Node 24) (pull_request) Successful in 1m1s
CI / Arm auto-merge (pull_request) Successful in 4s
486fb70752
skip-audit flagged the new suite: `if (/^\s*#/.test(line)) continue` matches its exemption
pattern because the condition calls .test(), and the census counts it as an unnamed
exemption. It is nothing of the sort - the scan is looking for the shell line that declares
the runtime, and a comment cannot be one - so it says so in the words the guard looks for.
forgejo-actions scheduled this pull request to auto merge when all checks succeed 2026-11-24 01:02:45 +00:00
Sign in to join this conversation.
No description provided.