From b0136e3131667996c6e48d27a41d72d44cf46d08 Mon Sep 17 00:00:00 2001 From: undergroundwires Date: Sat, 30 Mar 2024 13:00:07 +0100 Subject: [PATCH] ci/cd: bump Node.js environment to 20.x This commit upgrades Node.js version to v20.x in CI/CD environment. Previously used Node 18.x is moving towards end-of-life, with a planned date of 2025-04-30. In contrast, Node 20.x has been offering long-term support (LTS) since 2023-10-24. This makes Node 20.x a stable and recommended version for production environments. This commit also configures `actions/setup-node` with the `check-latest` flag to always use the latest Node 20.x version, keeping CI/CD setup up-to-date with minimal maintenance. Details: - actions/setup-node#165 - actions/setup-node#160 Using Node 20.x in CI/CD environments provides better compatibility with Electron v29.0 which moves to Node 20.x. Details: - electron/electron#40343 This upgrade improves network connection handling in CI/CD pipelines (where issues occur due to GitHub runners not supporting IPv6). Details: - actions/runner#3138 - actions/runner-images#668 - actions/runner#3213 - actions/runner-images#9540 Node 20.x adopts the Happy Eyeballs algorithm for improved IPv6 connectivity. - nodejs/node#40702 - nodejs/node#41625 - nodejs/node#44731 This mitigates issues like `UND_ERR_CONNECT_TIMEOUT` and localhost DNS resolution in CI/CD environments: Details: - nodejs/node#40537 - actions/runner#3213 - actions/runner-images#9540 Node 20 introduces `setDefaultAutoSelectFamily`, a global function from Node 19.4.0, enabling better IPv4 support, especially in environments with limited or problematic IPv6 support. Details: - nodejs/node#45777 Node 20.x defaults to the new `autoSelectFamily`, improving network connection reliability in GitHub runners lacking full IPv6 support. Details: - nodejs/node#46790 --- .github/actions/force-ipv4/README.md | 9 +++++---- .github/actions/setup-node/action.yml | 3 ++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/actions/force-ipv4/README.md b/.github/actions/force-ipv4/README.md index 36a6097bd..8f312e323 100644 --- a/.github/actions/force-ipv4/README.md +++ b/.github/actions/force-ipv4/README.md @@ -7,8 +7,8 @@ This GitHub action enforces IPv4 for all outgoing network requests. It addresses ## Background Some applications attempt network connections over IPv6. -Such as requests made by Node's `fetch` API causes `UND_ERR_CONNECT_TIMEOUT` errors [3] [4]. -This happens when the software cannot handle this such as by using Happy Eyeballs [5] [6]. +Such as requests made by Node's `fetch` API causes `UND_ERR_CONNECT_TIMEOUT` [3] [4] and similar issues [5]. +This happens when the software cannot handle this such as by using Happy Eyeballs [6] [7]. ## Usage @@ -27,5 +27,6 @@ This action is a workaround addressing specific IPv6-related connectivity issues [2]: https://archive.ph/2024.03.28-185838/https://github.com/actions/runner-images/issues/668 "IPv6 on GitHub-hosted runners · Issue #668 · actions/runner-images · GitHub | github.com" [3]: https://archive.ph/2024.03.28-185847/https://github.com/actions/runner/issues/3213 "GitHub runner cannot send `fetch` with `node`, failing with IPv6 DNS error `UND_ERR_CONNECT_TIMEOUT` · Issue #3213 · actions/runner · GitHub | github.com" [4]: https://archive.ph/2024.03.28-185853/https://github.com/actions/runner-images/issues/9540 "Cannot send outbound requests using node fetch, failing with IPv6 DNS error UND_ERR_CONNECT_TIMEOUT · Issue #9540 · actions/runner-images · GitHub | github.com" -[5]: https://archive.ph/2024.03.28-185900/https://github.com/nodejs/node/issues/41625 "Happy Eyeballs support (address IPv6 issues in Node 17) · Issue #41625 · nodejs/node · GitHub | github.com" -[6]: https://archive.ph/2024.03.28-185910/https://github.com/nodejs/undici/issues/1531 "fetch times out in under 5 seconds · Issue #1531 · nodejs/undici · GitHub | github.com" +[5]: https://archive.today/2024.03.30-113315/https://github.com/nodejs/node/issues/40537 '"localhost" favours IPv6 in node v17, used to favour IPv4 · Issue #40537 · nodejs/node · GitHub' +[6]: https://archive.ph/2024.03.28-185900/https://github.com/nodejs/node/issues/41625 "Happy Eyeballs support (address IPv6 issues in Node 17) · Issue #41625 · nodejs/node · GitHub | github.com" +[7]: https://archive.ph/2024.03.28-185910/https://github.com/nodejs/undici/issues/1531 "fetch times out in under 5 seconds · Issue #1531 · nodejs/undici · GitHub | github.com" diff --git a/.github/actions/setup-node/action.yml b/.github/actions/setup-node/action.yml index d1e5d07f9..8b52ca6d5 100644 --- a/.github/actions/setup-node/action.yml +++ b/.github/actions/setup-node/action.yml @@ -5,4 +5,5 @@ runs: name: Setup node uses: actions/setup-node@v4 with: - node-version: 18.x + node-version: 20.x + check-latest: true