-
-
Notifications
You must be signed in to change notification settings - Fork 181
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
Use Node 20, and add it to CI #5012
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…instead of canceling if another one failed
p2edwards
added
workflow
Related to development process
dependencies
Pull requests that update a dependency file
Front end
labels
Jul 15, 2024
Here's the error we were encountering when running mocha-chrome on Node >=17: ``` Promise Rejection: Error: connect ECONNREFUSED ::1:39193 at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1606:16) { errno: -111, code: 'ECONNREFUSED', syscall: 'connect', address: '::1', port: 39193 } ``` Here's the patch that fixes this for us: // node_modules/mocha-chrome/lib/client.js - const client = await CDP({ port: instance.port }); + const client = await CDP({ port: instance.port, host: '127.0.0.1' }); An alternative patch that would also succeed: // node_modules/chrome-remote-interface/lib/defaults.js - module.exports.HOST = 'localhost'; + module.exports.HOST = '127.0.0.1'; Another option: // node_modules/chrome-remote-interface/lib/external-request.js - const {address} = await util.promisify(dns.lookup)(options.host); + const {address} = await util.promisify(dns.lookup)( + options.host, + {family:'IPv4'}, + ); Thank you @nsainaney for writing this comment in nodejs/node#40702 [^1]: > It appears to be a breaking change with how DNS.lookup works. With > node 16, the lookup would return a IPv4 address but with node 17, it > returns an IPv6 address which will break most REST clients that > hardcode URLS like http://localhost:4040/api if the upstream server > only binds to the IPv4 address (e.g. server.listen('127.0.0.1'…) etc… [^1]: nodejs/node#40702 (comment) Before committing to the 'patch' strategy, I checked to see if either mocha-chrome or chrome-remote-interface had been updated later with this workaround. - chrome-remote-interface accepts a parameter for host, so nope. Makes sense, since you can specify the host manually. - mocha-chrome doesn't parameterize host, and the author of mocha-chrome considers it an obsolete package and is no longer updating it.
Main effect: Changes the default Node 20 and adds some new optional options. We specify Node version anyway.
p2edwards
changed the title
(WIP / TEST) Use Node 20.15.1, and add it to CI
(WIP) Use Node 20, and add it to CI
Aug 23, 2024
p2edwards
force-pushed
the
node-20-upgrade-CI-testing
branch
2 times, most recently
from
August 23, 2024 16:04
f2d7dcb
to
ee0d9fd
Compare
Use resolved version in the package cache instead of matrix specifier
p2edwards
force-pushed
the
node-20-upgrade-CI-testing
branch
from
August 23, 2024 16:16
ee0d9fd
to
375e092
Compare
p2edwards
changed the title
(WIP) Use Node 20, and add it to CI
Use Node 20, and add it to CI
Aug 23, 2024
Response to this warning: > The following actions uses node12 which is deprecated and will be forced to run on node16: actions/checkout@v2, actions/setup-python@v2. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
9 tasks
jnm
added a commit
to jnm/kobo-no-docker
that referenced
this pull request
Sep 26, 2024
jnm
added a commit
to jnm/kobo-no-docker
that referenced
this pull request
Sep 26, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
dependencies
Pull requests that update a dependency file
Front end
workflow
Related to development process
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Update Node version to 20.17.0 for release builds, and run the frontend tests in Node 20 and 22 in CI.
Related issues
Part of #4703
Notes for devs
fnm
ornvm
.Dockerfile
)npm
commands manually during their regular dev process, on their host machine not in the kpi container)Details for reviewer
Patches mocha-chrome to allow it to successfully run on Node >16 (see commit message)
Updates the recommended version of Node to v20.17.0 (the active LTS version, newest point release as of 2024-08-23)
.node-version
and.nvmrc
, supporting popular tooling such asnvm
andfnm
, which developers may use to conveniently switch to the recommended Node version for a given project on their dev machinenpm install
.Runs this version v20.17.0 in the CI npm tests, as well as any available newer Node 20 or Node 22.
Bumps various github action versions (actions/checkout, setup-node, setup-python), mainly to avoid deprecation warnings in CI output. Major changelogs look good to me.
Process notes
Like #4354 and #4554, test Node 20 upgrade.
troubleshooting steps
npm run watch
still works locallythe mocha-chrome problem
Like before, the mocha test runner was in node > 16.
Node 17 introduced some changes to
DNS.lookup
, which was the root cause of this timeout. See commit message for the fix.follow-up
Figure out if we want to pin a precise version of Node per release, or go with20
.(The
16.15.0
->16.15.1
breakage is probably not likely to happen again, but we like stability.)Conclusion: Pin it