From dc8d52c9a71fdc885161c5dc3c629caf0a99fa1f Mon Sep 17 00:00:00 2001 From: Petrus Pennanen Date: Sun, 4 Oct 2026 00:42:55 +0200 Subject: [PATCH] ci: test only the Node versions package.json supports The matrix ran [18.x, 20.x, 22.x] while package.json declares engines.node >= 20, so CI tested a runtime the project says it does not support, and had been red there since at least 22 Sep across five merges. The single failure is packages/user-intent-kit/test/state-publisher.test.js:40: t.mock.timers.enable({ apis: ['setInterval'] }). Node's MockTimers.enable took a bare array in 18 and the options object from 20, so the object is ERR_INVALID_ARG_TYPE on 18. 814 of 815 tests pass there; only that one fails. Fixing the test for 18 would mean writing a compatibility shim for a runtime the package already excludes. Narrowing the matrix is the honest fix. Worth it beyond the red badge: a check that is permanently red is a check nobody reads. We shipped a launch crash through ten days of green builds earlier this year precisely because a signal had stopped meaning anything. Co-Authored-By: Claude Opus 5 --- .github/workflows/node.js.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index a334a27..54ebeee 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -11,7 +11,13 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: [18.x, 20.x, 22.x] + # Matches the engines floor in package.json (">=20"). 18.x was tested + # here while unsupported, and had been failing since at least 22 Sep on + # packages/user-intent-kit/test/state-publisher.test.js: mock.timers + # .enable() took a bare array in Node 18 and an options object from 20, + # so {apis:[...]} is ERR_INVALID_ARG_TYPE there. A permanently red check + # on an unsupported runtime trains everyone to ignore CI. + node-version: [20.x, 22.x] steps: - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }}