Skip to content

Handle prerelease Node.js versions without failing worker initialization - #843

Open
Tsuyoshi Ushio (TsuyoshiUshio) wants to merge 1 commit into
v3.xfrom
fix/prerelease-node-version-warning
Open

Handle prerelease Node.js versions without failing worker initialization#843
Tsuyoshi Ushio (TsuyoshiUshio) wants to merge 1 commit into
v3.xfrom
fix/prerelease-node-version-warning

Conversation

@TsuyoshiUshio

Copy link
Copy Markdown
Contributor

Summary

  • parse Node.js runtime versions with the existing semver dependency
  • warn for valid prerelease versions instead of failing worker initialization
  • preserve the parse error for invalid version strings

Fixes #842.

Why

The worker's version check split process.version on . and required exactly three components. A valid prerelease such as v26.8.0-alpha.0.0.0 therefore caused WorkerInitRequest to fail before the worker could start.

This behavior was exposed by the Azure Functions Docker hotfix PR:
https://dev.azure.com/msazure/One/_git/AAPT-Antares-Functions-Docker/pullrequest/16949790

The root problem is not in the worker: NodeSource package 26.8.0-1nodesource1 appeared to be a stable package version, but its installed Node binary reported v26.8.0-alpha.0.0.0. Production images expecting stable Node.js must still reject that artifact. This worker change is defense in depth so diagnostic version validation does not make the language worker unavailable for a syntactically valid prerelease version.

Tests

Red before the implementation:

Error: Could not parse Node.js version: 'v26.8.0-alpha.0.0.0'

Validated with fnm Node.js v22.22.3:

  • npm run build
  • npm run lint
  • focused getNodeVersionLog tests: 4 passing
  • full suite: 147 passing, 8 pending, 3 unrelated timing failures
  • the 3 failed existing cases passed when rerun alone

Fixes #842

Co-authored-by: Dobby <dobby@microsoft.com>
@TsuyoshiUshio

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

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.

Handle valid prerelease Node.js versions without failing worker initialization

1 participant