Skip to content

ci: pin Node to exact patched versions via central env vars#1145

Open
BYK wants to merge 2 commits into
mainfrom
byk/ci/pin-node-versions
Open

ci: pin Node to exact patched versions via central env vars#1145
BYK wants to merge 2 commits into
mainfrom
byk/ci/pin-node-versions

Conversation

@BYK

@BYK BYK commented Jun 26, 2026

Copy link
Copy Markdown
Member

Summary

Follow-up to d7175e2, which pinned only the skill-eval E2E job to 24.18.0. Every other actions/setup-node step still floated a bare major ("22"/"24") and would silently reuse the runner's pre-cached buggy patch (24.17.0 / 22.23.0).

Those patches shipped CVE-2026-48931's http.Agent fix, which added a data listener on idle agent sockets that makes keep-alive fetch reuse throw false ERR_STREAM_PREMATURE_CLOSE ("Premature close"). It's fixed in 24.18.0 and 22.23.1 (nodejs/node#64004http: avoid stream listeners on idle agent sockets).

What changed

Centralized the Node version into per-workflow env vars (NODE_VERSION_22 / NODE_VERSION_24) as a single source of truth, and pinned the exact patched releases everywhere:

Workflow Jobs touched Version
ci.yml all "22"/"24" setup-node steps (incl. build-binary, build-docs, test-e2e) + build-npm matrix 22.23.1 / 24.18.0
release.yml release (publishes over HTTPS) 22.23.1
sentry-release.yml finalize (installs + uploads over HTTPS) 22.23.1
docs-preview.yml docs build 24.18.0
eval-skill-fork.yml fork skill-eval job — added the missing setup-node step 24.18.0

The build-npm matrix keeps bare-major labels (["22", "24"]) for the job name and the matrix.node == '22' artifact guard, mapping each label to its exact env-pinned version in the step.

build-binary is included in the ci.yml repin (its setup-node went from "22"${{ env.NODE_VERSION_22 }}). It runs the binary build via pnpm tsx script/build.ts (esbuild + fossilize — pure Node, no Bun), so the pinned Node from setup-node is what drives it. (An earlier revision of this description incorrectly said build-binary was unaffected and used Bun — that was wrong on both counts.)

The fork skill-eval workflow (eval-skill-fork.yml) had set up pnpm but never ran setup-node at all, so pnpm install, generate:docs, and eval:skill ran on the runner's floating Node — the exact unpinned path this PR exists to close, and the one most likely to hit the ERR_STREAM_PREMATURE_CLOSE regression (the skill-eval planner talks to external APIs over keep-alive fetch). Added a workflow-level NODE_VERSION_24 and a pinned setup-node step mirroring the non-fork job.

Validation

  • actionlint passes with zero new findings vs main (pre-existing shellcheck style infos unchanged), including the updated eval-skill-fork.yml.
  • All five workflows parse as valid YAML.

Follow-up to d7175e2 (which pinned only the skill-eval E2E job). Every
other actions/setup-node step still floated a bare major ("22"/"24") and
would silently reuse the runner's pre-cached buggy patch (24.17.0 /
22.23.0). Those carry CVE-2026-48931's http.Agent fix, which added a
`data` listener on idle sockets that makes keep-alive fetch reuse throw
false ERR_STREAM_PREMATURE_CLOSE — fixed in 24.18.0 / 22.23.1
(nodejs/node#64004).

Centralize the versions as per-workflow env vars (NODE_VERSION_22 /
NODE_VERSION_24) so each file has a single source of truth, and pin the
exact patched releases:

- ci.yml: all 22/24 setup-node steps + the build-npm matrix (mapped from
  bare-major labels so the `matrix.node == '22'` artifact guard still works)
- release.yml, sentry-release.yml: 22.23.1 (publish/upload over HTTPS)
- docs-preview.yml: 24.18.0

Validated with actionlint (no new findings vs main).
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Jun 26, 2026
@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://cli.sentry.dev/_preview/pr-1145/

Built to branch gh-pages at 2026-06-26 14:13 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Codecov Results 📊

✅ Patch coverage is 100.00%. Project has 5115 uncovered lines.
❌ Project coverage is 81.52%. Comparing base (base) to head (head).

Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
- Coverage    81.53%    81.52%    -0.01%
==========================================
  Files          397       397         —
  Lines        27679     27679         —
  Branches     17966     17966         —
==========================================
+ Hits         22566     22564        -2
- Misses        5113      5115        +2
- Partials      1868      1868         —

Generated by Codecov Action

The eval-skill-fork.yml `eval` job set up pnpm but never ran
actions/setup-node, so pnpm install, generate:docs, and eval:skill all
ran on the runner's floating Node — the exact unpinned path this PR
exists to eliminate, and the one most likely to hit the false
ERR_STREAM_PREMATURE_CLOSE (the skill-eval planner talks to external
APIs over keep-alive fetch).

Add a workflow-level NODE_VERSION_24 env var and an actions/setup-node
step pinned to it, mirroring the non-fork skill-eval job in ci.yml.
Validated with actionlint (no findings).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant