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

Downgrade Node.js to version 16 #149531

Merged
merged 2 commits into from
Jan 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .ci/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# NOTE: This Dockerfile is ONLY used to run certain tasks in CI. It is not used to run Kibana or as a distributable.
# If you're looking for the Kibana Docker image distributable, please see: src/dev/build/tasks/os_packages/docker_generator/templates/dockerfile.template.ts

ARG NODE_VERSION=18.13.0
ARG NODE_VERSION=16.19.0

FROM node:${NODE_VERSION} AS base

Expand Down
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.13.0
16.19.0
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.13.0
16.19.0
12 changes: 6 additions & 6 deletions WORKSPACE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories", "yarn_install
# Setup the Node.js toolchain for the architectures we want to support
node_repositories(
node_repositories = {
"18.13.0-darwin_amd64": ("node-v18.13.0-darwin-x64.tar.gz", "node-v18.13.0-darwin-x64", "8b57c4da4ff6cca19d5ef7953f8816e3406d1508a2e4ee7f997984b3b1d11b77"),
"18.13.0-darwin_arm64": ("node-v18.13.0-darwin-arm64.tar.gz", "node-v18.13.0-darwin-arm64", "418d535e64dbcbd628715180c2de4ffcecb8a84b81f233c60e6ab9f0d795c249"),
"18.13.0-linux_arm64": ("node-v18.13.0-linux-arm64.tar.xz", "node-v18.13.0-linux-arm64", "5b338667822341d1ea3b18d5b37d442a655829b9eafdc5f9008f00b8451ac148"),
"18.13.0-linux_amd64": ("node-v18.13.0-linux-x64.tar.xz", "node-v18.13.0-linux-x64", "7f5d6922a91986ef059ba8a4396aa435440adacfe6fc6fab60a857c8f2cf5e7a"),
"18.13.0-windows_amd64": ("node-v18.13.0-win-x64.zip", "node-v18.13.0-win-x64", "29c99ad1167ddbd72f2b15e91b560e36ac785b1873ba6791ab50d9d62f1957e2"),
"16.19.0-darwin_amd64": ("node-v16.19.0-darwin-x64.tar.gz", "node-v16.19.0-darwin-x64", "491e5a5592eca1961dcbb1fae28567428ce56ce9cc7977b04041e163e0c1670c"),
"16.19.0-darwin_arm64": ("node-v16.19.0-darwin-arm64.tar.gz", "node-v16.19.0-darwin-arm64", "5c9434fbb0f323fecf3d261b23a2e544919380c5043d0046d9745682fefd9cde"),
"16.19.0-linux_arm64": ("node-v16.19.0-linux-arm64.tar.xz", "node-v16.19.0-linux-arm64", "9072c995052f832678fe8fab18e960bd9853f30e481787e53f8dd1ec8aaa3bb6"),
"16.19.0-linux_amd64": ("node-v16.19.0-linux-x64.tar.xz", "node-v16.19.0-linux-x64", "c88b52497ab38a3ddf526e5b46a41270320409109c3f74171b241132984fd08f"),
"16.19.0-windows_amd64": ("node-v16.19.0-win-x64.zip", "node-v16.19.0-win-x64", "534ca7a24e999c81cec847a498cc43d47e2bb158f6edf639e5297f2718350e96"),
},
node_version = "18.13.0",
node_version = "16.19.0",
node_urls = [
"https://nodejs.org/dist/v{version}/{filename}",
],
Expand Down
2 changes: 1 addition & 1 deletion docs/developer/advanced/upgrading-nodejs.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ These files must be updated when upgrading Node.js:
- {kib-repo}blob/{branch}/WORKSPACE.bazel[`WORKSPACE.bazel`] - The version is specified in the `node_version` property.
Besides this property, the list of files under `node_repositories` must be updated along with their respective SHA256 hashes.
These can be found on the https://nodejs.org[nodejs.org] website.
Example for Node.js v18.13.0: https://nodejs.org/dist/v18.13.0/SHASUMS256.txt.asc
Example for Node.js v16.19.0: https://nodejs.org/dist/v16.19.0/SHASUMS256.txt.asc

See PR {kib-repo}pull/128123[#128123] for an example of how the Node.js version has been upgraded previously.

Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"makelogs": "node scripts/makelogs",
"spec_to_console": "node scripts/spec_to_console",
"start": "node scripts/kibana --dev",
"storybook": "node --openssl-legacy-provider scripts/storybook",
"storybook": "node scripts/storybook",
"test:ftr": "node scripts/functional_tests",
"test:ftr:runner": "node scripts/functional_test_runner",
"test:ftr:server": "node scripts/functional_tests_server",
Expand All @@ -68,11 +68,11 @@
"url": "https://github.com/elastic/kibana.git"
},
"engines": {
"node": "18.13.0",
"node": "16.19.0",
"yarn": "^1.22.19"
},
"resolutions": {
"**/@types/node": "18.11.18",
"**/@types/node": "16.11.68",
"**/chokidar": "^3.5.3",
"**/deepmerge": "^4.2.2",
"**/fast-deep-equal": "^3.1.1",
Expand Down Expand Up @@ -622,7 +622,7 @@
"query-string": "^6.13.2",
"rbush": "^3.0.1",
"re-resizable": "^6.1.1",
"re2": "1.17.7",
"re2": "1.17.4",
"react": "^17.0.2",
"react-ace": "^7.0.5",
"react-beautiful-dnd": "^13.1.0",
Expand Down Expand Up @@ -937,7 +937,7 @@
"@types/multistream": "^4.1.0",
"@types/mustache": "^0.8.31",
"@types/nock": "^10.0.3",
"@types/node": "18.11.18",
"@types/node": "16.11.68",
"@types/node-fetch": "^2.6.0",
"@types/node-forge": "^1.3.1",
"@types/nodemailer": "^6.4.0",
Expand Down
8 changes: 4 additions & 4 deletions packages/kbn-i18n/src/core/i18n.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -662,13 +662,13 @@ describe('I18n engine', () => {
i18n.translate('a.short', {
values: { expires: new Date(2018, 5, 20, 18, 40, 30, 50) },
} as any)
).toBe('Coupon expires at 6:40PM');
).toBe('Coupon expires at 6:40 PM');

expect(
i18n.translate('a.medium', {
values: { expires: new Date(2018, 5, 20, 18, 40, 30, 50) },
} as any)
).toBe('Coupon expires at 6:40:30PM');
).toBe('Coupon expires at 6:40:30 PM');
});

test('should format default messages with time formatter', () => {
Expand All @@ -679,14 +679,14 @@ describe('I18n engine', () => {
defaultMessage: 'Coupon expires at {expires, time, short}',
values: { expires: new Date(2018, 5, 20, 18, 40, 30, 50) },
})
).toBe('Coupon expires at 6:40PM');
).toBe('Coupon expires at 6:40 PM');

expect(
i18n.translate('foo', {
defaultMessage: 'Coupon expires at {expires, time, medium}',
values: { expires: new Date(2018, 5, 20, 18, 40, 30, 50) },
})
).toBe('Coupon expires at 6:40:30PM');
).toBe('Coupon expires at 6:40:30 PM');
});

test('should format message with a custom format', () => {
Expand Down
2 changes: 0 additions & 2 deletions packages/kbn-monaco/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,9 @@ webpack_cli(
env = select({
"//:dist": {
"NODE_ENV": "production",
"NODE_OPTIONS": "--openssl-legacy-provider",
},
"//conditions:default": {
"NODE_ENV": "development",
"NODE_OPTIONS": "--openssl-legacy-provider",
},
}),
visibility = ["//visibility:public"],
Expand Down
1 change: 0 additions & 1 deletion packages/kbn-optimizer/src/optimizer/observe_worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ function usingWorkerProc<T>(config: OptimizerConfig, fn: (proc: ChildProcess) =>
(): ProcResource => {
const proc = fork(require.resolve('../worker/run_worker'), [], {
execArgv: [
'--openssl-legacy-provider',
`--require=@kbn/babel-register/install`,
...(inspectFlag && config.inspectWorkers
? [`${inspectFlag}=${inspectPortCounter++}`]
Expand Down
2 changes: 0 additions & 2 deletions packages/kbn-ui-shared-deps-npm/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,9 @@ webpack_cli(
env = select({
"//:dist": {
"NODE_ENV": "production",
"NODE_OPTIONS": "--openssl-legacy-provider",
},
"//conditions:default": {
"NODE_ENV": "development",
"NODE_OPTIONS": "--openssl-legacy-provider",
},
})
)
Expand Down
2 changes: 0 additions & 2 deletions packages/kbn-ui-shared-deps-src/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,9 @@ webpack_cli(
env = select({
"//:dist": {
"NODE_ENV": "production",
"NODE_OPTIONS": "--openssl-legacy-provider",
},
"//conditions:default": {
"NODE_ENV": "development",
"NODE_OPTIONS": "--openssl-legacy-provider",
},
}),
visibility = ["//visibility:public"],
Expand Down
22 changes: 11 additions & 11 deletions src/dev/build/tasks/patch_native_modules_task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,17 @@ interface Package {
const packages: Package[] = [
{
name: 're2',
version: '1.17.7',
version: '1.17.4',
destinationPath: 'node_modules/re2/build/Release/re2.node',
extractMethod: 'gunzip',
archives: {
'darwin-x64': {
url: 'https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/node-re2/uhop/node-re2/releases/download/1.17.7/darwin-x64-108.gz',
sha256: '4ed378c5a7fe6134b717afe7642254aff1ed7a881cbcaa53a012ac3efab49f99',
url: 'https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/node-re2/uhop/node-re2/releases/download/1.17.4/darwin-x64-93.gz',
sha256: '9558c5cb39622e9b3653203e772b129d6c634e7dbd7af1b244352fc1d704601f',
},
'linux-x64': {
url: 'https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/node-re2/uhop/node-re2/releases/download/1.17.7/linux-x64-108.gz',
sha256: '197a617ca2965f220848561afed71ff6df653f6d79910cf38e866c84ab38a236',
url: 'https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/node-re2/uhop/node-re2/releases/download/1.17.4/linux-x64-93.gz',
sha256: '4d06747b266c75b6f7ced93977692c0586ce6a52924cabb569bd966378941aa1',
},

// ARM builds are currently done manually as Github Actions used in upstream project
Expand All @@ -67,8 +67,8 @@ const packages: Package[] = [
// * capture the sha256 with: `shasum -a 256 linux-arm64-*`
// * upload the `linux-arm64-*.gz` artifact to the `yarn-prebuilt-artifacts` bucket in GCS using the correct version number
'linux-arm64': {
url: 'https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/node-re2/uhop/node-re2/releases/download/1.17.7/linux-arm64-108.gz',
sha256: 'a690087a1a1fd9887aac1abdab68d1992600e218be10783da6d3381cca950c1a',
url: 'https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/node-re2/uhop/node-re2/releases/download/1.17.4/linux-arm64-93.gz',
sha256: '25409584f76f3d6ed85463d84adf094eb6e256ed1cb0b754b95bcbda6691fc26',
},

// A similar process is necessary for building on ARM macs:
Expand All @@ -78,13 +78,13 @@ const packages: Package[] = [
// * capture the sha256 with: `shasum -a 256 darwin-arm64-*`
// * upload the `darwin-arm64-*.gz` artifact to the `yarn-prebuilt-artifacts` bucket in GCS using the correct version number
'darwin-arm64': {
url: 'https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/node-re2/uhop/node-re2/releases/download/1.17.7/darwin-arm64-108.gz',
sha256: '42afc32137ff5c5bebae5d68347a9786906748c2f28e06194d8950707f2ae90e',
url: 'https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/node-re2/uhop/node-re2/releases/download/1.17.4/darwin-arm64-93.gz',
sha256: 'd4b708749ddef1c87019f6b80e051ed0c29ccd1de34f233c47d8dcaddf803872',
},

'win32-x64': {
url: 'https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/node-re2/uhop/node-re2/releases/download/1.17.7/win32-x64-108.gz',
sha256: 'ff72fe02de652262659c8e17e44a932f3c873362233756b40d1a97538d05de92',
url: 'https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/node-re2/uhop/node-re2/releases/download/1.17.4/win32-x64-93.gz',
sha256: '0320d0c0385432944c6fb3c8c8fcd78d440ce5626f7618f9ec71d88e44820674',
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ describe('requestOAuthClientCredentialsToken', () => {
"maxSockets": Infinity,
"maxTotalSockets": Infinity,
"options": Object {
"noDelay": true,
"path": null,
"rejectUnauthorized": true,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ describe('requestOAuthJWTToken', () => {
"maxSockets": Infinity,
"maxTotalSockets": Infinity,
"options": Object {
"noDelay": true,
"path": null,
"rejectUnauthorized": true,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ describe('requestOAuthToken', () => {
"maxSockets": Infinity,
"maxTotalSockets": Infinity,
"options": Object {
"noDelay": true,
"path": null,
"rejectUnauthorized": true,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ describe('CurationsTable', () => {
expect(tableContent).toContain('mountains, valleys');

expect(tableContent).toContain('Last updated');
expect(tableContent).toContain('Jan 1, 1970 12:00PM');
expect(tableContent).toContain('Jan 2, 1970 12:00PM');
expect(tableContent).toContain('Jan 1, 1970 12:00 PM');
expect(tableContent).toContain('Jan 2, 1970 12:00 PM');
});

it('renders queries with curation links and curation suggestion badges', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('FormattedDateTime', () => {
const date = new Date('1970-01-01T12:00:00');
const wrapper = mountWithIntl(<FormattedDateTime date={date} />);

expect(wrapper.text()).toEqual('Jan 1, 1970 12:00PM');
expect(wrapper.text()).toEqual('Jan 1, 1970 12:00 PM');
});

it('does not render time if hideTime is passed', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ describe('sendEmailGraphApi', () => {
"maxSockets": Infinity,
"maxTotalSockets": Infinity,
"options": Object {
"noDelay": true,
"path": null,
"rejectUnauthorized": true,
},
Expand Down Expand Up @@ -181,7 +180,6 @@ describe('sendEmailGraphApi', () => {
"maxSockets": Infinity,
"maxTotalSockets": Infinity,
"options": Object {
"noDelay": true,
"path": null,
"rejectUnauthorized": true,
},
Expand Down Expand Up @@ -271,7 +269,6 @@ describe('sendEmailGraphApi', () => {
"maxSockets": Infinity,
"maxTotalSockets": Infinity,
"options": Object {
"noDelay": true,
"path": null,
"rejectUnauthorized": true,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ describe('callAPI', () => {
'x-kibana-version': '8.7.0',
},
httpsAgent: expect.objectContaining({
options: { noDelay: true, rejectUnauthorized: true, path: null },
options: { rejectUnauthorized: true, path: null },
}),
method: 'POST',
url: 'https://service.dev/monitors',
Expand All @@ -213,7 +213,7 @@ describe('callAPI', () => {
'x-kibana-version': '8.7.0',
},
httpsAgent: expect.objectContaining({
options: { noDelay: true, rejectUnauthorized: true, path: null },
options: { rejectUnauthorized: true, path: null },
}),
method: 'POST',
url: 'https://qa.service.elstc.co/monitors',
Expand All @@ -226,7 +226,7 @@ describe('callAPI', () => {
'x-kibana-version': '8.7.0',
},
httpsAgent: expect.objectContaining({
options: { noDelay: true, rejectUnauthorized: true, path: null },
options: { rejectUnauthorized: true, path: null },
}),
method: 'POST',
url: 'https://qa.service.stg.co/monitors',
Expand Down Expand Up @@ -293,7 +293,6 @@ describe('callAPI', () => {
httpsAgent: expect.objectContaining({
options: {
rejectUnauthorized: true,
noDelay: true,
path: null,
cert: 'test-certificate',
key: 'test-key',
Expand Down
Loading