From a667b828df195863381309d8bfa7041e13cc6023 Mon Sep 17 00:00:00 2001 From: Jonathan Budzenski Date: Tue, 26 Dec 2023 08:23:26 -0600 Subject: [PATCH 01/12] [7.17] Upgrade Node.js to v20.10.0 --- .ci/Dockerfile | 2 +- .node-version | 2 +- .nvmrc | 2 +- WORKSPACE.bazel | 12 +++++----- package.json | 6 ++--- .../src/lib/archives/parse.test.ts | 2 +- .../integration_tests/__fixtures__/es_bin.js | 4 ++-- .../discovery/plugin_manifest_parser.test.ts | 2 +- .../discovery/plugins_discovery.test.ts | 2 +- .../build/tasks/patch_native_modules_task.ts | 20 ++++++++--------- .../create_streaming_batched_function.test.ts | 2 +- .../public/search/expressions/esdsl.test.ts | 2 +- src/setup_node_env/exit_on_warning.js | 7 ++++++ .../migrations/user_actions.test.ts | 6 ++--- .../document_creation_logic.test.ts | 2 +- .../server/browsers/download/download.ts | 12 +++++----- .../server/browsers/extract/unzip.test.ts | 4 ++-- .../lib/check_for_json_errors.test.ts | 2 +- .../routes/rules/import_rules_route.test.ts | 2 +- .../create_rules_stream_from_ndjson.test.ts | 4 +++- yarn.lock | 22 +++++++++++++++---- 21 files changed, 71 insertions(+), 48 deletions(-) diff --git a/.ci/Dockerfile b/.ci/Dockerfile index 109b9ffab3cc56..1bc561ba65a601 100644 --- a/.ci/Dockerfile +++ b/.ci/Dockerfile @@ -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.18.2 +ARG NODE_VERSION=20.10.0 FROM node:${NODE_VERSION} AS base diff --git a/.node-version b/.node-version index 87ec8842b158d2..d5a159609d095a 100644 --- a/.node-version +++ b/.node-version @@ -1 +1 @@ -18.18.2 +20.10.0 diff --git a/.nvmrc b/.nvmrc index 87ec8842b158d2..d5a159609d095a 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -18.18.2 +20.10.0 diff --git a/WORKSPACE.bazel b/WORKSPACE.bazel index 148460b32365cd..e62f070403231c 100644 --- a/WORKSPACE.bazel +++ b/WORKSPACE.bazel @@ -27,13 +27,13 @@ check_rules_nodejs_version(minimum_version_string = "3.8.0") # we can update that rule. node_repositories( node_repositories = { - "18.18.2-darwin_amd64": ("node-v18.18.2-darwin-x64.tar.gz", "node-v18.18.2-darwin-x64", "5bb8da908ed590e256a69bf2862238c8a67bc4600119f2f7721ca18a7c810c0f"), - "18.18.2-darwin_arm64": ("node-v18.18.2-darwin-arm64.tar.gz", "node-v18.18.2-darwin-arm64", "9f982cc91b28778dd8638e4f94563b0c2a1da7aba62beb72bd427721035ab553"), - "18.18.2-linux_arm64": ("node-v18.18.2-linux-arm64.tar.xz", "node-v18.18.2-linux-arm64", "8a5a03f6a742159c9aa0ae3a99b368cd938cf62f3a5522a2e5acbe6313710efe"), - "18.18.2-linux_amd64": ("node-v18.18.2-linux-x64.tar.xz", "node-v18.18.2-linux-x64", "f7cf590bc7153f3beaa9e1138d00e50d74df223f0bec61f63e7df65f7315b76a"), - "18.18.2-windows_amd64": ("node-v18.18.2-win-x64.zip", "node-v18.18.2-win-x64", "3bb0e51e579a41a22b3bf6cb2f3e79c03801aa17acbe0ca00fc555d1282e7acd"), + "20.10.0-darwin_amd64": ("node-v20.10.0-darwin-x64.tar.gz", "node-v20.10.0-darwin-x64", "5ff5e8abd3eea6e5f507eb6677554f5b2188eedef654096aa4168a9941e91a32"), + "20.10.0-darwin_arm64": ("node-v20.10.0-darwin-arm64.tar.gz", "node-v20.10.0-darwin-arm64", "68b93099451d77aac116cf8fce179cabcf53fec079508dc6b39d3a086fb461a8"), + "20.10.0-linux_arm64": ("node-v20.10.0-linux-arm64.tar.xz", "node-v20.10.0-linux-arm64", "a5c22683890d5d244f3afd488ef44e573b5b8287f8911b9a1b061ed3f20a5e6d"), + "20.10.0-linux_amd64": ("node-v20.10.0-linux-x64.tar.xz", "node-v20.10.0-linux-x64", "9c0fbc8cc7be9a6543af4b9afb05759c538c0f81015c388d63277b0158507697"), + "20.10.0-windows_amd64": ("node-v20.10.0-win-x64.zip", "node-v20.10.0-win-x64", "e5b861814a97e28ae7ac06a34e88fd5e0565b447d270c26e20b5ef60bf0aaaf9"), }, - node_version = "18.18.2", + node_version = "20.10.0", node_urls = [ "https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/dist/v{version}/{filename}", ], diff --git a/package.json b/package.json index 6e2adc69aa6efa..92b9223f05f5eb 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "url": "https://github.com/elastic/kibana.git" }, "engines": { - "node": "18.18.2", + "node": "20.10.0", "yarn": "^1.21.1" }, "resolutions": { @@ -76,7 +76,7 @@ "**/@babel/traverse": "^7.21.2", "**/@babel/types": "^7.21.2", "**/@types/babel__generator/@babel/types": "^7.21.0", - "**/@types/node": "18.18.5", + "**/@types/node": "20.10.0", "**/@types/react": "^16.14.25", "**/@types/react-dom": "^16.9.8", "**/@typescript-eslint/utils": "5.62.0", @@ -582,7 +582,7 @@ "@types/mustache": "^0.8.31", "@types/ncp": "^2.0.1", "@types/nock": "^10.0.3", - "@types/node": "18.18.5", + "@types/node": "20.10.5", "@types/node-fetch": "2.6.4", "@types/node-forge": "^1.3.10", "@types/nodemailer": "^6.4.0", diff --git a/packages/kbn-es-archiver/src/lib/archives/parse.test.ts b/packages/kbn-es-archiver/src/lib/archives/parse.test.ts index ae8fc7216ba27f..0cf1c600e09e95 100644 --- a/packages/kbn-es-archiver/src/lib/archives/parse.test.ts +++ b/packages/kbn-es-archiver/src/lib/archives/parse.test.ts @@ -114,7 +114,7 @@ describe('esArchiver createParseArchiveStreams', () => { ] as [Readable, ...Writable[]]); throw new Error('should have failed'); } catch (err) { - expect(err.message).toEqual(expect.stringContaining('Unexpected number')); + expect(err.message).toEqual(`Expected property name or '}' in JSON at position 1`); } }); }); diff --git a/packages/kbn-es/src/integration_tests/__fixtures__/es_bin.js b/packages/kbn-es/src/integration_tests/__fixtures__/es_bin.js index 5ef61456988115..0d44b8a775b25d 100644 --- a/packages/kbn-es/src/integration_tests/__fixtures__/es_bin.js +++ b/packages/kbn-es/src/integration_tests/__fixtures__/es_bin.js @@ -87,11 +87,11 @@ const { ES_KEY_PATH, ES_CERT_PATH } = require('@kbn/dev-utils'); } ); - // setup server auto close after 1 second of silence + // setup server auto close after 5 second of silence let serverCloseTimer; const delayServerClose = () => { clearTimeout(serverCloseTimer); - serverCloseTimer = setTimeout(() => server.close(), 1000); + serverCloseTimer = setTimeout(() => server.close(), 5000); }; server.on('request', delayServerClose); server.on('listening', delayServerClose); diff --git a/src/core/server/plugins/discovery/plugin_manifest_parser.test.ts b/src/core/server/plugins/discovery/plugin_manifest_parser.test.ts index 9d1cef302d1bde..54aed75ca24f68 100644 --- a/src/core/server/plugins/discovery/plugin_manifest_parser.test.ts +++ b/src/core/server/plugins/discovery/plugin_manifest_parser.test.ts @@ -57,7 +57,7 @@ test('return error when manifest content is not a valid JSON', async () => { }); await expect(parseManifest(pluginPath, packageInfo)).rejects.toMatchObject({ - message: `Unexpected token o in JSON at position 1 (invalid-manifest, ${pluginManifestPath})`, + message: `Unexpected token 'o', "not-json" is not valid JSON (invalid-manifest, ${pluginManifestPath})`, type: PluginDiscoveryErrorType.InvalidManifest, path: pluginManifestPath, }); diff --git a/src/core/server/plugins/discovery/plugins_discovery.test.ts b/src/core/server/plugins/discovery/plugins_discovery.test.ts index ac7faf894fbb6d..f970f153fac546 100644 --- a/src/core/server/plugins/discovery/plugins_discovery.test.ts +++ b/src/core/server/plugins/discovery/plugins_discovery.test.ts @@ -234,7 +234,7 @@ describe('plugins discovery system', () => { .toPromise(); expect(errors).toContain( - `Error: Unexpected token o in JSON at position 1 (invalid-manifest, ${manifestPath( + `Error: Unexpected token 'o', "not-json" is not valid JSON (invalid-manifest, ${manifestPath( 'plugin_a' )})` ); diff --git a/src/dev/build/tasks/patch_native_modules_task.ts b/src/dev/build/tasks/patch_native_modules_task.ts index 9c8a92a254d573..1f622c52321db7 100644 --- a/src/dev/build/tasks/patch_native_modules_task.ts +++ b/src/dev/build/tasks/patch_native_modules_task.ts @@ -47,8 +47,8 @@ const packages: Package[] = [ extractMethod: 'gunzip', archives: { 'linux-x64': { - url: 'https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/node-re2/uhop/node-re2/releases/download/1.20.9/linux-x64-108.gz', - sha256: '136b6cf61b54bf610071a950400518add65d44a4923f11ef658769df1a037f0b', + url: 'https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/node-re2/uhop/node-re2/releases/download/1.20.9/linux-x64-115.gz', + sha256: 'b88183fe7bc8afa260d22cd909f496ab5636aace7075b54ac345d33ea32aedc0', }, // Linux ARM builds are currently done manually as Github Actions used in upstream project // do not natively support an Linux ARM target. @@ -63,20 +63,20 @@ 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.20.9/linux-arm64-108.gz', - sha256: '311822ac689bd49a534ecf400b4732a288ad218f711b0e593e41dd3a6b739d97', + url: 'https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/node-re2/uhop/node-re2/releases/download/1.20.9/linux-arm64-115.gz', + sha256: '6c04136a6658df3dcc5b8ac0041641c227d232bed385fe55f62c8470f8db041d', }, 'darwin-x64': { - url: 'https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/node-re2/uhop/node-re2/releases/download/1.20.9/darwin-x64-108.gz', - sha256: '215b6ffb1e5d124439a7dbdd09e4ed1263e065839354a6ad67091ce00d14ee9b', + url: 'https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/node-re2/uhop/node-re2/releases/download/1.20.9/darwin-x64-115.gz', + sha256: '1e0d79983c94222c414a5410444ec0ccf37614fd0e45187d0f313a19b203702c', }, 'darwin-arm64': { - url: 'https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/node-re2/uhop/node-re2/releases/download/1.20.9/darwin-arm64-108.gz', - sha256: '0a8bc28150c9efd04f3b52ac214cc7898bde1b8e1f8e6900ae711b03665ff657', + url: 'https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/node-re2/uhop/node-re2/releases/download/1.20.9/darwin-arm64-115.gz', + sha256: '192c8e036062504b818941989c44ddb799efe0419d039f7089caedb09d49a597', }, 'win32-x64': { - url: 'https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/node-re2/uhop/node-re2/releases/download/1.20.9/win32-x64-108.gz', - sha256: '117872144e4a2bb61611aacc51ac9fd24e494c209cf63366f236099a662316eb', + url: 'https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/node-re2/uhop/node-re2/releases/download/1.20.9/win32-x64-115.gz', + sha256: '01ae2df89f976f4097e50e121d7ec6ac62ec8050c838107dcfb976d037a60d59', }, }, }, diff --git a/src/plugins/bfetch/public/batching/create_streaming_batched_function.test.ts b/src/plugins/bfetch/public/batching/create_streaming_batched_function.test.ts index 7598fb03c767ac..144a9ee6e9e2a4 100644 --- a/src/plugins/bfetch/public/batching/create_streaming_batched_function.test.ts +++ b/src/plugins/bfetch/public/batching/create_streaming_batched_function.test.ts @@ -717,7 +717,7 @@ describe('createStreamingBatchedFunction()', () => { const [, error1] = await promise1; const [result1] = await promise2; expect(error1).toMatchObject({ - message: 'Unexpected token N in JSON at position 0', + message: `Unexpected token 'N', "Not a JSON\n" is not valid JSON`, code: 'STREAM', }); expect(result1).toMatchObject({ diff --git a/src/plugins/data/public/search/expressions/esdsl.test.ts b/src/plugins/data/public/search/expressions/esdsl.test.ts index f39b33c252ded8..3f651a4d80bdb1 100644 --- a/src/plugins/data/public/search/expressions/esdsl.test.ts +++ b/src/plugins/data/public/search/expressions/esdsl.test.ts @@ -63,7 +63,7 @@ describe('esdsl', () => { } catch (error) { errorMessage = error.message; } - expect(errorMessage).toEqual('Unexpected token i in JSON at position 0'); + expect(errorMessage).toEqual(`Unexpected token 'i', "invalid json" is not valid JSON`); }); test('adds filters', async () => { diff --git a/src/setup_node_env/exit_on_warning.js b/src/setup_node_env/exit_on_warning.js index 998dd02a6bff0c..2dc54b768c771d 100644 --- a/src/setup_node_env/exit_on_warning.js +++ b/src/setup_node_env/exit_on_warning.js @@ -52,6 +52,13 @@ var IGNORE_WARNINGS = [ // We need to discard that warning name: 'ProductNotSupportedSecurityError', }, + // https://github.com/browserify/browserify-rsa/pull/20 + { + name: 'DeprecationWarning', + code: 'DEP0170', + message: + 'The URL https://github.com:crypto-browserify/browserify-rsa.git is invalid. Future versions of Node.js will throw an error.', + }, ]; if (process.noProcessWarnings !== true) { diff --git a/x-pack/plugins/cases/server/saved_object_types/migrations/user_actions.test.ts b/x-pack/plugins/cases/server/saved_object_types/migrations/user_actions.test.ts index 9c544ad116b979..6953abc90cbe7a 100644 --- a/x-pack/plugins/cases/server/saved_object_types/migrations/user_actions.test.ts +++ b/x-pack/plugins/cases/server/saved_object_types/migrations/user_actions.test.ts @@ -223,7 +223,7 @@ describe('user action migrations', () => { const log = context.log as jest.Mocked; expect(log.error.mock.calls[0]).toMatchInlineSnapshot(` Array [ - "Failed to migrate user action connector with doc id: 1 version: 8.0.0 error: Unexpected token a in JSON at position 1", + "Failed to migrate user action connector with doc id: 1 version: 8.0.0 error: Expected property name or '}' in JSON at position 1", Object { "migrations": Object { "userAction": Object { @@ -403,7 +403,7 @@ describe('user action migrations', () => { const log = context.log as jest.Mocked; expect(log.error.mock.calls[0]).toMatchInlineSnapshot(` Array [ - "Failed to migrate user action connector with doc id: 1 version: 8.0.0 error: Unexpected token b in JSON at position 1", + "Failed to migrate user action connector with doc id: 1 version: 8.0.0 error: Expected property name or '}' in JSON at position 1", Object { "migrations": Object { "userAction": Object { @@ -585,7 +585,7 @@ describe('user action migrations', () => { const log = context.log as jest.Mocked; expect(log.error.mock.calls[0]).toMatchInlineSnapshot(` Array [ - "Failed to migrate user action connector with doc id: 1 version: 8.0.0 error: Unexpected token e in JSON at position 1", + "Failed to migrate user action connector with doc id: 1 version: 8.0.0 error: Unexpected token 'e', \\"new json value\\" is not valid JSON", Object { "migrations": Object { "userAction": Object { diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/document_creation/document_creation_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/document_creation/document_creation_logic.test.ts index 753871765896a1..35f6f4a0e180ad 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/document_creation/document_creation_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/document_creation/document_creation_logic.test.ts @@ -385,7 +385,7 @@ describe('DocumentCreationLogic', () => { DocumentCreationLogic.actions.onSubmitJson(); expect(DocumentCreationLogic.actions.setErrors).toHaveBeenCalledWith([ - 'Unexpected token i in JSON at position 0', + `Unexpected token 'i', "invalid JSON" is not valid JSON`, ]); expect(DocumentCreationLogic.actions.uploadDocuments).not.toHaveBeenCalled(); }); diff --git a/x-pack/plugins/reporting/server/browsers/download/download.ts b/x-pack/plugins/reporting/server/browsers/download/download.ts index 458e3a558549bb..35719ab91764d5 100644 --- a/x-pack/plugins/reporting/server/browsers/download/download.ts +++ b/x-pack/plugins/reporting/server/browsers/download/download.ts @@ -7,7 +7,8 @@ import Axios from 'axios'; import { createHash } from 'crypto'; -import { closeSync, mkdirSync, openSync, writeSync } from 'fs'; +import { mkdir, open } from 'fs/promises'; +import { writeSync } from 'fs'; import { dirname } from 'path'; import { GenericLevelLogger } from '../../lib/level_logger'; @@ -23,9 +24,8 @@ export async function download( const hash = createHash('sha256'); - mkdirSync(dirname(path), { recursive: true }); - const handle = openSync(path, 'w'); - + await mkdir(dirname(path), { recursive: true }); + const handle = await open(path, 'w'); try { const resp = await Axios.request({ url, @@ -34,7 +34,7 @@ export async function download( }); resp.data.on('data', (chunk: Buffer) => { - writeSync(handle, chunk); + writeSync(handle.fd, chunk); hash.update(chunk); }); @@ -52,7 +52,7 @@ export async function download( } catch (err) { throw new Error(`Unable to download ${url}: ${err}`); } finally { - closeSync(handle); + await handle.close(); } return hash.digest('hex'); diff --git a/x-pack/plugins/reporting/server/browsers/extract/unzip.test.ts b/x-pack/plugins/reporting/server/browsers/extract/unzip.test.ts index 4af457a0c3a6e3..08eac21450f262 100644 --- a/x-pack/plugins/reporting/server/browsers/extract/unzip.test.ts +++ b/x-pack/plugins/reporting/server/browsers/extract/unzip.test.ts @@ -6,7 +6,7 @@ */ import mockFs from 'mock-fs'; -import { readFileSync } from 'fs'; +import { readFile } from 'fs/promises'; import { ExtractError } from './extract_error'; import { unzip } from './unzip'; @@ -28,7 +28,7 @@ describe('unzip', () => { it('should extract zipped contents', async () => { await unzip('/test.zip', '/output'); - expect(readFileSync('/output/test.txt').toString()).toEqual('test'); + await expect(readFile('/output/test.txt', 'utf8')).resolves.toBe('test'); }); it('should reject on invalid archive', async () => { diff --git a/x-pack/plugins/searchprofiler/public/application/lib/check_for_json_errors.test.ts b/x-pack/plugins/searchprofiler/public/application/lib/check_for_json_errors.test.ts index ccd8761c031b23..606b302fc85594 100644 --- a/x-pack/plugins/searchprofiler/public/application/lib/check_for_json_errors.test.ts +++ b/x-pack/plugins/searchprofiler/public/application/lib/check_for_json_errors.test.ts @@ -12,7 +12,7 @@ describe('checkForParseErrors', function () { it('returns error from bad JSON', function () { const json = '{"foo": {"bar": {"baz": "buzz}}}'; const result = checkForParseErrors(json); - expect(result.error.message).to.be(`Unexpected end of JSON input`); + expect(result.error.message).to.be(`Unterminated string in JSON at position 32`); }); it('returns parsed value from good JSON', function () { diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/import_rules_route.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/import_rules_route.test.ts index 86be61e8f9c99c..c999584596901e 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/import_rules_route.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/import_rules_route.test.ts @@ -185,7 +185,7 @@ describe.each([ errors: [ { error: { - message: 'Unexpected token h in JSON at position 1', + message: `Unexpected token 'h', "this is not"... is not valid JSON`, status_code: 400, }, rule_id: '(unknown id)', diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/create_rules_stream_from_ndjson.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/create_rules_stream_from_ndjson.test.ts index 434da08791c06e..4e6ea50f6b7a4f 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/create_rules_stream_from_ndjson.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/create_rules_stream_from_ndjson.test.ts @@ -324,7 +324,9 @@ describe('create_rules_stream_from_ndjson', () => { references: [], version: 1, }); - expect(resultOrError[1].message).toEqual('Unexpected token , in JSON at position 1'); + expect(resultOrError[1].message).toEqual( + `Expected property name or '}' in JSON at position 1` + ); expect(resultOrError[2]).toEqual({ author: [], actions: [], diff --git a/yarn.lock b/yarn.lock index b99c6f519db79e..6486a58fcd44cf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6441,10 +6441,19 @@ dependencies: "@types/node" "*" -"@types/node@*", "@types/node@18.18.5", "@types/node@>= 8", "@types/node@>=8.9.0", "@types/node@^10.1.0", "@types/node@^14.0.10 || ^16.0.0", "@types/node@^14.14.20 || ^16.0.0", "@types/node@^18.17.5": - version "18.18.5" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.18.5.tgz#afc0fd975df946d6e1add5bbf98264225b212244" - integrity sha512-4slmbtwV59ZxitY4ixUZdy1uRLf9eSIvBWPQxNjhHYWEtn0FryfKpyS2cvADYXTayWdKEIsJengncrVvkI4I6A== +"@types/node@*", "@types/node@20.10.0", "@types/node@>= 8", "@types/node@>=8.9.0", "@types/node@^10.1.0", "@types/node@^14.0.10 || ^16.0.0", "@types/node@^14.14.20 || ^16.0.0", "@types/node@^18.17.5": + version "20.10.0" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.10.0.tgz#16ddf9c0a72b832ec4fcce35b8249cf149214617" + integrity sha512-D0WfRmU9TQ8I9PFx9Yc+EBHw+vSpIub4IDvQivcp26PtPrdMGAq5SDcpXEo/epqa/DXotVpekHiLNTg3iaKXBQ== + dependencies: + undici-types "~5.26.4" + +"@types/node@20.10.5": + version "20.10.5" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.10.5.tgz#47ad460b514096b7ed63a1dae26fad0914ed3ab2" + integrity sha512-nNPsNE65wjMxEKI93yOP+NPGGBJz/PoN3kZsVLee0XMiJolxSekEVD8wRwBUBqkwc7UWop0edW50yrCQW4CyRw== + dependencies: + undici-types "~5.26.4" "@types/nodemailer@^6.4.0": version "6.4.0" @@ -27969,6 +27978,11 @@ undertaker@^1.2.1: object.reduce "^1.0.0" undertaker-registry "^1.0.0" +undici-types@~5.26.4: + version "5.26.5" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" + integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== + undici@^5.21.2: version "5.26.3" resolved "https://registry.yarnpkg.com/undici/-/undici-5.26.3.tgz#ab3527b3d5bb25b12f898dfd22165d472dd71b79" From b7d3601a048d0131f9d6ad215dda872956a7c530 Mon Sep 17 00:00:00 2001 From: Jonathan Budzenski Date: Tue, 26 Dec 2023 09:37:16 -0600 Subject: [PATCH 02/12] fix lint error --- .../document_creation/document_creation_logic.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/document_creation/document_creation_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/document_creation/document_creation_logic.test.ts index 35f6f4a0e180ad..1f669fc26e0f11 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/document_creation/document_creation_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/document_creation/document_creation_logic.test.ts @@ -385,7 +385,7 @@ describe('DocumentCreationLogic', () => { DocumentCreationLogic.actions.onSubmitJson(); expect(DocumentCreationLogic.actions.setErrors).toHaveBeenCalledWith([ - `Unexpected token 'i', "invalid JSON" is not valid JSON`, + 'Unexpected token \'i\', "invalid JSON" is not valid JSON', ]); expect(DocumentCreationLogic.actions.uploadDocuments).not.toHaveBeenCalled(); }); From 490818edfba2818e2f830400e77c6df5a1710ad5 Mon Sep 17 00:00:00 2001 From: Jonathan Budzenski Date: Tue, 26 Dec 2023 09:40:42 -0600 Subject: [PATCH 03/12] fix snapshot --- x-pack/test/functional/apps/canvas/reports.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/test/functional/apps/canvas/reports.ts b/x-pack/test/functional/apps/canvas/reports.ts index e21ec5b404d1f8..76110d64f58aea 100644 --- a/x-pack/test/functional/apps/canvas/reports.ts +++ b/x-pack/test/functional/apps/canvas/reports.ts @@ -87,7 +87,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { endobj 8 0 obj << - /Length 149 + /Length 158 /Filter /FlateDecode >> " From 78e138bae812616b4b9e6ba45eb0bdf9473c6502 Mon Sep 17 00:00:00 2001 From: Jonathan Budzenski Date: Tue, 26 Dec 2023 09:42:46 -0600 Subject: [PATCH 04/12] fix snapshot --- test/functional/apps/management/_import_objects.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/functional/apps/management/_import_objects.ts b/test/functional/apps/management/_import_objects.ts index 6ef0bfd5a09e8a..f83049fe5eb577 100644 --- a/test/functional/apps/management/_import_objects.ts +++ b/test/functional/apps/management/_import_objects.ts @@ -486,7 +486,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const errorText = await PageObjects.savedObjects.getImportErrorText(); - expect(errorText).to.contain(`Unexpected token T in JSON at position 0`); + expect(errorText).to.contain('is not valid JSON'); }); }); }); From 2eb4eac79c781d6d02a1dc851b04977d849f8246 Mon Sep 17 00:00:00 2001 From: Jonathan Budzenski Date: Tue, 26 Dec 2023 11:34:38 -0600 Subject: [PATCH 05/12] update snapshot --- .../public/lib/import_legacy_file.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/saved_objects_management/public/lib/import_legacy_file.test.ts b/src/plugins/saved_objects_management/public/lib/import_legacy_file.test.ts index 2554c78514de3a..b21ca43ed0399d 100644 --- a/src/plugins/saved_objects_management/public/lib/import_legacy_file.test.ts +++ b/src/plugins/saved_objects_management/public/lib/import_legacy_file.test.ts @@ -20,7 +20,7 @@ describe('importFile', () => { const file = new File([`not_parseable`], 'file.json'); await expect(importLegacyFile(file)).rejects.toThrowErrorMatchingInlineSnapshot( - `"Unexpected token o in JSON at position 1"` + `"Unexpected token 'o', \\"not_parseable\\" is not valid JSON"` ); }); }); From ffd2c7e4bc63f48dc84e1daeaa035cc13d5bf056 Mon Sep 17 00:00:00 2001 From: Jonathan Budzenski Date: Tue, 26 Dec 2023 11:36:10 -0600 Subject: [PATCH 06/12] update snapshot --- x-pack/test/functional/apps/canvas/reports.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/test/functional/apps/canvas/reports.ts b/x-pack/test/functional/apps/canvas/reports.ts index 76110d64f58aea..097be643bc1a4e 100644 --- a/x-pack/test/functional/apps/canvas/reports.ts +++ b/x-pack/test/functional/apps/canvas/reports.ts @@ -131,7 +131,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { endobj 9 0 obj << - /Length 270 + /Length 268 /Filter /FlateDecode >> " From d910f11016d777e72df095ddb98c9d89447cb819 Mon Sep 17 00:00:00 2001 From: Jonathan Budzenski Date: Tue, 26 Dec 2023 12:32:11 -0600 Subject: [PATCH 07/12] update snapshot --- x-pack/test/functional/apps/canvas/reports.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/test/functional/apps/canvas/reports.ts b/x-pack/test/functional/apps/canvas/reports.ts index 097be643bc1a4e..f1e0d9f2aed06c 100644 --- a/x-pack/test/functional/apps/canvas/reports.ts +++ b/x-pack/test/functional/apps/canvas/reports.ts @@ -192,7 +192,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { endobj 21 0 obj << - /Length 250 + /Length 254 /Filter /FlateDecode >> " From 757030b9c1f7c09f6eda75dfb19d4574c77f075f Mon Sep 17 00:00:00 2001 From: Jonathan Budzenski Date: Tue, 26 Dec 2023 14:38:54 -0600 Subject: [PATCH 08/12] check content length --- x-pack/test/functional/apps/canvas/reports.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/x-pack/test/functional/apps/canvas/reports.ts b/x-pack/test/functional/apps/canvas/reports.ts index f1e0d9f2aed06c..d67efcf73f4afe 100644 --- a/x-pack/test/functional/apps/canvas/reports.ts +++ b/x-pack/test/functional/apps/canvas/reports.ts @@ -199,6 +199,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { `); const contentLength = parseInt(res.get('content-length'), 10); + expect(contentLength).to.be(20725); expect(contentLength >= 20725 && contentLength <= 20726).to.be(true); // contentLength can be between 20725 and 20726 }); From 6870bd351b7d46d4b5ed4309b125d959a5fc2dd7 Mon Sep 17 00:00:00 2001 From: Jonathan Budzenski Date: Tue, 26 Dec 2023 17:54:55 -0600 Subject: [PATCH 09/12] fix content length --- x-pack/test/functional/apps/canvas/reports.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/x-pack/test/functional/apps/canvas/reports.ts b/x-pack/test/functional/apps/canvas/reports.ts index d67efcf73f4afe..a5fd2c280b59f9 100644 --- a/x-pack/test/functional/apps/canvas/reports.ts +++ b/x-pack/test/functional/apps/canvas/reports.ts @@ -199,8 +199,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { `); const contentLength = parseInt(res.get('content-length'), 10); - expect(contentLength).to.be(20725); - expect(contentLength >= 20725 && contentLength <= 20726).to.be(true); // contentLength can be between 20725 and 20726 + expect(contentLength >= 20723 && contentLength <= 20724).to.be(true); // contentLength can be between 20723 and 20724 }); it('downloaded PDF base64 string is correct without borders and logo', async function () { From ee3097bd8d93623f1108baf588f648f155185dce Mon Sep 17 00:00:00 2001 From: Jonathan Budzenski Date: Wed, 27 Dec 2023 05:46:10 -0600 Subject: [PATCH 10/12] length 47 --- x-pack/test/functional/apps/canvas/reports.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/test/functional/apps/canvas/reports.ts b/x-pack/test/functional/apps/canvas/reports.ts index a5fd2c280b59f9..e123fb1c16827e 100644 --- a/x-pack/test/functional/apps/canvas/reports.ts +++ b/x-pack/test/functional/apps/canvas/reports.ts @@ -261,7 +261,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { endobj 6 0 obj << - /Length 45 + /Length 47 /Filter /FlateDecode >> " From 38b1b09f914c941e331a095456550e7e51479f59 Mon Sep 17 00:00:00 2001 From: Jonathan Budzenski Date: Wed, 27 Dec 2023 07:20:10 -0600 Subject: [PATCH 11/12] update content length --- x-pack/test/functional/apps/canvas/reports.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/test/functional/apps/canvas/reports.ts b/x-pack/test/functional/apps/canvas/reports.ts index e123fb1c16827e..6d82498adfa12a 100644 --- a/x-pack/test/functional/apps/canvas/reports.ts +++ b/x-pack/test/functional/apps/canvas/reports.ts @@ -348,7 +348,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { " `); - expect(res.get('content-length')).to.be('1598'); + expect(res.get('content-length')).to.be('1600'); }); }); }); From 4bc5572e76ca937d73ef22515efc6394ebcf3bf0 Mon Sep 17 00:00:00 2001 From: Jonathan Budzenski Date: Tue, 2 Jan 2024 11:33:30 -0600 Subject: [PATCH 12/12] fix types resolution --- package.json | 4 ++-- yarn.lock | 17 +++++------------ 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/package.json b/package.json index d94d955e084033..9563f95d3d40e5 100644 --- a/package.json +++ b/package.json @@ -70,7 +70,7 @@ "yarn": "^1.21.1" }, "resolutions": { - "**/@types/node": "20.10.0", + "**/@types/node": "20.10.6", "**/@types/react": "^16.14.25", "**/@types/react-dom": "^16.9.8", "**/@typescript-eslint/utils": "5.62.0", @@ -576,7 +576,7 @@ "@types/mustache": "^0.8.31", "@types/ncp": "^2.0.1", "@types/nock": "^10.0.3", - "@types/node": "20.10.5", + "@types/node": "20.10.6", "@types/node-fetch": "2.6.4", "@types/node-forge": "^1.3.10", "@types/nodemailer": "^6.4.0", diff --git a/yarn.lock b/yarn.lock index 3fffef57282808..619811508a53c6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6157,17 +6157,10 @@ dependencies: "@types/node" "*" -"@types/node@*", "@types/node@20.10.0", "@types/node@>= 8", "@types/node@>=8.9.0", "@types/node@^10.1.0", "@types/node@^14.0.10 || ^16.0.0", "@types/node@^14.14.20 || ^16.0.0", "@types/node@^18.17.5": - version "20.10.0" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.10.0.tgz#16ddf9c0a72b832ec4fcce35b8249cf149214617" - integrity sha512-D0WfRmU9TQ8I9PFx9Yc+EBHw+vSpIub4IDvQivcp26PtPrdMGAq5SDcpXEo/epqa/DXotVpekHiLNTg3iaKXBQ== - dependencies: - undici-types "~5.26.4" - -"@types/node@20.10.5": - version "20.10.5" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.10.5.tgz#47ad460b514096b7ed63a1dae26fad0914ed3ab2" - integrity sha512-nNPsNE65wjMxEKI93yOP+NPGGBJz/PoN3kZsVLee0XMiJolxSekEVD8wRwBUBqkwc7UWop0edW50yrCQW4CyRw== +"@types/node@*", "@types/node@20.10.6", "@types/node@>= 8", "@types/node@>=8.9.0", "@types/node@^10.1.0", "@types/node@^14.0.10 || ^16.0.0", "@types/node@^14.14.20 || ^16.0.0", "@types/node@^18.17.5": + version "20.10.6" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.10.6.tgz#a3ec84c22965802bf763da55b2394424f22bfbb5" + integrity sha512-Vac8H+NlRNNlAmDfGUP7b5h/KA+AtWIzuXy0E6OyP8f1tCLYAtPvKRRDJjAPqhpCb0t6U2j7/xqAuLEebW2kiw== dependencies: undici-types "~5.26.4" @@ -8331,7 +8324,7 @@ axios@^0.21.1: dependencies: follow-redirects "^1.14.0" -axios@^1.6.3, axios@^1.6.0: +axios@^1.6.0, axios@^1.6.3: version "1.6.3" resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.3.tgz#7f50f23b3aa246eff43c54834272346c396613f4" integrity sha512-fWyNdeawGam70jXSVlKl+SUNVcL6j6W79CuSIPfi6HnDUmSCH6gyUys/HrqHeA/wU0Az41rRgean494d0Jb+ww==