Skip to content

devops: pin the Node.js major version of the driver in scripts/NODE_VERSION - #2038

Merged
Yury Semikhatsky (yury-s) merged 6 commits into
microsoft:mainfrom
yury-s:pin-node-version
Nov 3, 2026
Merged

Yury Semikhatsky (yury-s) merged 6 commits into
microsoft:mainfrom
yury-s:pin-node-version

Conversation

@yury-s

@yury-s Yury Semikhatsky (yury-s) commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

download_driver.sh picked the latest Node.js LTS at download time, so a new LTS major version could reach the driver without a commit.

  • Pin the Node.js major version in scripts/NODE_VERSION (26) and bump it manually, like ARG NODE_VERSION in the upstream Docker images. download_driver.sh reads the latest release of that major version from https://nodejs.org/dist/latest-v<major>.x/SHASUMS256.txt.
  • roll_driver.sh always runs download_driver.sh, so a roll picks up the latest release of the pinned major version even when the driver version is unchanged.
  • Install libatomic1 in the Docker images: the Node.js Linux binaries link against it since Node.js 25, and the jammy and noble images failed with libatomic.so.1: cannot open shared object file.
  • Run the Docker tests when NODE_VERSION changes, and mention the pin in the contributor docs.

download_driver.sh used to pick the latest Node.js LTS at download time, so
the same commit could assemble drivers with different Node.js binaries.
Pin the version in scripts/NODE_VERSION; roll_driver.sh moves it to the
latest LTS, the policy the upstream driver build script had.
…images

scripts/NODE_VERSION holds the major version (26) and download_driver.sh
downloads its latest release. roll_driver.sh moves the pin to the major
version of the latest Node.js LTS (see upstream
utils/build/update-playwright-node.mjs).
@yury-s Yury Semikhatsky (yury-s) changed the title devops: pin the Node.js version of the driver in scripts/NODE_VERSION devops: pin the Node.js major version of the driver in scripts/NODE_VERSION Nov 3, 2026
roll_driver.sh no longer moves NODE_VERSION. It always runs
download_driver.sh, which downloads the latest release of the pinned
major version, even when the driver version is unchanged.
Fetch https://nodejs.org/dist/latest-v<major>.x/SHASUMS256.txt through the
download() helper instead of parsing the whole release index with node, so
the lookup gets the same retries and wget fallback as the archives.
Shorten the help text and keep AGENTS.md unchanged.
Comment thread scripts/download_driver.sh Outdated
NODE_MAJOR_VERSION=$(head -1 ./NODE_VERSION)
NODE_VERSION=$(curl -fsSL "https://nodejs.org/dist/index.json" \
| node -e "let s='';process.stdin.on('data',d=>s+=d).on('end',()=>console.log(JSON.parse(s).find(r=>r.lts).version.slice(1)))")
| node -e "let s='';process.stdin.on('data',d=>s+=d).on('end',()=>console.log((JSON.parse(s).find(r=>r.version.startsWith('v$NODE_MAJOR_VERSION.'))||{version:'v'}).version.slice(1)))")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we can make this one more readable, that would be great! Like, fetch inside a node script maybe? Make it multiline 😄

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replaced the one-liner: the script now downloads https://nodejs.org/dist/latest-v<major>.x/SHASUMS256.txt through the existing download() helper and takes the version from the first file name with a sed capture group, with a sample line in a comment. That drops the node -e call and the full release index entirely.

@yury-s
Yury Semikhatsky (yury-s) merged commit bc1337e into microsoft:main Nov 3, 2026
18 of 21 checks passed
Yury Semikhatsky (yury-s) added a commit that referenced this pull request Nov 4, 2026
Yury Semikhatsky (yury-s) added a commit that referenced this pull request Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants