-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Upgrade Node.js from v16.18.1 to v18.13.0 #144012
Conversation
a9ea88a
to
9816942
Compare
d18da9e
to
7237481
Compare
const inflateStream = tar.list().on('entry', (entry: tar.FileStat) => { | ||
const path = entry.header.path || ''; | ||
const inflateStream = tar.list().on('entry', (entry) => { | ||
const path = entry.path || ''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Accessing the path
via the header
works but isn't supported according to the types. Instead it seems that you're supposed to access it directly via the root path
property where it's copied to in the constructor:
if (!filter({ path })) return; | ||
streamToBuffer(entry).then((entryBuffer) => onEntry({ buffer: entryBuffer, path })); | ||
streamToBuffer(entry as unknown as NodeJS.ReadableStream).then((entryBuffer) => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
streamToBuffer
expects a ReadableStream
, but entry
isn't one. The types seem to be a little to strict though and casting like this should appease TS.
3acd0e0
to
c56c392
Compare
Friendly reminder: Looks like this PR hasn’t been backported yet. |
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
I think the main reason the security solution tests are so flaky is precisely because they don't run on prs like this one, and it shouldn't be a surprise that dependencies changing underneath of a code base without the bulk of the test coverage being run would lead to flakiness. We should probably add
to https://github.com/elastic/kibana/blob/main/.buildkite/scripts/pipelines/pull_request/pipeline.ts#L71 and the vast majority of the flakiness would go away. If the tests are prohibitively slow, just bump https://github.com/elastic/kibana/blob/main/.buildkite/pipelines/pull_request/security_solution.yml#L8 by a factor of 2 or so. I'm not sure what the historical reasons are for limiting when they run really are, but it's a problem that's only going to get worse (and likely become a big issue for other code bases in that pipeline.ts file) with so much functionality being moved to packages, and integration tests not running when oft used dependencies change. |
If running the security solutions tests for each change to I'm not sure if the security solution tests are part of the regular "flaky tests" program where they are skipped if considered flaky and an issue opened to address it, so they don't hold up all PRs just because they happen to be flaky? |
Closes elastic#134930 Breaking changes in Node.js majors: - `17.0.0`: https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V17.md#17.0.0 - `18.0.0`: https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V18.md#18.0.0 (cherry picked from commit b345f75)
## Summary Bumps node.js to 18.17.0 (replacement for PR #144012 which was later reverted) As a result, these categorical additions were needed: - `node` evocations will need the `--openssl-legacy-provider` flag, wherever it would use certain crypto functionalities - tests required updating of the expected HTTPS Agent call arguments, `noDelay` seems to be a default - `window.[NAME]` fields cannot be written directly - some stricter typechecks This is using our in-house built node.js 18 versions through the URLs the proxy-cache. (built with elastic/kibana-custom-nodejs-builds#4) These urls are served from a bucket, where the RHEL7/Centos7 compatible node distributables are. (see: elastic/kibana-ci-proxy-cache#7) Further todos: - [x] check docs wording and consistency - [ ] update the dependency report - [x] explain custom builds in documentation - [x] node_sass prebuilts --------- Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Tiago Costa <tiago.costa@elastic.co> Co-authored-by: Thomas Watson <w@tson.dk>
## Summary Bumps node.js to 18.17.0 (replacement for PR elastic#144012 which was later reverted) As a result, these categorical additions were needed: - `node` evocations will need the `--openssl-legacy-provider` flag, wherever it would use certain crypto functionalities - tests required updating of the expected HTTPS Agent call arguments, `noDelay` seems to be a default - `window.[NAME]` fields cannot be written directly - some stricter typechecks This is using our in-house built node.js 18 versions through the URLs the proxy-cache. (built with elastic/kibana-custom-nodejs-builds#4) These urls are served from a bucket, where the RHEL7/Centos7 compatible node distributables are. (see: elastic/kibana-ci-proxy-cache#7) Further todos: - [x] check docs wording and consistency - [ ] update the dependency report - [x] explain custom builds in documentation - [x] node_sass prebuilts --------- Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Tiago Costa <tiago.costa@elastic.co> Co-authored-by: Thomas Watson <w@tson.dk>
\>6.1.11 is needed for a bug fix in elastic#162722 Noted in elastic#144012: > tar: 6.1.11 -> 6.1.13 - Includes a bug fix for a race condition that triggered when the ci:build-all-platforms label was added in Node.js 18 but not in Node.js 16 This upgrades to the latest patch on main before backporting to 7.17
\>6.1.11 is needed for a bug fix in elastic#162722 Noted in elastic#144012: > tar: 6.1.11 -> 6.1.13 - Includes a bug fix for a race condition that triggered when the ci:build-all-platforms label was added in Node.js 18 but not in Node.js 16 This upgrades to the latest patch on main before backporting to 7.17 (cherry picked from commit 8ffd4fb)
## Summary Bumps node.js to 18.17.0 (replacement for PR elastic#144012 which was later reverted) As a result, these categorical additions were needed: - `node` evocations will need the `--openssl-legacy-provider` flag, wherever it would use certain crypto functionalities - tests required updating of the expected HTTPS Agent call arguments, `noDelay` seems to be a default - `window.[NAME]` fields cannot be written directly - some stricter typechecks This is using our in-house built node.js 18 versions through the URLs the proxy-cache. (built with elastic/kibana-custom-nodejs-builds#4) These urls are served from a bucket, where the RHEL7/Centos7 compatible node distributables are. (see: elastic/kibana-ci-proxy-cache#7) Further todos: - [x] check docs wording and consistency - [ ] update the dependency report - [x] explain custom builds in documentation - [x] node_sass prebuilts --------- Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Tiago Costa <tiago.costa@elastic.co> Co-authored-by: Thomas Watson <w@tson.dk>
\>6.1.11 is needed for a bug fix in elastic#162722 Noted in elastic#144012: > tar: 6.1.11 -> 6.1.13 - Includes a bug fix for a race condition that triggered when the ci:build-all-platforms label was added in Node.js 18 but not in Node.js 16 This upgrades to the latest patch on main before backporting to 7.17
Closes #162695 # Backport This will backport the following commits from `main` to `7.17`: - [[Ops] Bump Node.js to version 18 (#160289)](#160289) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Alex Szabo","email":"alex.szabo@elastic.co"},"sourceCommit":{"committedDate":"2023-07-27T12:12:48Z","message":"[Ops] Bump Node.js to version 18 (#160289)\n\n## Summary\r\n\r\nBumps node.js to 18.17.0 (replacement for PR #144012 which was later\r\nreverted)\r\n\r\nAs a result, these categorical additions were needed: \r\n- `node` evocations will need the `--openssl-legacy-provider` flag,\r\nwherever it would use certain crypto functionalities\r\n- tests required updating of the expected HTTPS Agent call arguments,\r\n`noDelay` seems to be a default\r\n - `window.[NAME]` fields cannot be written directly\r\n - some stricter typechecks\r\n\r\nThis is using our in-house built node.js 18 versions through the URLs\r\nthe proxy-cache. (built with\r\nhttps://github.com/elastic/kibana-custom-nodejs-builds/pull/4)\r\n\r\nThese urls are served from a bucket, where the RHEL7/Centos7 compatible\r\nnode distributables are. (see:\r\nhttps://github.com/elastic/kibana-ci-proxy-cache/pull/7)\r\n\r\nFurther todos: \r\n - [x] check docs wording and consistency\r\n - [ ] update the dependency report\r\n - [x] explain custom builds in documentation\r\n - [x] node_sass prebuilts\r\n\r\n---------\r\n\r\nCo-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by: Tiago Costa <tiago.costa@elastic.co>\r\nCo-authored-by: Thomas Watson <w@tson.dk>","sha":"8cf68dc6ba8f010e36538c1e7c92601a341efcf4","branchLabelMapping":{"^v8.10.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Operations","Team:uptime","backport:skip","release_note:feature","ci:all-cypress-suites","v8.10.0"],"number":160289,"url":"https://github.com/elastic/kibana/pull/160289","mergeCommit":{"message":"[Ops] Bump Node.js to version 18 (#160289)\n\n## Summary\r\n\r\nBumps node.js to 18.17.0 (replacement for PR #144012 which was later\r\nreverted)\r\n\r\nAs a result, these categorical additions were needed: \r\n- `node` evocations will need the `--openssl-legacy-provider` flag,\r\nwherever it would use certain crypto functionalities\r\n- tests required updating of the expected HTTPS Agent call arguments,\r\n`noDelay` seems to be a default\r\n - `window.[NAME]` fields cannot be written directly\r\n - some stricter typechecks\r\n\r\nThis is using our in-house built node.js 18 versions through the URLs\r\nthe proxy-cache. (built with\r\nhttps://github.com/elastic/kibana-custom-nodejs-builds/pull/4)\r\n\r\nThese urls are served from a bucket, where the RHEL7/Centos7 compatible\r\nnode distributables are. (see:\r\nhttps://github.com/elastic/kibana-ci-proxy-cache/pull/7)\r\n\r\nFurther todos: \r\n - [x] check docs wording and consistency\r\n - [ ] update the dependency report\r\n - [x] explain custom builds in documentation\r\n - [x] node_sass prebuilts\r\n\r\n---------\r\n\r\nCo-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by: Tiago Costa <tiago.costa@elastic.co>\r\nCo-authored-by: Thomas Watson <w@tson.dk>","sha":"8cf68dc6ba8f010e36538c1e7c92601a341efcf4"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.10.0","labelRegex":"^v8.10.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/160289","number":160289,"mergeCommit":{"message":"[Ops] Bump Node.js to version 18 (#160289)\n\n## Summary\r\n\r\nBumps node.js to 18.17.0 (replacement for PR #144012 which was later\r\nreverted)\r\n\r\nAs a result, these categorical additions were needed: \r\n- `node` evocations will need the `--openssl-legacy-provider` flag,\r\nwherever it would use certain crypto functionalities\r\n- tests required updating of the expected HTTPS Agent call arguments,\r\n`noDelay` seems to be a default\r\n - `window.[NAME]` fields cannot be written directly\r\n - some stricter typechecks\r\n\r\nThis is using our in-house built node.js 18 versions through the URLs\r\nthe proxy-cache. (built with\r\nhttps://github.com/elastic/kibana-custom-nodejs-builds/pull/4)\r\n\r\nThese urls are served from a bucket, where the RHEL7/Centos7 compatible\r\nnode distributables are. (see:\r\nhttps://github.com/elastic/kibana-ci-proxy-cache/pull/7)\r\n\r\nFurther todos: \r\n - [x] check docs wording and consistency\r\n - [ ] update the dependency report\r\n - [x] explain custom builds in documentation\r\n - [x] node_sass prebuilts\r\n\r\n---------\r\n\r\nCo-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by: Tiago Costa <tiago.costa@elastic.co>\r\nCo-authored-by: Thomas Watson <w@tson.dk>","sha":"8cf68dc6ba8f010e36538c1e7c92601a341efcf4"}}]}] BACKPORT--> --------- Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Tiago Costa <tiago.costa@elastic.co> Co-authored-by: Thomas Watson <w@tson.dk> Co-authored-by: Jonathan Budzenski <jon@elastic.co>
Closes #134930
Breaking changes in Node.js majors:
17.0.0
: https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V17.md#17.0.018.0.0
: https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V18.md#18.0.0Note to reviewers
Failing cypress test suites
The
Security Solution Tests
suites are known to be very flaky. They are triggered by theci:all-cypress-suites
label. Please ignore these test failures - they actually do pass (cc @elastic/security-solution).Dates
This PR includes a bunch of Date related test changes. This is because Node.js v18.13.0 ships with a newer version of ICU (i18n library), which includes some changes to how dates are rendered:
AM
/PM
postfix now uses a non-breaking space between the time and theAM
/PM
part.Some dates, includingBased on feedback I've reverted the formatting of these dates to back to the Node.js 16 behaviour (or as close to it as I could get).en-CA
formatted dates which we use in one of our tests, now render as10/13/2021
instead of2021-10-13
.I'm not sure if any of these changes are blockers for this PR?
For details see: nodejs/node#45945
Stream race condition
There's a race condition in the report generator code where it's waiting for a stream to finish using the built in
finished
function from Node.js core. However, it seems that we hit a race condition with this function. I've reported it to the Node.js project (nodejs/node#46170). However, I feel confident that we can land this PR using my workaround added in this commit: ca2a1c3Upgraded dependencies
re2
:1.17.4
->1.17.7
- We could technically have kept version1.17.4
, but we needed to recompile it against the newer Node.js version anyway, so I took the chance to upgrade it while I was at it.Extracted into separate PR: chore(NA): updates from lmdb-store to lmdb #145891lmdb-store
:1.6.11
->2.6.9
- The old version didn't seem to work with Node.js 18. The package also changed name fromlmdb-store
to justlmdb
.source-map
:0.7.3
->0.7.4
- The old version didn't seem to work with Node.js 18.tar
:6.1.11
->6.1.13
- Includes a bug fix for a race condition that triggered when theci:build-all-platforms
label was added in Node.js 18 but not in Node.js 16I also had to upgrade a few
@types/*
packages to be compatible with Node.js 18, but I've not listed them above as they don't influence the runtime.Blockers: