Skip to content

[build] update node versioning for testing and publishing - #17866

Merged
titusfortner merged 3 commits into
trunkfrom
node-version-release-compat
Aug 3, 2026
Merged

[build] update node versioning for testing and publishing#17866
titusfortner merged 3 commits into
trunkfrom
node-version-release-compat

Conversation

@titusfortner

Copy link
Copy Markdown
Member

💥 What does this PR do?

  • Adds JavaScript CI that runs the unit tests on the oldest and newest supported Node versions.
  • Documents the Node.js support policy (supported = under active upstream support) and raises the minimum to Node 22, dropping now-EOL Node 20.
  • Fixes the release so selenium-webdriver publishes with npm 11, which npm trusted publishing (OIDC) requires.

🔧 Implementation Notes

  • The Node version now comes from //:.nvmrc read by the Bazel toolchain, so CI can pin a version per job the same way rb/.ruby-version and py/.python-version do. The shared CI step writes .nvmrc instead of installing a system Node, which had no effect since build/test/publish all run on the hermetic toolchain.
  • The release publishes on Node 24.14.1 (npm 11.11.0); trusted publishing needs npm >= 11.5.1, and the previous system-Node setup never reached the hermetic npm publish.
  • Node 26 is supported but not yet in any rules_nodejs release, so CI tests the newest version rules_nodejs ships (24.x) until it lands.

🤖 AI assistance

  • AI assisted (complete below)
    • Tool(s): Claude Code (Claude Opus)
    • What was generated: the CI workflow, the Bazel/MODULE and workflow edits, and the README policy, iterated with review
    • I reviewed all AI output and can explain the change

🔄 Types of changes

  • Bug fix (backwards compatible)
  • New feature (non-breaking change which adds functionality and tests!)

@selenium-ci selenium-ci added C-nodejs JavaScript Bindings B-build Includes scripting, bazel and CI integrations labels Aug 3, 2026
@qodo-code-review

Copy link
Copy Markdown
Contributor

PR Summary by Qodo

Add Node-version-matrix JS CI and pin npm 11 publishing via Bazel toolchain

✨ Enhancement 🐞 Bug fix 📝 Documentation ⚙️ Configuration changes 🕐 20-40 Minutes

Grey Divider

AI Description

• Add a JavaScript CI workflow running Bazel build and unit tests on oldest/newest supported Node.
• Switch CI/release Node selection to write .nvmrc, letting rules_nodejs pick the hermetic
 toolchain.
• Raise JS minimum Node to 22 and document an EOL-based Node support policy; pin release to Node
 24.14.1.
Diagram

graph TD
  A["GitHub CI (ci.yml)"] --> B["CI - JavaScript (ci-javascript.yml)"] --> C["Reusable Bazel job (bazel.yml)"] --> D[".nvmrc"] --> E["rules_nodejs toolchain"] --> F["Bazel JS build/tests"]
  G["Release workflow (release.yml)"] --> C
  subgraph Legend
    direction LR
    _wf["Workflow"] ~~~ _cfg["Config file"] ~~~ _tc["Toolchain"]
  end
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Continue using actions/setup-node for publish/test
  • ➕ Simple and familiar GitHub Actions pattern
  • ➕ Avoids .nvmrc file writes in workflows
  • ➖ Does not affect Bazel hermetic toolchain unless explicitly wired through, risking version drift
  • ➖ Harder to guarantee npm 11 for the actual bazel-executed publish step
2. Pin Node versions directly in MODULE.bazel (no `.nvmrc`)
  • ➕ Single source of truth inside Bazel config
  • ➕ No CI workflow mutation of files
  • ➖ Harder to vary Node per CI job (matrix) without additional Bazel plumbing
  • ➖ Less consistent with existing repo pattern of version files per language/toolchain
3. Use a tool-versions manager (e.g., asdf) for Node pinning
  • ➕ Unified version management across languages for developer workstations
  • ➖ Still doesn’t inherently control Bazel’s hermetic toolchain selection
  • ➖ Adds another tool/dependency surface area for contributors and CI

Recommendation: The chosen approach (drive rules_nodejs via .nvmrc and have CI write it per job) is the best fit because it aligns the actual build/test/publish runtime with Bazel’s hermetic toolchain, while still enabling a Node version matrix in CI and ensuring npm 11 for trusted publishing. The main review focus should be on ensuring no other workflows depend on system-installed Node and that the .nvmrc override is scoped only to jobs that need it.

Files changed (8) +66 / -20

Enhancement (1) +1 / -1
package.jsonBump 'engines.node' minimum to >=22 +1/-1

Bump 'engines.node' minimum to >=22

• Raises the Node engine constraint from >=20 to >=22 to match the documented support policy and CI expectations.

javascript/selenium-webdriver/package.json

Bug fix (1) +1 / -1
release.ymlPin JS release Node to 24.14.1 for npm 11 trusted publishing +1/-1

Pin JS release Node to 24.14.1 for npm 11 trusted publishing

• Changes the JavaScript publish job to request an explicit Node version (24.14.1) rather than a major-only '24'. This makes the hermetic toolchain provide a sufficiently new npm 11 for OIDC trusted publishing.

.github/workflows/release.yml

Documentation (1) +13 / -10
README.mdDocument Node support policy and raise minimum to Node 22 +13/-10

Document Node support policy and raise minimum to Node 22

• Updates the stated minimum Node requirement from 20 to 22 and rewrites the support policy to be based on upstream active support through EOL. Adds a concise table of supported major versions and clarifies CI coverage expectations.

javascript/selenium-webdriver/README.md

Other (5) +51 / -8
bazel.ymlSwitch Node selection from setup-node to '.nvmrc' override +3/-5

Switch Node selection from setup-node to '.nvmrc' override

• Replaces 'actions/setup-node' with a step that writes the requested Node version into '.nvmrc'. This ensures Bazel’s rules_nodejs toolchain (not the runner’s system Node) determines the Node/npm version used by build/test/publish.

.github/workflows/bazel.yml

ci-javascript.ymlAdd JS CI workflow with Node oldest/newest test matrix +36/-0

Add JS CI workflow with Node oldest/newest test matrix

• Introduces a JavaScript-specific workflow that builds the selenium-webdriver target and runs unit tests on a Node version matrix (oldest and newest supported versions available in rules_nodejs). Uses the shared Bazel workflow and passes a pinned Node version per matrix entry.

.github/workflows/ci-javascript.yml

ci.ymlWire JavaScript into top-level CI orchestration +10/-2

Wire JavaScript into top-level CI orchestration

• Adds '//javascript/...' to the target discovery set and includes a new 'javascript' job that calls the JS CI workflow when JS targets are present. Updates the CI success aggregator to include the new job.

.github/workflows/ci.yml

.nvmrcAdd repository Node pin for rules_nodejs toolchain +1/-0

Add repository Node pin for rules_nodejs toolchain

• Adds a default '.nvmrc' value (22.22.0) used by the Bazel Node toolchain when CI does not override it. Establishes a shared version file that workflows can update per job.

.nvmrc

MODULE.bazelRead Node toolchain version from '.nvmrc' +1/-1

Read Node toolchain version from '.nvmrc'

• Updates rules_nodejs toolchain configuration to use 'node_version_from_nvmrc = "//:.nvmrc"' instead of a hardcoded Node version. This enables CI and release jobs to control the hermetic Node version by setting '.nvmrc'.

MODULE.bazel

@qodo-code-review

qodo-code-review Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Node 20 dropped without deprecation ✗ Dismissed 📘 Rule violation ⚙ Maintainability
Description
The PR raises the minimum supported Node version to 22, which removes the ability for users on Node
20 to use selenium-webdriver without providing a deprecation notice and an explicit alternative
path for those users. This can cause unexpected breakage for downstream consumers still pinned to
Node 20.
Code

javascript/selenium-webdriver/package.json[R22-24]

  "engines": {
-    "node": ">= 20.0.0"
+    "node": ">= 22.0.0"
  },
Evidence
PR changes the published engine constraint to node >= 22.0.0 and updates the README to state
Requires Node.js >= 22, which effectively removes support for Node 20; no deprecation period or
alternative (e.g., “pin to last version supporting Node 20”) is provided alongside this removal.

AGENTS.md: Deprecate Public Functionality Before Removal
javascript/selenium-webdriver/package.json[22-24]
javascript/selenium-webdriver/README.md[6-79]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The PR changes the public runtime requirement from Node 20+ to Node 22+, but does not include a deprecation notice (ahead of removal) or clear guidance for users who cannot yet upgrade Node.

## Issue Context
Compliance requires public functionality to be deprecated (with an alternative) before it is removed. For a runtime support drop, the “alternative” is typically: upgrade Node, or pin to the last `selenium-webdriver` version that supports the older Node.

## Fix Focus Areas
- javascript/selenium-webdriver/README.md[6-9]
- javascript/selenium-webdriver/README.md[64-80]
- javascript/selenium-webdriver/package.json[22-24]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

To customize comments, go to the Qodo configuration screen, or learn more in the docs.

Qodo Logo

Comment thread javascript/selenium-webdriver/package.json
@titusfortner titusfortner changed the title [build] test JavaScript on oldest and newest supported Node and publish on npm 11 [build] update node versioning for testing and publishing Aug 3, 2026
@qodo-code-review

Copy link
Copy Markdown
Contributor

Code review by qodo was updated up to the latest commit 6e671d1

@qodo-code-review

Copy link
Copy Markdown
Contributor

Code review by qodo was updated up to the latest commit e1da78c

@titusfortner
titusfortner merged commit 5ae1a8e into trunk Aug 3, 2026
62 checks passed
@titusfortner
titusfortner deleted the node-version-release-compat branch August 3, 2026 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

B-build Includes scripting, bazel and CI integrations C-nodejs JavaScript Bindings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants