diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.searchstrategydependencies.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.searchstrategydependencies.md index b47e00542da9..d3abc8bcaf44 100644 --- a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.searchstrategydependencies.md +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.searchstrategydependencies.md @@ -15,6 +15,7 @@ export interface SearchStrategyDependencies | Property | Type | Description | | --- | --- | --- | | [esClient](./kibana-plugin-plugins-data-server.searchstrategydependencies.esclient.md) | IScopedClusterClient | | +| [request](./kibana-plugin-plugins-data-server.searchstrategydependencies.request.md) | KibanaRequest | | | [savedObjectsClient](./kibana-plugin-plugins-data-server.searchstrategydependencies.savedobjectsclient.md) | SavedObjectsClientContract | | | [searchSessionsClient](./kibana-plugin-plugins-data-server.searchstrategydependencies.searchsessionsclient.md) | IScopedSearchSessionsClient | | | [uiSettingsClient](./kibana-plugin-plugins-data-server.searchstrategydependencies.uisettingsclient.md) | IUiSettingsClient | | diff --git a/packages/elastic-datemath/BUILD.bazel b/packages/elastic-datemath/BUILD.bazel index f3eb4548088c..7c5bb7d07c85 100644 --- a/packages/elastic-datemath/BUILD.bazel +++ b/packages/elastic-datemath/BUILD.bazel @@ -55,7 +55,7 @@ ts_project( js_library( name = PKG_BASE_NAME, srcs = NPM_MODULE_EXTRA_FILES, - deps = [":tsc"] + DEPS, + deps = DEPS + [":tsc"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) diff --git a/packages/kbn-ace/BUILD.bazel b/packages/kbn-ace/BUILD.bazel index f52754d86477..78e986d6e071 100644 --- a/packages/kbn-ace/BUILD.bazel +++ b/packages/kbn-ace/BUILD.bazel @@ -64,7 +64,7 @@ ts_project( js_library( name = PKG_BASE_NAME, srcs = NPM_MODULE_EXTRA_FILES, - deps = [":tsc"] + DEPS, + deps = DEPS + [":tsc"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) @@ -82,4 +82,4 @@ filegroup( ":npm_module", ], visibility = ["//visibility:public"], -) \ No newline at end of file +) diff --git a/packages/kbn-analytics/BUILD.bazel b/packages/kbn-analytics/BUILD.bazel index a5506598baea..1749a3dcdc81 100644 --- a/packages/kbn-analytics/BUILD.bazel +++ b/packages/kbn-analytics/BUILD.bazel @@ -103,7 +103,7 @@ pkg_npm( js_library( name = PKG_BASE_NAME, srcs = NPM_MODULE_EXTRA_FILES, - deps = [":target"] + DEPS, + deps = DEPS + [":target"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) diff --git a/packages/kbn-apm-config-loader/BUILD.bazel b/packages/kbn-apm-config-loader/BUILD.bazel index 58a86ccfcf01..09a121d71575 100644 --- a/packages/kbn-apm-config-loader/BUILD.bazel +++ b/packages/kbn-apm-config-loader/BUILD.bazel @@ -66,7 +66,7 @@ ts_project( js_library( name = PKG_BASE_NAME, srcs = NPM_MODULE_EXTRA_FILES, - deps = [":tsc"] + DEPS, + deps = DEPS + [":tsc"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) diff --git a/packages/kbn-apm-utils/BUILD.bazel b/packages/kbn-apm-utils/BUILD.bazel index 335494bea45f..328fd91a5d96 100644 --- a/packages/kbn-apm-utils/BUILD.bazel +++ b/packages/kbn-apm-utils/BUILD.bazel @@ -54,7 +54,7 @@ ts_project( js_library( name = PKG_BASE_NAME, srcs = NPM_MODULE_EXTRA_FILES, - deps = [":tsc"] + DEPS, + deps = DEPS + [":tsc"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) diff --git a/packages/kbn-babel-code-parser/BUILD.bazel b/packages/kbn-babel-code-parser/BUILD.bazel index e8869cb40555..c1576ce59aa5 100644 --- a/packages/kbn-babel-code-parser/BUILD.bazel +++ b/packages/kbn-babel-code-parser/BUILD.bazel @@ -53,7 +53,7 @@ babel( js_library( name = PKG_BASE_NAME, srcs = NPM_MODULE_EXTRA_FILES, - deps = [":target"] + DEPS, + deps = DEPS + [":target"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) diff --git a/packages/kbn-config-schema/BUILD.bazel b/packages/kbn-config-schema/BUILD.bazel index 0c6b3c10db4f..1ae4fa5eeeb2 100644 --- a/packages/kbn-config-schema/BUILD.bazel +++ b/packages/kbn-config-schema/BUILD.bazel @@ -64,7 +64,7 @@ ts_project( js_library( name = PKG_BASE_NAME, srcs = NPM_MODULE_EXTRA_FILES, - deps = [":tsc"] + DEPS, + deps = DEPS + [":tsc"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) diff --git a/packages/kbn-config/BUILD.bazel b/packages/kbn-config/BUILD.bazel index a079d9c8f641..bc21f827addd 100644 --- a/packages/kbn-config/BUILD.bazel +++ b/packages/kbn-config/BUILD.bazel @@ -76,7 +76,7 @@ ts_project( js_library( name = PKG_BASE_NAME, srcs = NPM_MODULE_EXTRA_FILES, - deps = [":tsc"] + DEPS, + deps = DEPS + [":tsc"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) diff --git a/packages/kbn-crypto/BUILD.bazel b/packages/kbn-crypto/BUILD.bazel index 14e292c056db..b1723e4120e7 100644 --- a/packages/kbn-crypto/BUILD.bazel +++ b/packages/kbn-crypto/BUILD.bazel @@ -67,7 +67,7 @@ ts_project( js_library( name = PKG_BASE_NAME, srcs = NPM_MODULE_EXTRA_FILES, - deps = [":tsc"] + DEPS, + deps = DEPS + [":tsc"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) @@ -85,4 +85,4 @@ filegroup( ":npm_module", ], visibility = ["//visibility:public"], -) \ No newline at end of file +) diff --git a/packages/kbn-dev-utils/BUILD.bazel b/packages/kbn-dev-utils/BUILD.bazel index e3935040240d..9109f766e0e9 100644 --- a/packages/kbn-dev-utils/BUILD.bazel +++ b/packages/kbn-dev-utils/BUILD.bazel @@ -107,7 +107,7 @@ ts_project( js_library( name = PKG_BASE_NAME, srcs = NPM_MODULE_EXTRA_FILES, - deps = [":tsc"] + DEPS, + deps = DEPS + [":tsc"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) diff --git a/packages/kbn-docs-utils/BUILD.bazel b/packages/kbn-docs-utils/BUILD.bazel index e72d83851f5d..cf609f126d7d 100644 --- a/packages/kbn-docs-utils/BUILD.bazel +++ b/packages/kbn-docs-utils/BUILD.bazel @@ -67,7 +67,7 @@ ts_project( js_library( name = PKG_BASE_NAME, srcs = NPM_MODULE_EXTRA_FILES, - deps = [":tsc"] + DEPS, + deps = DEPS + [":tsc"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) diff --git a/packages/kbn-es/BUILD.bazel b/packages/kbn-es/BUILD.bazel index bc8986e527fc..6c845996ce5e 100644 --- a/packages/kbn-es/BUILD.bazel +++ b/packages/kbn-es/BUILD.bazel @@ -69,7 +69,7 @@ babel( js_library( name = PKG_BASE_NAME, srcs = NPM_MODULE_EXTRA_FILES, - deps = [":target"] + DEPS, + deps = DEPS + [":target"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) diff --git a/packages/kbn-i18n/BUILD.bazel b/packages/kbn-i18n/BUILD.bazel index 02f5874a69a8..a48939d6e26f 100644 --- a/packages/kbn-i18n/BUILD.bazel +++ b/packages/kbn-i18n/BUILD.bazel @@ -111,7 +111,7 @@ ts_project( js_library( name = PKG_BASE_NAME, srcs = NPM_MODULE_EXTRA_FILES, - deps = [":tsc", ":tsc_browser"] + DEPS, + deps = DEPS + [":tsc", ":tsc_browser"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) diff --git a/packages/kbn-i18n/tsconfig.browser.json b/packages/kbn-i18n/tsconfig.browser.json index 707e3294bf1e..d7b8495a0d21 100644 --- a/packages/kbn-i18n/tsconfig.browser.json +++ b/packages/kbn-i18n/tsconfig.browser.json @@ -8,7 +8,10 @@ "isolatedModules": true, "sourceMap": true, "sourceRoot": "../../../../../packages/kbn-i18n/src", - "types": ["node"], + "types": [ + "jest", + "node" + ], }, "include": [ "src/**/*.ts", diff --git a/packages/kbn-legacy-logging/BUILD.bazel b/packages/kbn-legacy-logging/BUILD.bazel index 1cb7ae8d83fd..21cb8c338f89 100644 --- a/packages/kbn-legacy-logging/BUILD.bazel +++ b/packages/kbn-legacy-logging/BUILD.bazel @@ -71,7 +71,7 @@ ts_project( js_library( name = PKG_BASE_NAME, srcs = NPM_MODULE_EXTRA_FILES, - deps = [":tsc"] + DEPS, + deps = DEPS + [":tsc"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) diff --git a/packages/kbn-logging/BUILD.bazel b/packages/kbn-logging/BUILD.bazel index f42ca22ae525..a5ef1581f41a 100644 --- a/packages/kbn-logging/BUILD.bazel +++ b/packages/kbn-logging/BUILD.bazel @@ -61,7 +61,7 @@ ts_project( js_library( name = PKG_BASE_NAME, srcs = NPM_MODULE_EXTRA_FILES, - deps = [":tsc"] + DEPS, + deps = DEPS + [":tsc"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) diff --git a/packages/kbn-optimizer/limits.yml b/packages/kbn-optimizer/limits.yml index 2639f6fd273f..7f2d0768a1fb 100644 --- a/packages/kbn-optimizer/limits.yml +++ b/packages/kbn-optimizer/limits.yml @@ -46,7 +46,7 @@ pageLoadAssetSize: lens: 96624 licenseManagement: 41817 licensing: 29004 - lists: 200000 + lists: 22900 logstash: 53548 management: 46112 maps: 80000 diff --git a/packages/kbn-plugin-generator/BUILD.bazel b/packages/kbn-plugin-generator/BUILD.bazel index e22d41076db0..cd18f5e14a73 100644 --- a/packages/kbn-plugin-generator/BUILD.bazel +++ b/packages/kbn-plugin-generator/BUILD.bazel @@ -85,7 +85,7 @@ ts_project( js_library( name = PKG_BASE_NAME, srcs = NPM_MODULE_EXTRA_FILES, - deps = [":tsc"] + DEPS, + deps = DEPS + [":tsc"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) diff --git a/packages/kbn-securitysolution-constants/BUILD.bazel b/packages/kbn-securitysolution-constants/BUILD.bazel index 8b2d8c9103f3..20f1b51c7d42 100644 --- a/packages/kbn-securitysolution-constants/BUILD.bazel +++ b/packages/kbn-securitysolution-constants/BUILD.bazel @@ -65,7 +65,7 @@ js_library( package_name = PKG_REQUIRE_NAME, srcs = NPM_MODULE_EXTRA_FILES, visibility = ["//visibility:public"], - deps = [":tsc"] + DEPS, + deps = DEPS + [":tsc"], ) pkg_npm( diff --git a/packages/kbn-securitysolution-es-utils/BUILD.bazel b/packages/kbn-securitysolution-es-utils/BUILD.bazel index 0cc27358c5da..b69aa3df8ecb 100644 --- a/packages/kbn-securitysolution-es-utils/BUILD.bazel +++ b/packages/kbn-securitysolution-es-utils/BUILD.bazel @@ -67,7 +67,7 @@ js_library( package_name = PKG_REQUIRE_NAME, srcs = NPM_MODULE_EXTRA_FILES, visibility = ["//visibility:public"], - deps = [":tsc"] + DEPS, + deps = DEPS + [":tsc"], ) pkg_npm( diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/BUILD.bazel b/packages/kbn-securitysolution-io-ts-alerting-types/BUILD.bazel index ba7123d0c1f2..8e4a464783fc 100644 --- a/packages/kbn-securitysolution-io-ts-alerting-types/BUILD.bazel +++ b/packages/kbn-securitysolution-io-ts-alerting-types/BUILD.bazel @@ -73,7 +73,7 @@ ts_project( js_library( name = PKG_BASE_NAME, srcs = NPM_MODULE_EXTRA_FILES, - deps = [":tsc"] + DEPS, + deps = DEPS + [":tsc"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) diff --git a/packages/kbn-securitysolution-io-ts-list-types/BUILD.bazel b/packages/kbn-securitysolution-io-ts-list-types/BUILD.bazel index af8fb6838a5c..91e4667c16b4 100644 --- a/packages/kbn-securitysolution-io-ts-list-types/BUILD.bazel +++ b/packages/kbn-securitysolution-io-ts-list-types/BUILD.bazel @@ -73,7 +73,7 @@ ts_project( js_library( name = PKG_BASE_NAME, srcs = NPM_MODULE_EXTRA_FILES, - deps = [":tsc"] + DEPS, + deps = DEPS + [":tsc"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) diff --git a/packages/kbn-securitysolution-io-ts-types/BUILD.bazel b/packages/kbn-securitysolution-io-ts-types/BUILD.bazel index 0a21f5ed94f0..d30eb913b1a5 100644 --- a/packages/kbn-securitysolution-io-ts-types/BUILD.bazel +++ b/packages/kbn-securitysolution-io-ts-types/BUILD.bazel @@ -72,7 +72,7 @@ ts_project( js_library( name = PKG_BASE_NAME, srcs = NPM_MODULE_EXTRA_FILES, - deps = [":tsc"] + DEPS, + deps = DEPS + [":tsc"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) diff --git a/packages/kbn-securitysolution-io-ts-utils/BUILD.bazel b/packages/kbn-securitysolution-io-ts-utils/BUILD.bazel index 66c5674067ec..b9326a502071 100644 --- a/packages/kbn-securitysolution-io-ts-utils/BUILD.bazel +++ b/packages/kbn-securitysolution-io-ts-utils/BUILD.bazel @@ -71,7 +71,7 @@ ts_project( js_library( name = PKG_BASE_NAME, srcs = NPM_MODULE_EXTRA_FILES, - deps = [":tsc"] + DEPS, + deps = DEPS + [":tsc"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) diff --git a/packages/kbn-securitysolution-list-api/BUILD.bazel b/packages/kbn-securitysolution-list-api/BUILD.bazel index 11b649353492..149bbf9a0c5c 100644 --- a/packages/kbn-securitysolution-list-api/BUILD.bazel +++ b/packages/kbn-securitysolution-list-api/BUILD.bazel @@ -69,7 +69,7 @@ js_library( package_name = PKG_REQUIRE_NAME, srcs = NPM_MODULE_EXTRA_FILES, visibility = ["//visibility:public"], - deps = [":tsc"] + DEPS, + deps = DEPS + [":tsc"], ) pkg_npm( diff --git a/packages/kbn-securitysolution-list-hooks/BUILD.bazel b/packages/kbn-securitysolution-list-hooks/BUILD.bazel index 890b02028c74..3c5444092676 100644 --- a/packages/kbn-securitysolution-list-hooks/BUILD.bazel +++ b/packages/kbn-securitysolution-list-hooks/BUILD.bazel @@ -74,7 +74,7 @@ js_library( package_name = PKG_REQUIRE_NAME, srcs = NPM_MODULE_EXTRA_FILES, visibility = ["//visibility:public"], - deps = [":tsc"] + DEPS, + deps = DEPS + [":tsc"], ) pkg_npm( diff --git a/packages/kbn-securitysolution-list-utils/BUILD.bazel b/packages/kbn-securitysolution-list-utils/BUILD.bazel index 5301487f3e6b..f9063290d9f7 100644 --- a/packages/kbn-securitysolution-list-utils/BUILD.bazel +++ b/packages/kbn-securitysolution-list-utils/BUILD.bazel @@ -70,7 +70,7 @@ js_library( package_name = PKG_REQUIRE_NAME, srcs = NPM_MODULE_EXTRA_FILES, visibility = ["//visibility:public"], - deps = [":tsc"] + DEPS, + deps = DEPS + [":tsc"], ) pkg_npm( diff --git a/packages/kbn-securitysolution-utils/BUILD.bazel b/packages/kbn-securitysolution-utils/BUILD.bazel index 42897e93593b..6084480ef6a1 100644 --- a/packages/kbn-securitysolution-utils/BUILD.bazel +++ b/packages/kbn-securitysolution-utils/BUILD.bazel @@ -67,7 +67,7 @@ js_library( package_name = PKG_REQUIRE_NAME, srcs = NPM_MODULE_EXTRA_FILES, visibility = ["//visibility:public"], - deps = [":tsc"] + DEPS, + deps = DEPS + [":tsc"], ) pkg_npm( diff --git a/packages/kbn-server-http-tools/BUILD.bazel b/packages/kbn-server-http-tools/BUILD.bazel index 61570969c85f..d654527b2658 100644 --- a/packages/kbn-server-http-tools/BUILD.bazel +++ b/packages/kbn-server-http-tools/BUILD.bazel @@ -69,7 +69,7 @@ ts_project( js_library( name = PKG_BASE_NAME, srcs = NPM_MODULE_EXTRA_FILES, - deps = [":tsc"] + DEPS, + deps = DEPS + [":tsc"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) diff --git a/packages/kbn-std/BUILD.bazel b/packages/kbn-std/BUILD.bazel index 82520be97df1..e60577f0f085 100644 --- a/packages/kbn-std/BUILD.bazel +++ b/packages/kbn-std/BUILD.bazel @@ -64,7 +64,7 @@ ts_project( js_library( name = PKG_BASE_NAME, srcs = NPM_MODULE_EXTRA_FILES, - deps = [":tsc"] + DEPS, + deps = DEPS + [":tsc"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) diff --git a/packages/kbn-telemetry-tools/BUILD.bazel b/packages/kbn-telemetry-tools/BUILD.bazel index 4d1b4f21117c..9a6b4a10bd19 100644 --- a/packages/kbn-telemetry-tools/BUILD.bazel +++ b/packages/kbn-telemetry-tools/BUILD.bazel @@ -76,7 +76,7 @@ ts_project( js_library( name = PKG_BASE_NAME, srcs = NPM_MODULE_EXTRA_FILES, - deps = [":tsc"] + DEPS, + deps = DEPS + [":tsc"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) diff --git a/packages/kbn-utility-types/BUILD.bazel b/packages/kbn-utility-types/BUILD.bazel index 1a02f94a88f4..46843b97e746 100644 --- a/packages/kbn-utility-types/BUILD.bazel +++ b/packages/kbn-utility-types/BUILD.bazel @@ -58,7 +58,7 @@ ts_project( js_library( name = PKG_BASE_NAME, srcs = NPM_MODULE_EXTRA_FILES, - deps = [":tsc"] + DEPS, + deps = DEPS + [":tsc"], package_name = "@kbn/utility-types", visibility = ["//visibility:public"], ) diff --git a/packages/kbn-utils/BUILD.bazel b/packages/kbn-utils/BUILD.bazel index 57aee048746b..a2789f4280ab 100644 --- a/packages/kbn-utils/BUILD.bazel +++ b/packages/kbn-utils/BUILD.bazel @@ -61,7 +61,7 @@ ts_project( js_library( name = PKG_BASE_NAME, srcs = NPM_MODULE_EXTRA_FILES, - deps = [":tsc"] + DEPS, + deps = DEPS + [":tsc"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) diff --git a/src/core/server/saved_objects/migrations/core/document_migrator.test.ts b/src/core/server/saved_objects/migrations/core/document_migrator.test.ts index 71e5565ebcbe..79f5bd09889d 100644 --- a/src/core/server/saved_objects/migrations/core/document_migrator.test.ts +++ b/src/core/server/saved_objects/migrations/core/document_migrator.test.ts @@ -748,14 +748,8 @@ describe('DocumentMigrator', () => { migrator.migrate(_.cloneDeep(failedDoc)); expect('Did not throw').toEqual('But it should have!'); } catch (error) { - expect(error.message).toMatchInlineSnapshot(` - "Failed to transform document smelly. Transform: dog:1.2.3 - Doc: {\\"id\\":\\"smelly\\",\\"type\\":\\"dog\\",\\"attributes\\":{},\\"migrationVersion\\":{}}" - `); + expect(error.message).toBe('Dang diggity!'); expect(error).toBeInstanceOf(TransformSavedObjectDocumentError); - expect(loggingSystemMock.collect(mockLoggerFactory).error[0][0]).toMatchInlineSnapshot( - `[Error: Dang diggity!]` - ); } }); diff --git a/src/core/server/saved_objects/migrations/core/document_migrator.ts b/src/core/server/saved_objects/migrations/core/document_migrator.ts index c96de6ebbfcd..a32cc999c555 100644 --- a/src/core/server/saved_objects/migrations/core/document_migrator.ts +++ b/src/core/server/saved_objects/migrations/core/document_migrator.ts @@ -679,19 +679,8 @@ function wrapWithTry( return { transformedDoc: result, additionalDocs: [] }; } catch (error) { - const failedTransform = `${type.name}:${version}`; - const failedDoc = JSON.stringify(doc); log.error(error); - // To make debugging failed migrations easier, we add items needed to convert the - // saved object id to the full raw id (the id only contains the uuid part) and the full error itself - throw new TransformSavedObjectDocumentError( - doc.id, - doc.type, - doc.namespace, - failedTransform, - failedDoc, - error - ); + throw new TransformSavedObjectDocumentError(error); } }; } diff --git a/src/core/server/saved_objects/migrations/core/migrate_raw_docs.test.ts b/src/core/server/saved_objects/migrations/core/migrate_raw_docs.test.ts index 1d43e2f54a72..7a6f72a881cd 100644 --- a/src/core/server/saved_objects/migrations/core/migrate_raw_docs.test.ts +++ b/src/core/server/saved_objects/migrations/core/migrate_raw_docs.test.ts @@ -233,34 +233,7 @@ describe('migrateRawDocsSafely', () => { test('instance of Either.left containing transform errors when the transform function throws a TransformSavedObjectDocument error', async () => { const transform = jest.fn((doc: any) => { - throw new TransformSavedObjectDocumentError( - `${doc.id}`, - `${doc.type}`, - `${doc.namespace}`, - `${doc.type}1.2.3`, - JSON.stringify(doc), - new Error('error during transform') - ); - }); - const task = migrateRawDocsSafely( - new SavedObjectsSerializer(new SavedObjectTypeRegistry()), - transform, - [{ _id: 'a:b', _source: { type: 'a', a: { name: 'AAA' } } }] // this is the raw doc - ); - const result = (await task()) as Either.Left; - expect(transform).toHaveBeenCalledTimes(1); - expect(result._tag).toEqual('Left'); - expect(result.left.corruptDocumentIds.length).toEqual(0); - expect(result.left.transformErrors.length).toEqual(1); - expect(result.left.transformErrors[0].err.message).toMatchInlineSnapshot(` - "Failed to transform document b. Transform: a1.2.3 - Doc: {\\"type\\":\\"a\\",\\"id\\":\\"b\\",\\"attributes\\":{\\"name\\":\\"AAA\\"},\\"references\\":[],\\"migrationVersion\\":{}}" - `); - }); - - test("instance of Either.left containing errors when the transform function throws an error that isn't a TransformSavedObjectDocument error", async () => { - const transform = jest.fn((doc: any) => { - throw new Error('error during transform'); + throw new TransformSavedObjectDocumentError(new Error('error during transform')); }); const task = migrateRawDocsSafely( new SavedObjectsSerializer(new SavedObjectTypeRegistry()), diff --git a/src/core/server/saved_objects/migrations/core/transform_saved_object_document_error.test.ts b/src/core/server/saved_objects/migrations/core/transform_saved_object_document_error.test.ts index 80c670edd39b..1efb1bd72621 100644 --- a/src/core/server/saved_objects/migrations/core/transform_saved_object_document_error.test.ts +++ b/src/core/server/saved_objects/migrations/core/transform_saved_object_document_error.test.ts @@ -10,51 +10,10 @@ import { TransformSavedObjectDocumentError } from './transform_saved_object_docu describe('TransformSavedObjectDocumentError', () => { it('is a special error', () => { const originalError = new Error('Dang diggity!'); - const err = new TransformSavedObjectDocumentError( - 'id', - 'type', - 'namespace', - 'failedTransform', - 'failedDoc', - originalError - ); + const err = new TransformSavedObjectDocumentError(originalError); expect(err).toBeInstanceOf(TransformSavedObjectDocumentError); - expect(err.id).toEqual('id'); - expect(err.namespace).toEqual('namespace'); expect(err.stack).not.toBeNull(); - }); - it('constructs an special error message', () => { - const originalError = new Error('Dang diggity!'); - const err = new TransformSavedObjectDocumentError( - 'id', - 'type', - 'namespace', - 'failedTransform', - 'failedDoc', - originalError - ); - expect(err.message).toMatchInlineSnapshot( - ` - "Failed to transform document id. Transform: failedTransform - Doc: failedDoc" - ` - ); - }); - it('handles undefined namespace', () => { - const originalError = new Error('Dang diggity!'); - const err = new TransformSavedObjectDocumentError( - 'id', - 'type', - undefined, - 'failedTransform', - 'failedDoc', - originalError - ); - expect(err.message).toMatchInlineSnapshot( - ` - "Failed to transform document id. Transform: failedTransform - Doc: failedDoc" - ` - ); + expect(err.originalError).toBe(originalError); + expect(err.message).toMatchInlineSnapshot(`"Dang diggity!"`); }); }); diff --git a/src/core/server/saved_objects/migrations/core/transform_saved_object_document_error.ts b/src/core/server/saved_objects/migrations/core/transform_saved_object_document_error.ts index 6a6f87ea1eeb..2dc553545a08 100644 --- a/src/core/server/saved_objects/migrations/core/transform_saved_object_document_error.ts +++ b/src/core/server/saved_objects/migrations/core/transform_saved_object_document_error.ts @@ -9,24 +9,10 @@ /** * Error thrown when saved object migrations encounter a transformation error. * Transformation errors happen when a transform function throws an error for an unsanitized saved object - * The id (doc.id) reported in this error class is just the uuid part and doesn't tell users what the full elasticsearch id is. - * in order to convert the id to the serialized version further upstream using serializer.generateRawId, we need to provide the following items: - * - namespace: doc.namespace, - * - type: doc.type, - * - id: doc.id, - * The new error class helps with v2 migrations. - * For backward compatibility with v1 migrations, the error message is the same as what was previously thrown as a plain error */ export class TransformSavedObjectDocumentError extends Error { - constructor( - public readonly id: string, - public readonly type: string, - public readonly namespace: string | undefined, - public readonly failedTransform: string, // created by document_migrator wrapWithTry as `${type.name}:${version}`; - public readonly failedDoc: string, - public readonly originalError: Error - ) { - super(`Failed to transform document ${id}. Transform: ${failedTransform}\nDoc: ${failedDoc}`); + constructor(public readonly originalError: Error) { + super(`${originalError.message}`); } } diff --git a/src/core/server/saved_objects/migrationsv2/integration_tests/archives/7_13_corrupt_and_transform_failures_docs.zip b/src/core/server/saved_objects/migrationsv2/integration_tests/archives/7_13_corrupt_and_transform_failures_docs.zip new file mode 100644 index 000000000000..30ee6ee23dbf Binary files /dev/null and b/src/core/server/saved_objects/migrationsv2/integration_tests/archives/7_13_corrupt_and_transform_failures_docs.zip differ diff --git a/src/core/server/saved_objects/migrationsv2/integration_tests/cleanup.test.ts b/src/core/server/saved_objects/migrationsv2/integration_tests/cleanup.test.ts index 1e494d4b5586..91d86353b48f 100644 --- a/src/core/server/saved_objects/migrationsv2/integration_tests/cleanup.test.ts +++ b/src/core/server/saved_objects/migrationsv2/integration_tests/cleanup.test.ts @@ -53,7 +53,8 @@ function createRoot() { ); } -describe('migration v2', () => { +// FAILING: https://github.com/elastic/kibana/issues/98352 +describe.skip('migration v2', () => { let esServer: kbnTestServer.TestElasticsearchUtils; let root: Root; diff --git a/src/core/server/saved_objects/migrationsv2/integration_tests/corrupt_outdated_docs.test.ts b/src/core/server/saved_objects/migrationsv2/integration_tests/corrupt_outdated_docs.test.ts index e48f1e65c120..9a09fb47d060 100644 --- a/src/core/server/saved_objects/migrationsv2/integration_tests/corrupt_outdated_docs.test.ts +++ b/src/core/server/saved_objects/migrationsv2/integration_tests/corrupt_outdated_docs.test.ts @@ -55,7 +55,7 @@ describe('migration v2 with corrupt saved object documents', () => { // }, // original corrupt SO example: // { - // id: 'bar:123' + // id: 'bar:123' // '123' etc // type: 'foo', // foo: {}, // migrationVersion: { @@ -107,16 +107,39 @@ describe('migration v2 with corrupt saved object documents', () => { try { await root.start(); } catch (err) { - const corruptFooSOs = /foo:/g; - const corruptBarSOs = /bar:/g; - const corruptBazSOs = /baz:/g; + const errorMessage = err.message; expect( - [ - ...err.message.matchAll(corruptFooSOs), - ...err.message.matchAll(corruptBarSOs), - ...err.message.matchAll(corruptBazSOs), - ].length - ).toEqual(16); + errorMessage.startsWith( + 'Unable to complete saved object migrations for the [.kibana] index: Migrations failed. Reason: Corrupt saved object documents: ' + ) + ).toBeTruthy(); + expect( + errorMessage.endsWith(' To allow migrations to proceed, please delete these documents.') + ).toBeTruthy(); + const expectedCorruptDocIds = [ + '"foo:my_name"', + '"123"', + '"456"', + '"789"', + '"foo:other_name"', + '"bar:123"', + '"baz:123"', + '"bar:345"', + '"bar:890"', + '"baz:456"', + '"baz:789"', + '"bar:other_name"', + '"baz:other_name"', + '"bar:my_name"', + '"baz:my_name"', + '"foo:123"', + '"foo:456"', + '"foo:789"', + '"foo:other"', + ]; + for (const corruptDocId of expectedCorruptDocIds) { + expect(errorMessage.includes(corruptDocId)).toBeTruthy(); + } } }); }); diff --git a/src/core/server/saved_objects/migrationsv2/integration_tests/migration_7_13_0_transform_failures.test.ts b/src/core/server/saved_objects/migrationsv2/integration_tests/migration_7_13_0_transform_failures.test.ts new file mode 100644 index 000000000000..c014f7de395e --- /dev/null +++ b/src/core/server/saved_objects/migrationsv2/integration_tests/migration_7_13_0_transform_failures.test.ts @@ -0,0 +1,157 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import Path from 'path'; +import Fs from 'fs'; +import Util from 'util'; +import * as kbnTestServer from '../../../../test_helpers/kbn_server'; +import { Root } from '../../../root'; + +const logFilePath = Path.join(__dirname, '7_13_corrupt_transform_failures_test.log'); + +const asyncUnlink = Util.promisify(Fs.unlink); +async function removeLogFile() { + // ignore errors if it doesn't exist + await asyncUnlink(logFilePath).catch(() => void 0); +} + +describe('migration v2', () => { + let esServer: kbnTestServer.TestElasticsearchUtils; + let root: Root; + + beforeAll(async () => { + await removeLogFile(); + }); + + afterAll(async () => { + if (root) { + await root.shutdown(); + } + if (esServer) { + await esServer.stop(); + } + + await new Promise((resolve) => setTimeout(resolve, 10000)); + }); + + it('migrates the documents to the highest version', async () => { + const { startES } = kbnTestServer.createTestServers({ + adjustTimeout: (t: number) => jest.setTimeout(t), + settings: { + es: { + license: 'basic', + // example of original 'foo' SO with corrupt id: + // _id: one + // { + // foo: { + // name: 'one', + // }, + // type: 'foo', + // references: [], + // migrationVersion: { + // foo: '7.13.0', + // }, + // "coreMigrationVersion": "7.13.0", + // "updated_at": "2021-05-16T18:16:45.450Z" + // }, + + // SO that will fail transformation: + // { + // type: 'space', + // space: {}, + // }, + // + // + dataArchive: Path.join( + __dirname, + 'archives', + '7_13_corrupt_and_transform_failures_docs.zip' + ), + }, + }, + }); + + root = createRoot(); + + esServer = await startES(); + const coreSetup = await root.setup(); + + coreSetup.savedObjects.registerType({ + name: 'foo', + hidden: false, + mappings: { + properties: {}, + }, + namespaceType: 'agnostic', + migrations: { + '7.14.0': (doc) => doc, + }, + }); + try { + await root.start(); + } catch (err) { + const errorMessage = err.message; + expect( + errorMessage.startsWith( + 'Unable to complete saved object migrations for the [.kibana] index: Migrations failed. Reason: Corrupt saved object documents: ' + ) + ).toBeTruthy(); + expect( + errorMessage.endsWith(' To allow migrations to proceed, please delete these documents.') + ).toBeTruthy(); + + const expectedCorruptDocIds = [ + 'P2SQfHkBs3dBRGh--No5', + 'QGSZfHkBs3dBRGh-ANoD', + 'QWSZfHkBs3dBRGh-hNob', + 'QmSZfHkBs3dBRGh-w9qH', + 'one', + 'two', + 'Q2SZfHkBs3dBRGh-9dp2', + ]; + for (const corruptDocId of expectedCorruptDocIds) { + expect(errorMessage.includes(corruptDocId)).toBeTruthy(); + } + const expectedTransformErrorMessage = + 'Transformation errors: space:default: Document "default" has property "space" which belongs to a more recent version of Kibana [6.6.0]. The last known version is [undefined]'; + expect(errorMessage.includes(expectedTransformErrorMessage)).toBeTruthy(); + } + }); +}); + +function createRoot() { + return kbnTestServer.createRootWithCorePlugins( + { + migrations: { + skip: false, + enableV2: true, + batchSize: 5, + }, + logging: { + appenders: { + file: { + type: 'file', + fileName: logFilePath, + layout: { + type: 'json', + }, + }, + }, + loggers: [ + { + name: 'root', + appenders: ['file'], + }, + ], + }, + }, + { + oss: true, + } + ); +} diff --git a/src/core/server/saved_objects/migrationsv2/model.test.ts b/src/core/server/saved_objects/migrationsv2/model.test.ts index 7a47e58f1947..186cb24b4a34 100644 --- a/src/core/server/saved_objects/migrationsv2/model.test.ts +++ b/src/core/server/saved_objects/migrationsv2/model.test.ts @@ -1158,14 +1158,7 @@ describe('migrations v2 model', () => { it('OUTDATED_DOCUMENTS_SEARCH_READ -> FATAL if no outdated documents to transform and we have failed document migrations', () => { const corruptDocumentIdsCarriedOver = ['a:somethingelse']; const originalTransformError = new Error('something went wrong'); - const transFormErr = new TransformSavedObjectDocumentError( - '123', - 'vis', - undefined, - 'randomvis: 7.12.0', - 'failedDoc', - originalTransformError - ); + const transFormErr = new TransformSavedObjectDocumentError(originalTransformError); const transformationErrors = [ { rawId: 'bob:tail', err: transFormErr }, ] as TransformErrorObjects[]; @@ -1184,7 +1177,7 @@ describe('migrations v2 model', () => { expect(newState.reason.includes('Migrations failed. Reason:')).toBe(true); expect(newState.reason.includes('Corrupt saved object documents: ')).toBe(true); expect(newState.reason.includes('Transformation errors: ')).toBe(true); - expect(newState.reason.includes('randomvis: 7.12.0')).toBe(true); + expect(newState.reason.includes('bob:tail')).toBe(true); expect(newState.logs).toStrictEqual([]); // No logs because no hits }); }); @@ -1229,14 +1222,7 @@ describe('migrations v2 model', () => { const outdatedDocuments = [{ _id: '1', _source: { type: 'vis' } }]; const corruptDocumentIds = ['a:somethingelse']; const originalTransformError = new Error('Dang diggity!'); - const transFormErr = new TransformSavedObjectDocumentError( - 'id', - 'type', - 'namespace', - 'failedTransform', - 'failedDoc', - originalTransformError - ); + const transFormErr = new TransformSavedObjectDocumentError(originalTransformError); const transformationErrors = [ { rawId: 'bob:tail', err: transFormErr }, ] as TransformErrorObjects[]; diff --git a/src/core/server/saved_objects/migrationsv2/model.ts b/src/core/server/saved_objects/migrationsv2/model.ts index f4185225ae07..252d7424c339 100644 --- a/src/core/server/saved_objects/migrationsv2/model.ts +++ b/src/core/server/saved_objects/migrationsv2/model.ts @@ -109,7 +109,7 @@ function getAliases(indices: FetchIndexResponse) { function extractTransformFailuresReason( corruptDocumentIds: string[], transformErrors: TransformErrorObjects[] -): { corruptDocsReason: string; transformErrsReason: string } { +): string { const corruptDocumentIdReason = corruptDocumentIds.length > 0 ? ` Corrupt saved object documents: ${corruptDocumentIds.join(',')}` @@ -122,10 +122,7 @@ function extractTransformFailuresReason( .map((errObj) => `${errObj.rawId}: ${errObj.err.message}\n ${errObj.err.stack ?? ''}`) .join('/n') : ''; - return { - corruptDocsReason: corruptDocumentIdReason, - transformErrsReason: transformErrorsReason, - }; + return `Migrations failed. Reason:${corruptDocumentIdReason}${transformErrorsReason}. To allow migrations to proceed, please delete these documents.`; } const delayRetryState = ( @@ -538,14 +535,14 @@ export const model = (currentState: State, resW: ResponseType): } else { // we don't have any more outdated documents and need to either fail or move on to updating the target mappings. if (stateP.corruptDocumentIds.length > 0 || stateP.transformErrors.length > 0) { - const { corruptDocsReason, transformErrsReason } = extractTransformFailuresReason( + const transformFailureReason = extractTransformFailuresReason( stateP.corruptDocumentIds, stateP.transformErrors ); return { ...stateP, controlState: 'FATAL', - reason: `Migrations failed. Reason:${corruptDocsReason}${transformErrsReason}. To allow migrations to proceed, please delete these documents.`, + reason: transformFailureReason, }; } else { // we don't have any more outdated documents and we haven't encountered any document transformation issues. @@ -722,14 +719,14 @@ export const model = (currentState: State, resW: ResponseType): } else { // we don't have any more outdated documents and need to either fail or move on to updating the target mappings. if (stateP.corruptDocumentIds.length > 0 || stateP.transformErrors.length > 0) { - const { corruptDocsReason, transformErrsReason } = extractTransformFailuresReason( + const transformFailureReason = extractTransformFailuresReason( stateP.corruptDocumentIds, stateP.transformErrors ); return { ...stateP, controlState: 'FATAL', - reason: `Migrations failed. Reason:${corruptDocsReason}${transformErrsReason}. To allow migrations to proceed, please delete these documents.`, + reason: transformFailureReason, }; } else { // If there are no more results we have transformed all outdated diff --git a/src/plugins/data/server/search/search_service.ts b/src/plugins/data/server/search/search_service.ts index f52c622c48ed..a651d7b3bf10 100644 --- a/src/plugins/data/server/search/search_service.ts +++ b/src/plugins/data/server/search/search_service.ts @@ -401,6 +401,7 @@ export class SearchService implements Plugin { savedObjectsClient, esClient: elasticsearch.client.asScoped(request), uiSettingsClient: uiSettings.asScopedToClient(savedObjectsClient), + request, }; return { search: < diff --git a/src/plugins/data/server/search/strategies/ese_search/ese_search_strategy.ts b/src/plugins/data/server/search/strategies/ese_search/ese_search_strategy.ts index cec4b9a2dbf9..ab6162f756ea 100644 --- a/src/plugins/data/server/search/strategies/ese_search/ese_search_strategy.ts +++ b/src/plugins/data/server/search/strategies/ese_search/ese_search_strategy.ts @@ -38,11 +38,13 @@ import { export const enhancedEsSearchStrategyProvider = ( legacyConfig$: Observable, logger: Logger, - usage?: SearchUsage + usage?: SearchUsage, + useInternalUser: boolean = false ): ISearchStrategy => { async function cancelAsyncSearch(id: string, esClient: IScopedClusterClient) { try { - await esClient.asCurrentUser.asyncSearch.delete({ id }); + const client = useInternalUser ? esClient.asInternalUser : esClient.asCurrentUser; + await client.asyncSearch.delete({ id }); } catch (e) { throw getKbnServerError(e); } @@ -53,7 +55,7 @@ export const enhancedEsSearchStrategyProvider = ( options: IAsyncSearchOptions, { esClient, uiSettingsClient, searchSessionsClient }: SearchStrategyDependencies ) { - const client = esClient.asCurrentUser.asyncSearch; + const client = useInternalUser ? esClient.asInternalUser : esClient.asCurrentUser; const search = async () => { const params = id @@ -66,7 +68,9 @@ export const enhancedEsSearchStrategyProvider = ( )), ...request.params, }; - const promise = id ? client.get({ ...params, id }) : client.submit(params); + const promise = id + ? client.asyncSearch.get({ ...params, id }) + : client.asyncSearch.submit(params); const { body } = await shimAbortSignal(promise, options.abortSignal); const response = shimHitsTotal(body.response, options); @@ -96,6 +100,7 @@ export const enhancedEsSearchStrategyProvider = ( options: ISearchOptions, { esClient, uiSettingsClient }: SearchStrategyDependencies ): Promise { + const client = useInternalUser ? esClient.asInternalUser : esClient.asCurrentUser; const legacyConfig = await legacyConfig$.pipe(first()).toPromise(); const { body, index, ...params } = request.params!; const method = 'POST'; @@ -108,7 +113,7 @@ export const enhancedEsSearchStrategyProvider = ( }; try { - const promise = esClient.asCurrentUser.transport.request({ + const promise = client.transport.request({ method, path, body, @@ -169,7 +174,11 @@ export const enhancedEsSearchStrategyProvider = ( extend: async (id, keepAlive, options, { esClient }) => { logger.debug(`extend ${id} by ${keepAlive}`); try { - await esClient.asCurrentUser.asyncSearch.get({ id, body: { keep_alive: keepAlive } }); + const client = useInternalUser ? esClient.asInternalUser : esClient.asCurrentUser; + await client.asyncSearch.get({ + id, + body: { keep_alive: keepAlive }, + }); } catch (e) { throw getKbnServerError(e); } diff --git a/src/plugins/data/server/search/types.ts b/src/plugins/data/server/search/types.ts index 229c581bf09f..6192045fa04c 100644 --- a/src/plugins/data/server/search/types.ts +++ b/src/plugins/data/server/search/types.ts @@ -37,6 +37,7 @@ export interface SearchStrategyDependencies { esClient: IScopedClusterClient; uiSettingsClient: IUiSettingsClient; searchSessionsClient: IScopedSearchSessionsClient; + request: KibanaRequest; } export interface ISearchSetup { diff --git a/src/plugins/data/server/server.api.md b/src/plugins/data/server/server.api.md index ffdff2e33cf9..a8eafd7b14aa 100644 --- a/src/plugins/data/server/server.api.md +++ b/src/plugins/data/server/server.api.md @@ -37,8 +37,8 @@ import { ISearchOptions as ISearchOptions_2 } from 'src/plugins/data/public'; import { ISearchSource } from 'src/plugins/data/public'; import { IUiSettingsClient } from 'src/core/server'; import { IUiSettingsClient as IUiSettingsClient_3 } from 'kibana/server'; -import { KibanaRequest } from 'kibana/server'; -import { KibanaRequest as KibanaRequest_2 } from 'src/core/server'; +import { KibanaRequest } from 'src/core/server'; +import { KibanaRequest as KibanaRequest_2 } from 'kibana/server'; import { Logger } from 'src/core/server'; import { Logger as Logger_2 } from 'kibana/server'; import { LoggerFactory } from '@kbn/logging'; @@ -1040,7 +1040,7 @@ export interface ISearchOptions { // @public (undocumented) export interface ISearchSessionService { // (undocumented) - asScopedProvider: (core: CoreStart) => (request: KibanaRequest) => IScopedSearchSessionsClient; + asScopedProvider: (core: CoreStart) => (request: KibanaRequest_2) => IScopedSearchSessionsClient; } // Warning: (ae-missing-release-tag) "ISearchSetup" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) @@ -1068,11 +1068,11 @@ export interface ISearchStart IScopedSearchClient; + asScoped: (request: KibanaRequest) => IScopedSearchClient; getSearchStrategy: (name?: string) => ISearchStrategy; // (undocumented) searchSource: { - asScoped: (request: KibanaRequest_2) => Promise; + asScoped: (request: KibanaRequest) => Promise; }; } @@ -1391,6 +1391,8 @@ export interface SearchStrategyDependencies { // (undocumented) esClient: IScopedClusterClient; // (undocumented) + request: KibanaRequest; + // (undocumented) savedObjectsClient: SavedObjectsClientContract; // (undocumented) searchSessionsClient: IScopedSearchSessionsClient; @@ -1551,7 +1553,7 @@ export function usageProvider(core: CoreSetup_2): SearchUsage; // src/plugins/data/server/index.ts:269:1 - (ae-forgotten-export) The symbol "toAbsoluteDates" needs to be exported by the entry point index.d.ts // src/plugins/data/server/index.ts:270:1 - (ae-forgotten-export) The symbol "calcAutoIntervalLessThan" needs to be exported by the entry point index.d.ts // src/plugins/data/server/plugin.ts:81:74 - (ae-forgotten-export) The symbol "DataEnhancements" needs to be exported by the entry point index.d.ts -// src/plugins/data/server/search/types.ts:114:5 - (ae-forgotten-export) The symbol "ISearchStartSearchSource" needs to be exported by the entry point index.d.ts +// src/plugins/data/server/search/types.ts:115:5 - (ae-forgotten-export) The symbol "ISearchStartSearchSource" needs to be exported by the entry point index.d.ts // (No @packageDocumentation comment for this package) diff --git a/x-pack/plugins/infra/server/services/log_entries/log_entries_search_strategy.test.ts b/x-pack/plugins/infra/server/services/log_entries/log_entries_search_strategy.test.ts index 3cda019359ca..876aad4ef8d0 100644 --- a/x-pack/plugins/infra/server/services/log_entries/log_entries_search_strategy.test.ts +++ b/x-pack/plugins/infra/server/services/log_entries/log_entries_search_strategy.test.ts @@ -9,6 +9,7 @@ import { ResponseError } from '@elastic/elasticsearch/lib/errors'; import { of, throwError } from 'rxjs'; import { elasticsearchServiceMock, + httpServerMock, savedObjectsClientMock, uiSettingsServiceMock, } from 'src/core/server/mocks'; @@ -327,6 +328,7 @@ const createSearchStrategyDependenciesMock = (): SearchStrategyDependencies => ( esClient: elasticsearchServiceMock.createScopedClusterClient(), savedObjectsClient: savedObjectsClientMock.create(), searchSessionsClient: createSearchSessionsClientMock(), + request: httpServerMock.createKibanaRequest(), }); // using the official data mock from within x-pack doesn't type-check successfully, diff --git a/x-pack/plugins/infra/server/services/log_entries/log_entry_search_strategy.test.ts b/x-pack/plugins/infra/server/services/log_entries/log_entry_search_strategy.test.ts index f220c8913a2e..88c9d956dbe0 100644 --- a/x-pack/plugins/infra/server/services/log_entries/log_entry_search_strategy.test.ts +++ b/x-pack/plugins/infra/server/services/log_entries/log_entry_search_strategy.test.ts @@ -9,6 +9,7 @@ import { ResponseError } from '@elastic/elasticsearch/lib/errors'; import { of, throwError } from 'rxjs'; import { elasticsearchServiceMock, + httpServerMock, savedObjectsClientMock, uiSettingsServiceMock, } from 'src/core/server/mocks'; @@ -282,6 +283,7 @@ const createSearchStrategyDependenciesMock = (): SearchStrategyDependencies => ( esClient: elasticsearchServiceMock.createScopedClusterClient(), savedObjectsClient: savedObjectsClientMock.create(), searchSessionsClient: createSearchSessionsClientMock(), + request: httpServerMock.createKibanaRequest(), }); // using the official data mock from within x-pack doesn't type-check successfully, diff --git a/x-pack/test/functional/apps/infra/metrics_anomalies.ts b/x-pack/test/functional/apps/infra/metrics_anomalies.ts index 19bba77e5ca1..54aaaae256f3 100644 --- a/x-pack/test/functional/apps/infra/metrics_anomalies.ts +++ b/x-pack/test/functional/apps/infra/metrics_anomalies.ts @@ -15,7 +15,8 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { const pageObjects = getPageObjects(['common', 'infraHome']); const infraSourceConfigurationForm = getService('infraSourceConfigurationForm'); - describe('Metrics UI Anomaly Flyout', function () { + // Failing: See https://github.com/elastic/kibana/issues/100445 + describe.skip('Metrics UI Anomaly Flyout', function () { before(async () => { await esArchiver.load('empty_kibana'); });