Skip to content

Enforce the pinned Node version for local and deploy builds of trusted-server-js #1266

Open

Description

@dhruv8sh

Description

#1204 / #1257 pin Node for CI only. No workflow builds the deployed artifacts: fastly compute publish, spin build and wrangler deploy all run the cargo build on the operator's machine, and crates/trusted-server-js/build.rs runs npm ci / npm run build with whatever npm is on PATH, with no version check. crates/trusted-server-js/lib/package.json has no engines field and there is no .nvmrc, so deployed bundles can be built with any Node version.

Local drift already happens: under Node 26, 27 Permutive/Sourcepoint Vitest tests fail because Node's built-in localStorage hides jsdom's, while the pinned 24.12.0 passes.

Options:

  • Add engines.node to lib/package.json together with engine-strict=true in lib/.npmrc.
  • Have build.rs compare node --version with the nodejs entry in .tool-versions and warn or fail on a mismatch (with an escape hatch for intentional overrides).

Raised in review of #1257: #1257 (comment)

Done when

  • A local or deploy build with a Node version other than the .tool-versions pin warns or fails with clear instructions.
  • The pinned version is defined in one place (.tool-versions) and the check reads it from there.
  • CI keeps passing with the pinned Node, and the escape hatch (if any) is documented.

Affected area

JS build pipeline

Activity

  1. self-assigned this
    on Oct 10, 2026
  2. added theissue type on Oct 10, 2026
  3. dhruv8sh commented on Oct 15, 2026

    @dhruv8sh
    CollaboratorAuthor

    When option 2 lands (build.rs compares node --version with the nodejs entry in .tool-versions and fails the build on a mismatch), delete the CI Node pin guard added in #1257: scripts/check-ci-node-pin.py and its step in .github/workflows/format.yml. The build check covers everything the guard does, plus cases the guard's parser can't see (flow-style steps, scripts reached through $GITHUB_WORKSPACE/… or a working-directory, a later setup-node that changes the version). We shouldn't keep both by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions