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

Use Node 20, and add it to CI #5012

Merged
merged 12 commits into from
Aug 30, 2024
Merged

Use Node 20, and add it to CI #5012

merged 12 commits into from
Aug 30, 2024

Commits on Jul 15, 2024

  1. Configuration menu
    Copy the full SHA
    f80be70 View commit details
    Browse the repository at this point in the history
  2. Let each Node CI run finish independently

    …instead of canceling if another one failed
    p2edwards committed Jul 15, 2024
    Configuration menu
    Copy the full SHA
    cfce973 View commit details
    Browse the repository at this point in the history

Commits on Jul 16, 2024

  1. Make tests run in Node >=17. Wow…

    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.
    p2edwards committed Jul 16, 2024
    Configuration menu
    Copy the full SHA
    7c6dfec View commit details
    Browse the repository at this point in the history
  2. Add comments to npm-test

    p2edwards committed Jul 16, 2024
    Configuration menu
    Copy the full SHA
    6975b22 View commit details
    Browse the repository at this point in the history

Commits on Aug 12, 2024

  1. Configuration menu
    Copy the full SHA
    6c57024 View commit details
    Browse the repository at this point in the history

Commits on Aug 23, 2024

  1. Configuration menu
    Copy the full SHA
    25f8558 View commit details
    Browse the repository at this point in the history
  2. Bump various github-provided actions to v4

    Main effect: Changes the default Node 20 and adds some new optional
    options.
    
    We specify Node version anyway.
    p2edwards committed Aug 23, 2024
    Configuration menu
    Copy the full SHA
    c543376 View commit details
    Browse the repository at this point in the history
  3. improve comment

    p2edwards committed Aug 23, 2024
    Configuration menu
    Copy the full SHA
    fcc3a3e View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    56e5f47 View commit details
    Browse the repository at this point in the history
  5. Run latest, unpinned versions of Node in CI, too

    Use resolved version in the package cache instead of matrix specifier
    p2edwards committed Aug 23, 2024
    Configuration menu
    Copy the full SHA
    375e092 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    5da699c View commit details
    Browse the repository at this point in the history

Commits on Aug 26, 2024

  1. Bump actions/checkout and setup-python in pytest

    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/
    p2edwards committed Aug 26, 2024
    Configuration menu
    Copy the full SHA
    f587a1e View commit details
    Browse the repository at this point in the history