Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v14.x] build: pin build-docs workflow to Node.js 14 #40939

Closed
wants to merge 1 commit into from

Conversation

richardlau
Copy link
Member

The build-docs workflow runs tests which means it is sensitive to
globals and can fail if the node running the test has a different
set of globals to that expected by test/common.

e.g failure on current v14.x-staging
https://github.com/nodejs/node/runs/4301335343?check_suite_focus=true

=== release test-apilinks ===
Path: doctool/test-apilinks
Error: --- stderr ---
node:assert:171
  throw err;
  ^

AssertionError [ERR_ASSERTION]: Unexpected global(s) found: performance
    at process.<anonymous> (/home/runner/work/node/node/test/common/index.js:302:14)
    at process.emit (node:events:402:35) {
  generatedMessage: false,
  code: 'ERR_ASSERTION',
  actual: undefined,
  expected: undefined,
  operator: 'fail'
}
Command: /opt/hostedtoolcache/node/16.13.0/x64/bin/node /home/runner/work/node/node/test/doctool/test-apilinks.mjs

compare to

node/test/common/index.js

Lines 253 to 262 in 0682370

let knownGlobals = [
clearImmediate,
clearInterval,
clearTimeout,
global,
setImmediate,
setInterval,
setTimeout,
queueMicrotask,
];

The build-docs workflow runs tests which means it is sensitive to
globals and can fail if the `node` running the test has a different
set of globals to that expected by `test/common`.
@nodejs-github-bot nodejs-github-bot added meta Issues and PRs related to the general management of the project. v14.x labels Nov 23, 2021
Copy link
Contributor

@aduh95 aduh95 left a comment

Choose a reason for hiding this comment

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

Another solution would be to backport those checks:

node/test/common/index.js

Lines 279 to 301 in d0fa1e9

if (global.AbortController)
knownGlobals.push(global.AbortController);
if (global.gc) {
knownGlobals.push(global.gc);
}
if (global.performance) {
knownGlobals.push(global.performance);
}
if (global.PerformanceMark) {
knownGlobals.push(global.PerformanceMark);
}
if (global.PerformanceMeasure) {
knownGlobals.push(global.PerformanceMeasure);
}
// TODO(@ethan-arrowood): Similar to previous checks, this can be temporary
// until v16.x is EOL. Once all supported versions have structuredClone we
// can add this to the list above instead.
if (global.structuredClone) {
knownGlobals.push(global.structuredClone);
}

@richardlau
Copy link
Member Author

Another solution would be to backport those checks:

node/test/common/index.js

Lines 279 to 301 in d0fa1e9

if (global.AbortController)
knownGlobals.push(global.AbortController);
if (global.gc) {
knownGlobals.push(global.gc);
}
if (global.performance) {
knownGlobals.push(global.performance);
}
if (global.PerformanceMark) {
knownGlobals.push(global.PerformanceMark);
}
if (global.PerformanceMeasure) {
knownGlobals.push(global.PerformanceMeasure);
}
// TODO(@ethan-arrowood): Similar to previous checks, this can be temporary
// until v16.x is EOL. Once all supported versions have structuredClone we
// can add this to the list above instead.
if (global.structuredClone) {
knownGlobals.push(global.structuredClone);
}

I don't think we'd want to allow accidentally introducing new globals into LTS though.

@richardlau richardlau added the fast-track PRs that do not need to wait for 48 hours to land. label Nov 24, 2021
@github-actions
Copy link
Contributor

Fast-track has been requested by @richardlau. Please 👍 to approve.

richardlau added a commit that referenced this pull request Nov 24, 2021
The build-docs workflow runs tests which means it is sensitive to
globals and can fail if the `node` running the test has a different
set of globals to that expected by `test/common`.

PR-URL: #40939
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
@richardlau
Copy link
Member Author

Landed in fb0af94

@richardlau richardlau closed this Nov 24, 2021
@richardlau richardlau deleted the workflow-v14.x branch November 24, 2021 14:30
@@ -11,7 +11,7 @@ on:
- v[0-9]+.x

env:
NODE_VERSION: lts/*
NODE_VERSION: 14
Copy link
Member

Choose a reason for hiding this comment

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

Probably would be good to include a comment so people don't update it to lts/* subsequently.

Copy link
Member

Choose a reason for hiding this comment

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

Oh, wait, this is on the 14.x-staging branch. Yeah, that (probably) doesn't need a comment.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm undecided about whether to land something similar on later release lines or master. At least 14 is in maintenance which means we have no plans to introduce new globals.

richardlau added a commit that referenced this pull request Nov 25, 2021
The build-docs workflow runs tests which means it is sensitive to
globals and can fail if the `node` running the test has a different
set of globals to that expected by `test/common`.

PR-URL: #40939
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
@richardlau richardlau mentioned this pull request Nov 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fast-track PRs that do not need to wait for 48 hours to land. meta Issues and PRs related to the general management of the project.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants