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

[Backport 2.x] Add support for Node.js >=14.20.1 <19 (#4071) #4153

Merged
merged 2 commits into from
May 26, 2023

Conversation

kavilla
Copy link
Member

@kavilla kavilla commented May 26, 2023

Manual backport of 1c0ffee for #4071

* Bump Node.js requirements to 18

Signed-off-by: Miki <[email protected]>

* Replace `lmdb-store` with `lmdb`

Signed-off-by: Miki <[email protected]>
Co-authored-by: Anan Zhuang <[email protected]>

* Bump `elastic-apm-node` to the latest minor

Signed-off-by: Miki <[email protected]>

* Replace webpack and plugins with a patched version that uses xxhash64
* Use `xxhash64` as the hashing algorithm of webpack
* Upgrade `globby`
* Remove `fibers`

Signed-off-by: Miki <[email protected]>

* Replace `fs.rmdir` with `fs.rm` in cross-platform tests

Signed-off-by: Miki <[email protected]>

* Increase listener limit

Signed-off-by: Miki <[email protected]>
Co-authored-by: Anan Zhuang <[email protected]>

* Add promise-stripping serializer

Signed-off-by: Miki <[email protected]>

* Bump heap for CI

Signed-off-by: Miki <[email protected]>

* Correct use of fs/promises in @osd/pm

Signed-off-by: Miki <[email protected]>

* Use fs/promise in plugin post-install cleanup

Signed-off-by: Miki <[email protected]>

* Set the test server's host to `0.0.0.0`

Signed-off-by: Miki <[email protected]>

* Sync `.node-version` file

Signed-off-by: Miki <[email protected]>

* Support both `isPrimary`, for Node 18, and `isMaster`, for Node 14

Signed-off-by: Miki <[email protected]>

* Add types when using `isDeepStrictEqual`

Signed-off-by: Miki <[email protected]>
Co-authored-by: Anan Zhuang <[email protected]>

* Add names to `SchemaError` to log more specific errors

Signed-off-by: Miki <[email protected]>

* Fix failing vega visualization tests outside the CI

Signed-off-by: Miki <[email protected]>

* Fix snapshot of errors thrown for undefined accessors

Signed-off-by: Miki <[email protected]>

* Fix flakiness of log_rotator

Signed-off-by: Miki <[email protected]>

* Fix asynchronous `fs` usafe in plugin discover

Signed-off-by: Miki <[email protected]>

* Fix mocks in @osd/optimizer

Signed-off-by: Miki <[email protected]>

* Fix memory leaks caused by setting states on unloaded components

Signed-off-by: Miki <[email protected]>
Co-authored-by: Anan Zhuang <[email protected]>

* Bump Node in Dockerfile

Signed-off-by: Miki <[email protected]>
Co-authored-by: Anan Zhuang <[email protected]>

* Remove the response `close` event as an indicator of the requesting finishing

opensearch-project#3601 (comment)

Signed-off-by: Miki <[email protected]>
Co-authored-by: Anan Zhuang <[email protected]>

* [BWC] Timeout after 3 mins of waiting for OSD to be running in tests

Signed-off-by: Miki <[email protected]>

* Make build use the same node version that tests are run against

Signed-off-by: Miki <[email protected]>

* Make Node resolve DNS by IPv4 first
* This is helpful to resolve `locahost` to `127.0.0.1`

Signed-off-by: Miki <[email protected]>

* Standardize patterns used by plugin discovery
* Enhance absolute path serialization on  Windows

Signed-off-by: Miki <[email protected]>

* Mock fetch in SenseEditor tests

Signed-off-by: Miki <[email protected]>

* Restore node-sass usage to fix build performance

* `sass-loader@10` is the last version that supports webpack@4
* `sass` is extremely slow when using the legacy API (`render`) and to use the "Modern API" (`compileStringAsync`), `sass-loader@13` would be needed.
* The performance of `sass@10` is made acceptable only with `fibers` but that is deprecated and doesn't work on Node 18

Signed-off-by: Anan Zhuang <[email protected]>
Signed-off-by: Miki <[email protected]>

* Revert "[CI] setup Chrome and utilize binary path (opensearch-project#3997)"

This reverts commit 0188d05

Signed-off-by: Miki <[email protected]>

* Prevent fast-fail while running functional test in CI

Signed-off-by: Miki <[email protected]>

* Revert "Temporarily hardcode chromedriver to 112.0.0 to enable all ftr tests (opensearch-project#3976)"

This reverts commit 5ea0cbe.

Signed-off-by: Miki <[email protected]>

* Save Cypress results artifacts during CI

Signed-off-by: Miki <[email protected]>

* Add missing required dependency on `set-value`

* Also force all to ^4.1.0 due to a vulnerability fixed in 3.1.0.

Signed-off-by: Miki <[email protected]>

* Prevent multiple calls to bootstrap's shutdown

Signed-off-by: Miki <[email protected]>

* Use Node 18.16.0 in distributions

* Bump jest-canvas-mock to fix failing tests
* Extend Node engines versions

Signed-off-by: Miki <[email protected]>

* Normalize test snapshots across Node 14, 16, and 18

Signed-off-by: Miki <[email protected]>

* Update CHANGELOG for Node.js >=14.20.1 <19 support

Signed-off-by: Miki <[email protected]>

---------

Signed-off-by: Miki <[email protected]>
Signed-off-by: Miki <[email protected]>
Signed-off-by: Anan Zhuang <[email protected]>
Co-authored-by: Anan Zhuang <[email protected]>
@abbyhu2000 abbyhu2000 changed the title [2.x] Add support for Node.js >=14.20.1 <19 (#4071) [Backport 2.x] Add support for Node.js >=14.20.1 <19 (#4071) May 26, 2023
Signed-off-by: Kawika Avilla <[email protected]>
@codecov
Copy link

codecov bot commented May 26, 2023

Codecov Report

Merging #4153 (c6a5911) into 2.x (1c09ca6) will decrease coverage by 0.13%.
The diff coverage is 66.10%.

@@            Coverage Diff             @@
##              2.x    #4153      +/-   ##
==========================================
- Coverage   66.45%   66.32%   -0.13%     
==========================================
  Files        3229     3229              
  Lines       62064    62075      +11     
  Branches     9602     9607       +5     
==========================================
- Hits        41244    41174      -70     
- Misses      18516    18587      +71     
- Partials     2304     2314      +10     
Flag Coverage Δ
Linux 66.27% <66.10%> (-0.13%) ⬇️
Windows 66.27% <66.10%> (-0.13%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
packages/osd-dev-utils/src/proc_runner/proc.ts 6.52% <0.00%> (ø)
packages/osd-pm/src/utils/fs.ts 13.04% <ø> (-20.29%) ⬇️
src/core/public/core_app/status/status_app.tsx 0.00% <0.00%> (ø)
src/core/server/bootstrap.ts 0.00% <0.00%> (ø)
src/core/server/status/status_service.ts 78.94% <ø> (ø)
...ion/models/sense_editor/sense_editor.test.mocks.ts 33.33% <33.33%> (-66.67%) ⬇️
...server/plugins/discovery/plugin_manifest_parser.ts 82.14% <50.00%> (-0.62%) ⬇️
packages/osd-optimizer/src/node/cache.ts 53.24% <75.00%> (-0.71%) ⬇️
...ection/public/components/opt_in_example_flyout.tsx 65.00% <80.00%> (-1.67%) ⬇️
...kages/osd-config-schema/src/errors/schema_error.ts 100.00% <100.00%> (ø)
... and 9 more

... and 23 files with indirect coverage changes

@ps48
Copy link
Member

ps48 commented May 26, 2023

@kavilla @AMoo-Miki We see main CI failing already for dashboards plugin with this PR: https://github.com/opensearch-project/dashboards-observability/actions/runs/5092646146/jobs/9158330893?pr=489. Do all plugins need to update their CI with new node version for the 2.8 release?

@kavilla
Copy link
Member Author

kavilla commented May 26, 2023

@kavilla @AMoo-Miki We see main CI failing already for dashboards plugin with this PR: https://github.com/opensearch-project/dashboards-observability/actions/runs/5092646146/jobs/9158330893?pr=489. Do all plugins need to update their CI with new node version for the 2.8 release?

Correct

@@ -1,4 +1,4 @@
ARG NODE_VERSION=14.20.1
ARG NODE_VERSION=18.16.0
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn’t this be 16.20.0 too?

Copy link
Member Author

Choose a reason for hiding this comment

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

It should but I think there is a general follow up to pull this correctly. I don't think we have verified if this Dockerfile works

@kavilla kavilla merged commit bf59644 into opensearch-project:2.x May 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants