Skip to content

Commit

Permalink
[Node 14] Upgrades Node version from 10.24.1 to 14.18.2 (#1028)
Browse files Browse the repository at this point in the history
* Addresses syntax changes between Node.js v10 and v14.
* Bumps dependencies to address build/compatibility issues:
* Bumps `@types/node` from v10.17.26 to v14.17.32
* Bumps `@elastic/good` from v8.1.1-kibana2 to v9.0.1-kibana3
* Bumps `react` from v16.12.0 to v16.14.0
* Bumps `@microsoft/api-documenter` from v7.7.2 to v7.13.65
* Bumps `@microsoft/api-extractor` from v7.7.0 to v7.18.17
* Bumps `@types/webpack` from v4.41.3 to v4.41.31
* Bumps `@types/webpack-env` from v1.15.2 to v1.16.3
* Bumps `sass-loader` from v8.0.2 to v10.2.0
* Bumps `lmdb-store` from v0.6.10 to v1.6.11
* Bumps `node-sass` from "sass/node-sass#v5" to v6.0.1
* Adds `--no-deprecation` flag for integration tests caused by `shot`
which is a downstream dependency of `hapi`.
* Skips flaky server metrics collector tests
* The ServerMetricsCollector tests are flaky and rely on the existing
v17 hapi library that Dashboards depends on. This will be upgraded
for the 2.0 release along with the Node.js upgrade. (#1073)
* Bumps react from 16.12 to 16.14 to resolve unmet peer 
dependencies, but we still need a resolution to remove the old version.
* Adds transformIgnorePattern for weak-lru-cache and ordered-binary
to fix unit test jest failures.
* Refactors node cache to improve logging and separate databases

Signed-off-by: Bishoy Boktor <[email protected]>
Co-authored-by: Tommy Markley <[email protected]>
Co-authored-by: Kawika Avilla <[email protected]>
Co-authored-by: Ashwin Pc <[email protected]>
  • Loading branch information
4 people authored Jan 5, 2022
1 parent ac9c837 commit d48d001
Show file tree
Hide file tree
Showing 58 changed files with 4,364 additions and 4,308 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/pr_check_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
if: steps.job_successful.outputs.job_successful != 'true'
uses: actions/setup-node@v2
with:
node-version: "10.24.1"
node-version: "14.18.2"
registry-url: 'https://registry.npmjs.org'

- name: Setup Yarn
Expand Down Expand Up @@ -111,7 +111,7 @@ jobs:
- name: Run integration tests
if: steps.integration_tests_results.outputs.integration_tests_results != 'success'
id: integration-tests
run: node scripts/jest_integration --ci --colors --max-old-space-size=5120
run: node --no-deprecation scripts/jest_integration --ci --colors --max-old-space-size=5120

# Set cache if linter, unit tests, and integration tests were successful then the job will be marked successful
# Sets individual results to empower re-runs of the same build without re-running successful steps.
Expand Down Expand Up @@ -160,7 +160,7 @@ jobs:
if: steps.ftr_tests_results.outputs.ftr_tests_results != 'success'
uses: actions/setup-node@v2
with:
node-version: "10.24.1"
node-version: "14.18.2"
registry-url: 'https://registry.npmjs.org'

- name: Setup Yarn
Expand Down
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10.24.1
14.18.2
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10.24.1
14.18.2
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG NODE_VERSION=10.24.1
ARG NODE_VERSION=14.18.2
FROM node:${NODE_VERSION} AS base

ENV HOME '.'
Expand Down
2 changes: 1 addition & 1 deletion TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ In general, we recommend three tiers of tests:

# Requirements
* Install the latest NodeJS, [NPM](https://www.npmjs.com/get-npm) and [Yarn](https://classic.yarnpkg.com/en/docs/install/#mac-stable)
* `nvm install v10.24.1`
* `nvm install v14.18.2`
* `npm install -g yarn`

# Running tests
Expand Down
24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"opensearch": "node scripts/opensearch",
"test": "grunt test",
"test:jest": "node scripts/jest",
"test:jest_integration": "node scripts/jest_integration",
"test:jest_integration": "node --no-deprecation scripts/jest_integration",
"test:mocha": "node scripts/mocha",
"test:mocha:coverage": "grunt test:mochaCoverage",
"test:ftr": "node scripts/functional_tests",
Expand Down Expand Up @@ -75,14 +75,12 @@
"url": "https://github.com/opensearch-project/opensearch-dashboards.git"
},
"resolutions": {
"**/@types/node": ">=10.17.17 <10.20.0",
"**/axios": "^0.21.4",
"**/@types/node": "^14.17.32",
"**/ejs": "^3.1.6",
"**/front-matter": "^4.0.2",
"**/glob-parent": "^6.0.0",
"**/hoist-non-react-statics": "^3.3.2",
"**/immer": "^9.0.6",
"**/istanbul-instrumenter-loader/schema-utils": "^1.0.0",
"**/kind-of": ">=6.0.3",
"**/lodash": "^4.17.21",
"**/merge": "^2.1.1",
Expand Down Expand Up @@ -120,7 +118,7 @@
"@elastic/datemath": "5.0.3",
"@elastic/elasticsearch": "7.10.0-rc.1",
"@elastic/eui": "29.3.2",
"@elastic/good": "8.1.1-kibana2",
"@elastic/good": "^9.0.1-kibana3",
"@elastic/numeral": "^2.5.0",
"@elastic/request-crypto": "1.1.4",
"@elastic/safer-lodash-set": "0.0.0",
Expand Down Expand Up @@ -193,7 +191,7 @@
"proxy-from-env": "1.0.0",
"query-string": "^6.13.2",
"re2": "^1.15.4",
"react": "^16.12.0",
"react": "^16.14.0",
"react-color": "^2.13.8",
"react-dom": "^16.12.0",
"react-input-range": "^1.3.0",
Expand Down Expand Up @@ -246,8 +244,8 @@
"@osd/test": "1.0.0",
"@osd/test-subj-selector": "0.2.1",
"@osd/utility-types": "1.0.0",
"@microsoft/api-documenter": "7.7.2",
"@microsoft/api-extractor": "7.7.0",
"@microsoft/api-documenter": "^7.13.65",
"@microsoft/api-extractor": "^7.18.17",
"@percy/agent": "^0.28.6",
"@testing-library/dom": "^7.24.2",
"@testing-library/jest-dom": "^5.11.4",
Expand Down Expand Up @@ -303,7 +301,7 @@
"@types/mock-fs": "^4.10.0",
"@types/moment-timezone": "^0.5.12",
"@types/mustache": "^0.8.31",
"@types/node": ">=10.17.17 <10.20.0",
"@types/node": "^14.17.32",
"@types/node-forge": "^0.9.5",
"@types/normalize-path": "^3.0.0",
"@types/pegjs": "^0.10.1",
Expand Down Expand Up @@ -336,8 +334,8 @@
"@types/uuid": "^3.4.4",
"@types/vinyl": "^2.0.4",
"@types/vinyl-fs": "^2.4.11",
"@types/webpack": "^4.41.3",
"@types/webpack-env": "^1.15.2",
"@types/webpack": "^4.41.31",
"@types/webpack-env": "^1.16.3",
"@types/zen-observable": "^0.8.0",
"@typescript-eslint/eslint-plugin": "^3.10.0",
"@typescript-eslint/parser": "^3.10.0",
Expand Down Expand Up @@ -434,13 +432,15 @@
"postcss": "^8.2.10",
"prettier": "^2.1.1",
"prop-types": "^15.7.2",
"react": "^16.14.0",
"react-grid-layout": "^0.16.2",
"react-markdown": "^4.3.1",
"react-monaco-editor": "~0.27.0",
"react-redux": "^7.2.0",
"react-resize-detector": "^4.2.0",
"react-router-dom": "^5.2.0",
"react-sizeme": "^2.3.6",
"react-test-renderer": "^16.12.0",
"reactcss": "1.2.3",
"redux": "^4.0.5",
"regenerate": "^1.4.0",
Expand Down Expand Up @@ -468,7 +468,7 @@
"zlib": "^1.0.5"
},
"engines": {
"node": "10.24.1",
"node": "14.18.2",
"yarn": "^1.21.1"
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion packages/osd-config-schema/src/types/stream_type.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,13 @@ test('includes namespace in failure', () => {
describe('#defaultValue', () => {
test('returns default when undefined', () => {
const value = new Stream();
expect(schema.stream({ defaultValue: value }).validate(undefined)).toStrictEqual(value);
expect(schema.stream({ defaultValue: value }).validate(undefined)).toMatchInlineSnapshot(`
Stream {
"_events": Object {},
"_eventsCount": 0,
"_maxListeners": undefined,
}
`);
});

test('returns value when specified', () => {
Expand Down
8 changes: 4 additions & 4 deletions packages/osd-dev-utils/src/proc_runner/proc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ export function startProc(name: string, options: ProcOptions, log: ToolingLog) {
});

if (stdin) {
childProcess.stdin.end(stdin, 'utf8');
childProcess.stdin!.end(stdin, 'utf8');
} else {
childProcess.stdin.end();
childProcess.stdin!.end();
}

let stopCalled = false;
Expand Down Expand Up @@ -136,8 +136,8 @@ export function startProc(name: string, options: ProcOptions, log: ToolingLog) {
).pipe(share());

const lines$ = Rx.merge(
observeLines(childProcess.stdout),
observeLines(childProcess.stderr)
observeLines(childProcess.stdout!),
observeLines(childProcess.stderr!)
).pipe(
tap((line) => log.write(` ${chalk.gray('proc')} [${chalk.gray(name)}] ${line}`)),
share()
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/osd-i18n/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"intl-messageformat": "^2.2.0",
"intl-relativeformat": "^2.1.0",
"prop-types": "^15.7.2",
"react": "^16.12.0",
"react": "^16.14.0",
"react-intl": "^2.8.0"
}
}
2 changes: 1 addition & 1 deletion packages/osd-i18n/src/__snapshots__/loader.test.ts.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/osd-interpreter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"del": "^5.1.0",
"getopts": "^2.2.5",
"pegjs": "0.10.0",
"sass-loader": "^8.0.2",
"sass-loader": "^10.2.0",
"style-loader": "^1.1.3",
"supports-color": "^7.0.0",
"url-loader": "^2.2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,14 @@ describe('concatStreamProviders() helper', () => {
`"foo"`
);
expect(errorListener.mock.calls).toMatchInlineSnapshot(`
Array [
Array [
[Error: foo],
],
]
`);
Array [
Array [
[Error: foo],
],
Array [
[Error: foo],
],
]
`);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ describe('reduceStream', () => {
const errorStub = jest.fn();
reduce$.on('data', dataStub);
reduce$.on('error', errorStub);
const endEvent = promiseFromEvent('end', reduce$);
const closeEvent = promiseFromEvent('close', reduce$);

reduce$.write(1);
reduce$.write(2);
Expand All @@ -89,7 +89,7 @@ describe('reduceStream', () => {
reduce$.write(1000);
reduce$.end();

await endEvent;
await closeEvent;
expect(reducer).toHaveBeenCalledTimes(3);
expect(dataStub).toHaveBeenCalledTimes(0);
expect(errorStub).toHaveBeenCalledTimes(1);
Expand Down
9 changes: 4 additions & 5 deletions packages/osd-optimizer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,19 @@
"del": "^5.1.0",
"execa": "^4.0.2",
"file-loader": "^4.2.0",
"istanbul-instrumenter-loader": "^3.0.1",
"jest-diff": "^26.4.2",
"js-yaml": "^3.14.0",
"json-stable-stringify": "^1.0.1",
"lmdb-store": "^0.6.10",
"lmdb-store": "^1.6.11",
"loader-utils": "^1.2.3",
"node-sass": "sass/node-sass#v5",
"node-sass": "^6.0.1",
"normalize-path": "^3.0.0",
"pirates": "^4.0.1",
"postcss": "^8.2.10",
"postcss-loader": "^3.0.0",
"raw-loader": "^3.1.0",
"rxjs": "^6.5.5",
"sass-loader": "^8.0.2",
"sass-loader": "^10.2.0",
"source-map-support": "^0.5.19",
"style-loader": "^1.1.3",
"terser-webpack-plugin": "^2.1.2",
Expand All @@ -57,6 +56,6 @@
"@types/loader-utils": "^1.1.3",
"@types/source-map-support": "^0.5.3",
"@types/watchpack": "^1.1.6",
"@types/webpack": "^4.41.3"
"@types/webpack": "^4.41.31"
}
}
Loading

0 comments on commit d48d001

Please sign in to comment.