From 1b9cbcd1fd6908afb02e0cc1e93845a1fdb490c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Efe=20G=C3=BCrkan=20YALAMAN?= Date: Wed, 4 Dec 2024 18:13:53 +0100 Subject: [PATCH 01/17] Add synonyms plugin and add routes --- package.json | 1 + packages/deeplinks/search/constants.ts | 2 + packages/deeplinks/search/deep_links.ts | 9 +++ packages/deeplinks/search/index.ts | 1 + tsconfig.base.json | 2 + .../applications/shared/layout/base_nav.tsx | 8 +++ .../public/navigation_tree.ts | 5 +- x-pack/plugins/search_synonyms/README.md | 3 + .../plugins/search_synonyms/common/index.ts | 10 +++ .../plugins/search_synonyms/common/types.ts | 18 +++++ x-pack/plugins/search_synonyms/jest.config.js | 15 ++++ x-pack/plugins/search_synonyms/kibana.jsonc | 26 +++++++ .../search_synonyms/public/application.tsx | 35 ++++++++++ .../plugins/search_synonyms/public/index.ts | 14 ++++ .../plugins/search_synonyms/public/plugin.ts | 69 +++++++++++++++++++ .../plugins/search_synonyms/public/types.ts | 15 ++++ .../plugins/search_synonyms/server/config.ts | 25 +++++++ .../plugins/search_synonyms/server/index.ts | 15 ++++ .../plugins/search_synonyms/server/plugin.ts | 37 ++++++++++ .../plugins/search_synonyms/server/routes.ts | 10 +++ .../plugins/search_synonyms/server/types.ts | 8 +++ x-pack/plugins/search_synonyms/tsconfig.json | 17 +++++ .../public/navigation_tree.ts | 7 ++ yarn.lock | 4 ++ 24 files changed, 355 insertions(+), 1 deletion(-) create mode 100644 x-pack/plugins/search_synonyms/README.md create mode 100644 x-pack/plugins/search_synonyms/common/index.ts create mode 100644 x-pack/plugins/search_synonyms/common/types.ts create mode 100644 x-pack/plugins/search_synonyms/jest.config.js create mode 100644 x-pack/plugins/search_synonyms/kibana.jsonc create mode 100644 x-pack/plugins/search_synonyms/public/application.tsx create mode 100644 x-pack/plugins/search_synonyms/public/index.ts create mode 100644 x-pack/plugins/search_synonyms/public/plugin.ts create mode 100644 x-pack/plugins/search_synonyms/public/types.ts create mode 100644 x-pack/plugins/search_synonyms/server/config.ts create mode 100644 x-pack/plugins/search_synonyms/server/index.ts create mode 100644 x-pack/plugins/search_synonyms/server/plugin.ts create mode 100644 x-pack/plugins/search_synonyms/server/routes.ts create mode 100644 x-pack/plugins/search_synonyms/server/types.ts create mode 100644 x-pack/plugins/search_synonyms/tsconfig.json diff --git a/package.json b/package.json index f6c3330adad25..baa09a708fd61 100644 --- a/package.json +++ b/package.json @@ -810,6 +810,7 @@ "@kbn/search-playground": "link:x-pack/plugins/search_playground", "@kbn/search-response-warnings": "link:packages/kbn-search-response-warnings", "@kbn/search-shared-ui": "link:x-pack/packages/search/shared_ui", + "@kbn/search-synonyms": "link:x-pack/plugins/search_synonyms", "@kbn/search-types": "link:packages/kbn-search-types", "@kbn/searchprofiler-plugin": "link:x-pack/plugins/searchprofiler", "@kbn/security-api-key-management": "link:x-pack/packages/security/api_key_management", diff --git a/packages/deeplinks/search/constants.ts b/packages/deeplinks/search/constants.ts index 6d9f6492abda7..6d7ea5971cba5 100644 --- a/packages/deeplinks/search/constants.ts +++ b/packages/deeplinks/search/constants.ts @@ -10,6 +10,7 @@ export const ENTERPRISE_SEARCH_APP_ID = 'enterpriseSearch'; export const ENTERPRISE_SEARCH_CONTENT_APP_ID = 'enterpriseSearchContent'; export const ENTERPRISE_SEARCH_RELEVANCE_APP_ID = 'searchInferenceEndpoints'; +export const ENTERPRISE_SEARCH_SYNONYMS_APP_ID = 'searchSynonyms'; export const ENTERPRISE_SEARCH_APPLICATIONS_APP_ID = 'enterpriseSearchApplications'; export const ENTERPRISE_SEARCH_ANALYTICS_APP_ID = 'enterpriseSearchAnalytics'; export const ENTERPRISE_SEARCH_APPSEARCH_APP_ID = 'appSearch'; @@ -19,6 +20,7 @@ export const SERVERLESS_ES_CONNECTORS_ID = 'serverlessConnectors'; export const SERVERLESS_ES_WEB_CRAWLERS_ID = 'serverlessWebCrawlers'; export const SERVERLESS_ES_SEARCH_PLAYGROUND_ID = 'searchPlayground'; export const SERVERLESS_ES_SEARCH_INFERENCE_ENDPOINTS_ID = 'searchInferenceEndpoints'; +export const SERVERLESS_ES_SEARCH_SYNONYMS_ID = 'searchSynonyms'; export const SEARCH_HOMEPAGE = 'searchHomepage'; export const SEARCH_INDICES_START = 'elasticsearchStart'; export const SEARCH_INDICES = 'elasticsearchIndices'; diff --git a/packages/deeplinks/search/deep_links.ts b/packages/deeplinks/search/deep_links.ts index 9dc9a8ed18203..7da3863655f1a 100644 --- a/packages/deeplinks/search/deep_links.ts +++ b/packages/deeplinks/search/deep_links.ts @@ -15,6 +15,7 @@ import { ENTERPRISE_SEARCH_CONTENT_APP_ID, ENTERPRISE_SEARCH_APPLICATIONS_APP_ID, ENTERPRISE_SEARCH_RELEVANCE_APP_ID, + ENTERPRISE_SEARCH_SYNONYMS_APP_ID, ENTERPRISE_SEARCH_ANALYTICS_APP_ID, ENTERPRISE_SEARCH_APPSEARCH_APP_ID, ENTERPRISE_SEARCH_WORKPLACESEARCH_APP_ID, @@ -28,12 +29,14 @@ import { SEARCH_VECTOR_SEARCH, SEARCH_SEMANTIC_SEARCH, SEARCH_AI_SEARCH, + SERVERLESS_ES_SEARCH_SYNONYMS_ID, } from './constants'; export type EnterpriseSearchApp = typeof ENTERPRISE_SEARCH_APP_ID; export type EnterpriseSearchContentApp = typeof ENTERPRISE_SEARCH_CONTENT_APP_ID; export type EnterpriseSearchApplicationsApp = typeof ENTERPRISE_SEARCH_APPLICATIONS_APP_ID; export type EnterpriseSearchRelevanceApp = typeof ENTERPRISE_SEARCH_RELEVANCE_APP_ID; +export type EnterpriseSearchSynonymsApp = typeof ENTERPRISE_SEARCH_SYNONYMS_APP_ID; export type EnterpriseSearchAnalyticsApp = typeof ENTERPRISE_SEARCH_ANALYTICS_APP_ID; export type EnterpriseSearchAppsearchApp = typeof ENTERPRISE_SEARCH_APPSEARCH_APP_ID; export type EnterpriseSearchWorkplaceSearchApp = typeof ENTERPRISE_SEARCH_WORKPLACESEARCH_APP_ID; @@ -42,6 +45,7 @@ export type ConnectorsId = typeof SERVERLESS_ES_CONNECTORS_ID; export type ServerlessWebCrawlers = typeof SERVERLESS_ES_WEB_CRAWLERS_ID; export type SearchPlaygroundId = typeof SERVERLESS_ES_SEARCH_PLAYGROUND_ID; export type SearchInferenceEndpointsId = typeof SERVERLESS_ES_SEARCH_INFERENCE_ENDPOINTS_ID; +export type SearchSynonymsId = typeof SERVERLESS_ES_SEARCH_SYNONYMS_ID; export type SearchHomepage = typeof SEARCH_HOMEPAGE; export type SearchStart = typeof SEARCH_INDICES_START; export type SearchIndices = typeof SEARCH_INDICES; @@ -58,6 +62,8 @@ export type AppsearchLinkId = 'engines'; export type RelevanceLinkId = 'inferenceEndpoints'; +export type SynonymsLinkId = 'synonyms'; + export type SearchIndicesLinkId = typeof SEARCH_INDICES_CREATE_INDEX; export type DeepLinkId = @@ -65,6 +71,7 @@ export type DeepLinkId = | EnterpriseSearchContentApp | EnterpriseSearchApplicationsApp | EnterpriseSearchRelevanceApp + | EnterpriseSearchSynonymsApp | EnterpriseSearchAnalyticsApp | EnterpriseSearchAppsearchApp | EnterpriseSearchWorkplaceSearchApp @@ -73,11 +80,13 @@ export type DeepLinkId = | ServerlessWebCrawlers | SearchPlaygroundId | SearchInferenceEndpointsId + | SearchSynonymsId | SearchHomepage | `${EnterpriseSearchContentApp}:${ContentLinkId}` | `${EnterpriseSearchApplicationsApp}:${ApplicationsLinkId}` | `${EnterpriseSearchAppsearchApp}:${AppsearchLinkId}` | `${EnterpriseSearchRelevanceApp}:${RelevanceLinkId}` + | `${EnterpriseSearchSynonymsApp}:${SynonymsLinkId}` | SearchStart | SearchIndices | SearchElasticsearch diff --git a/packages/deeplinks/search/index.ts b/packages/deeplinks/search/index.ts index 7c78d64081133..db9c019b296e5 100644 --- a/packages/deeplinks/search/index.ts +++ b/packages/deeplinks/search/index.ts @@ -11,6 +11,7 @@ export { ENTERPRISE_SEARCH_APP_ID, ENTERPRISE_SEARCH_CONTENT_APP_ID, ENTERPRISE_SEARCH_RELEVANCE_APP_ID, + ENTERPRISE_SEARCH_SYNONYMS_APP_ID, ENTERPRISE_SEARCH_APPLICATIONS_APP_ID, ENTERPRISE_SEARCH_ANALYTICS_APP_ID, ENTERPRISE_SEARCH_APPSEARCH_APP_ID, diff --git a/tsconfig.base.json b/tsconfig.base.json index c690ecf1a7f93..37a421e1cf654 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -1586,6 +1586,8 @@ "@kbn/search-response-warnings/*": ["packages/kbn-search-response-warnings/*"], "@kbn/search-shared-ui": ["x-pack/packages/search/shared_ui"], "@kbn/search-shared-ui/*": ["x-pack/packages/search/shared_ui/*"], + "@kbn/search-synonyms": ["x-pack/plugins/search_synonyms"], + "@kbn/search-synonyms/*": ["x-pack/plugins/search_synonyms/*"], "@kbn/search-types": ["packages/kbn-search-types"], "@kbn/search-types/*": ["packages/kbn-search-types/*"], "@kbn/searchprofiler-plugin": ["x-pack/plugins/searchprofiler"], diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/layout/base_nav.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/layout/base_nav.tsx index a8fff53d8a9b2..eb85b220bf7f3 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/layout/base_nav.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/shared/layout/base_nav.tsx @@ -125,6 +125,14 @@ export const buildBaseClassicNavItems = ({ }, id: 'inference_endpoints', }, + { + 'data-test-subj': 'searchSideNav-Synonyms', + deepLink: { + link: 'searchSynonyms:synonyms', + shouldShowActiveForSubroutes: true, + }, + id: 'synonyms', + }, ], name: i18n.translate('xpack.enterpriseSearch.nav.relevanceTitle', { defaultMessage: 'Relevance', diff --git a/x-pack/plugins/enterprise_search/public/navigation_tree.ts b/x-pack/plugins/enterprise_search/public/navigation_tree.ts index 25ad8ec37743f..f57fc87e434ef 100644 --- a/x-pack/plugins/enterprise_search/public/navigation_tree.ts +++ b/x-pack/plugins/enterprise_search/public/navigation_tree.ts @@ -209,7 +209,10 @@ export const getNavigationTreeDefinition = ({ }), }, { - children: [{ link: 'searchInferenceEndpoints:inferenceEndpoints' }], + children: [ + { link: 'searchInferenceEndpoints:inferenceEndpoints' }, + { link: 'searchSynonyms:synonyms' }, + ], id: 'relevance', title: i18n.translate('xpack.enterpriseSearch.searchNav.relevance', { defaultMessage: 'Relevance', diff --git a/x-pack/plugins/search_synonyms/README.md b/x-pack/plugins/search_synonyms/README.md new file mode 100644 index 0000000000000..7409c829e67e0 --- /dev/null +++ b/x-pack/plugins/search_synonyms/README.md @@ -0,0 +1,3 @@ +# Search Synonyms + +A plugin to manage synonyms in Elasticsearch through Synonyms APIs through Kibana. \ No newline at end of file diff --git a/x-pack/plugins/search_synonyms/common/index.ts b/x-pack/plugins/search_synonyms/common/index.ts new file mode 100644 index 0000000000000..a34bbadf6a787 --- /dev/null +++ b/x-pack/plugins/search_synonyms/common/index.ts @@ -0,0 +1,10 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export const PLUGIN_ID = 'searchSynonyms'; +export const PLUGIN_NAME = 'Synonyms'; +export const PLUGIN_PATH = '/synonyms'; diff --git a/x-pack/plugins/search_synonyms/common/types.ts b/x-pack/plugins/search_synonyms/common/types.ts new file mode 100644 index 0000000000000..96d1e6fbcdd29 --- /dev/null +++ b/x-pack/plugins/search_synonyms/common/types.ts @@ -0,0 +1,18 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface SearchSynonymsPluginSetup {} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface SearchSynonymsPluginStart {} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface SearchSynonymsConfigType {} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface AppPluginSetupDependencies {} diff --git a/x-pack/plugins/search_synonyms/jest.config.js b/x-pack/plugins/search_synonyms/jest.config.js new file mode 100644 index 0000000000000..5dc5e60c49cfe --- /dev/null +++ b/x-pack/plugins/search_synonyms/jest.config.js @@ -0,0 +1,15 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../..', + roots: ['/x-pack/plugins/search_synonyms'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/search_synonyms', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/plugins/search_synonyms/{public,server}/**/*.{ts,tsx}'], +}; diff --git a/x-pack/plugins/search_synonyms/kibana.jsonc b/x-pack/plugins/search_synonyms/kibana.jsonc new file mode 100644 index 0000000000000..fdafac207629e --- /dev/null +++ b/x-pack/plugins/search_synonyms/kibana.jsonc @@ -0,0 +1,26 @@ +{ + "type": "plugin", + "id": "@kbn/search-synonyms", + "owner": "@elastic/search-kibana", + "group": "search", + "visibility": "private", + "plugin": { + "id": "searchSynonyms", + "server": true, + "browser": true, + "configPath": [ + "xpack", + "searchSynonyms" + ], + "requiredPlugins": [ + ], + "optionalPlugins": [ + "cloud", + "console", + "usageCollection", + ], + "requiredBundles": [ + "kibanaReact", + ] + } +} diff --git a/x-pack/plugins/search_synonyms/public/application.tsx b/x-pack/plugins/search_synonyms/public/application.tsx new file mode 100644 index 0000000000000..d62f8196e7282 --- /dev/null +++ b/x-pack/plugins/search_synonyms/public/application.tsx @@ -0,0 +1,35 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import ReactDOM from 'react-dom'; +import { CoreStart } from '@kbn/core/public'; +import { KibanaRenderContextProvider } from '@kbn/react-kibana-context-render'; +import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; +import { I18nProvider } from '@kbn/i18n-react'; +import { Router } from '@kbn/shared-ux-router'; +import { AppPluginStartDependencies } from './types'; + +export const renderApp = async ( + core: CoreStart, + services: AppPluginStartDependencies, + element: HTMLElement +) => { + ReactDOM.render( + + + + +
Synonyms
+
+
+
+
, + element + ); + return () => ReactDOM.unmountComponentAtNode(element); +}; diff --git a/x-pack/plugins/search_synonyms/public/index.ts b/x-pack/plugins/search_synonyms/public/index.ts new file mode 100644 index 0000000000000..fea6fd2060348 --- /dev/null +++ b/x-pack/plugins/search_synonyms/public/index.ts @@ -0,0 +1,14 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { PluginInitializerContext } from '@kbn/core/public'; + +import { SearchSynonymsPlugin } from './plugin'; + +export function plugin(initializerContext: PluginInitializerContext) { + return new SearchSynonymsPlugin(initializerContext); +} diff --git a/x-pack/plugins/search_synonyms/public/plugin.ts b/x-pack/plugins/search_synonyms/public/plugin.ts new file mode 100644 index 0000000000000..dcbd6e30324bd --- /dev/null +++ b/x-pack/plugins/search_synonyms/public/plugin.ts @@ -0,0 +1,69 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { + CoreSetup, + Plugin, + CoreStart, + PluginInitializerContext, + AppMountParameters, +} from '@kbn/core/public'; +import { i18n } from '@kbn/i18n'; +import { PLUGIN_ID, PLUGIN_NAME, PLUGIN_PATH } from '../common'; +import { + AppPluginSetupDependencies, + AppPluginStartDependencies, + SearchSynonymsPluginSetup, + SearchSynonymsPluginStart, +} from './types'; + +export class SearchSynonymsPlugin + implements Plugin +{ + constructor(_: PluginInitializerContext) {} + + public setup( + core: CoreSetup, + deps: AppPluginSetupDependencies + ): SearchSynonymsPluginSetup { + core.application.register({ + id: PLUGIN_ID, + appRoute: '/app/elasticsearch/synonyms', + title: PLUGIN_NAME, + deepLinks: [ + { + id: 'synonyms', + path: PLUGIN_PATH, + title: i18n.translate('xpack.searchSynonyms.appTitle', { + defaultMessage: 'Synonyms', + }), + }, + ], + async mount({ element, history }: AppMountParameters) { + const { renderApp } = await import('./application'); + const [coreStart, depsStart] = await core.getStartServices(); + + coreStart.chrome.docTitle.change(PLUGIN_NAME); + + const startDeps: AppPluginStartDependencies = { + ...depsStart, + history, + }; + + return renderApp(coreStart, startDeps, element); + }, + }); + + return {}; + } + + public start(core: CoreStart, deps: AppPluginStartDependencies): SearchSynonymsPluginStart { + return {}; + } + + public stop() {} +} diff --git a/x-pack/plugins/search_synonyms/public/types.ts b/x-pack/plugins/search_synonyms/public/types.ts new file mode 100644 index 0000000000000..5658cbc0b2806 --- /dev/null +++ b/x-pack/plugins/search_synonyms/public/types.ts @@ -0,0 +1,15 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export * from '../common/types'; + +export interface AppPluginStartDependencies { + history: AppMountParameters['history']; + console?: ConsolePluginStart; +} +import { AppMountParameters } from '@kbn/core/public'; +import type { ConsolePluginStart } from '@kbn/console-plugin/public'; diff --git a/x-pack/plugins/search_synonyms/server/config.ts b/x-pack/plugins/search_synonyms/server/config.ts new file mode 100644 index 0000000000000..5c48b3912019b --- /dev/null +++ b/x-pack/plugins/search_synonyms/server/config.ts @@ -0,0 +1,25 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { schema, TypeOf } from '@kbn/config-schema'; +import { PluginConfigDescriptor } from '@kbn/core/server'; + +const configSchema = schema.object({ + enabled: schema.boolean({ defaultValue: true }), + ui: schema.object({ + enabled: schema.boolean({ defaultValue: false }), + }), +}); + +export type SearchPlaygroundConfig = TypeOf; + +export const config: PluginConfigDescriptor = { + exposeToBrowser: { + ui: true, + }, + schema: configSchema, +}; diff --git a/x-pack/plugins/search_synonyms/server/index.ts b/x-pack/plugins/search_synonyms/server/index.ts new file mode 100644 index 0000000000000..dee7649a841d2 --- /dev/null +++ b/x-pack/plugins/search_synonyms/server/index.ts @@ -0,0 +1,15 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { PluginInitializerContext } from '@kbn/core/server'; + +export async function plugin(initializerContext: PluginInitializerContext) { + const { SearchSynonymsPlugin } = await import('./plugin'); + return new SearchSynonymsPlugin(initializerContext); +} + +export type { SearchSynonymsPluginSetup, SearchSynonymsPluginStart } from './types'; diff --git a/x-pack/plugins/search_synonyms/server/plugin.ts b/x-pack/plugins/search_synonyms/server/plugin.ts new file mode 100644 index 0000000000000..8e1548c11b420 --- /dev/null +++ b/x-pack/plugins/search_synonyms/server/plugin.ts @@ -0,0 +1,37 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { PluginInitializerContext, CoreSetup, CoreStart, Plugin, Logger } from '@kbn/core/server'; + +import { SearchSynonymsPluginSetup, SearchSynonymsPluginStart } from './types'; + +import { defineRoutes } from './routes'; + +export class SearchSynonymsPlugin + implements Plugin +{ + private readonly logger: Logger; + + constructor(initializerContext: PluginInitializerContext) { + this.logger = initializerContext.logger.get(); + } + + public setup(core: CoreSetup) { + this.logger.debug('searchSynonyms: Setup'); + const router = core.http.createRouter(); + + defineRoutes({ router, logger: this.logger }); + + return {}; + } + + public start(core: CoreStart) { + return {}; + } + + public stop() {} +} diff --git a/x-pack/plugins/search_synonyms/server/routes.ts b/x-pack/plugins/search_synonyms/server/routes.ts new file mode 100644 index 0000000000000..9411887ffb311 --- /dev/null +++ b/x-pack/plugins/search_synonyms/server/routes.ts @@ -0,0 +1,10 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { IRouter, Logger } from '@kbn/core/server'; + +export function defineRoutes({ logger, router }: { logger: Logger; router: IRouter }) {} diff --git a/x-pack/plugins/search_synonyms/server/types.ts b/x-pack/plugins/search_synonyms/server/types.ts new file mode 100644 index 0000000000000..ff25570f9ab5f --- /dev/null +++ b/x-pack/plugins/search_synonyms/server/types.ts @@ -0,0 +1,8 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export * from '../common/types'; diff --git a/x-pack/plugins/search_synonyms/tsconfig.json b/x-pack/plugins/search_synonyms/tsconfig.json new file mode 100644 index 0000000000000..ba29a72177ee3 --- /dev/null +++ b/x-pack/plugins/search_synonyms/tsconfig.json @@ -0,0 +1,17 @@ +{ + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + }, + "include": [ + "__mocks__/**/*", + "common/**/*", + "public/**/*", + "server/**/*", + ], + "kbn_references": [ + ], + "exclude": [ + "target/**/*", + ] +} diff --git a/x-pack/plugins/serverless_search/public/navigation_tree.ts b/x-pack/plugins/serverless_search/public/navigation_tree.ts index 524888d0d33e6..b1451e4d56bed 100644 --- a/x-pack/plugins/serverless_search/public/navigation_tree.ts +++ b/x-pack/plugins/serverless_search/public/navigation_tree.ts @@ -103,6 +103,13 @@ export const navigationTree = ({ isAppRegistered }: ApplicationStart): Navigatio ), link: 'searchInferenceEndpoints', }, + { + id: 'searchSynonyms', + title: i18n.translate('xpack.serverlessSearch.nav.relevance.searchSynonyms', { + defaultMessage: 'Synonyms', + }), + link: 'searchSynonyms', + }, ], }, { diff --git a/yarn.lock b/yarn.lock index 90429bc21f489..e74dcc6e65b72 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6980,6 +6980,10 @@ version "0.0.0" uid "" +"@kbn/search-synonyms@link:x-pack/plugins/search_synonyms": + version "0.0.0" + uid "" + "@kbn/search-types@link:packages/kbn-search-types": version "0.0.0" uid "" From 97c8d0a5f5a5acb526cbb0af74ce484ab43b9829 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Efe=20G=C3=BCrkan=20YALAMAN?= Date: Fri, 6 Dec 2024 17:28:27 +0100 Subject: [PATCH 02/17] Check config before registering --- x-pack/plugins/search_synonyms/common/types.ts | 6 ++++++ x-pack/plugins/search_synonyms/public/index.ts | 2 ++ x-pack/plugins/search_synonyms/public/plugin.ts | 15 +++++++++++---- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/x-pack/plugins/search_synonyms/common/types.ts b/x-pack/plugins/search_synonyms/common/types.ts index 96d1e6fbcdd29..31bcb54416888 100644 --- a/x-pack/plugins/search_synonyms/common/types.ts +++ b/x-pack/plugins/search_synonyms/common/types.ts @@ -16,3 +16,9 @@ export interface SearchSynonymsConfigType {} // eslint-disable-next-line @typescript-eslint/no-empty-interface export interface AppPluginSetupDependencies {} + +export interface SearchSynonymsConfigType { + ui: { + enabled: boolean; + }; +} diff --git a/x-pack/plugins/search_synonyms/public/index.ts b/x-pack/plugins/search_synonyms/public/index.ts index fea6fd2060348..4e1d1ab027e03 100644 --- a/x-pack/plugins/search_synonyms/public/index.ts +++ b/x-pack/plugins/search_synonyms/public/index.ts @@ -12,3 +12,5 @@ import { SearchSynonymsPlugin } from './plugin'; export function plugin(initializerContext: PluginInitializerContext) { return new SearchSynonymsPlugin(initializerContext); } + +export const SYNONYMS_UI_FLAG = 'searchSynonyms:synonymsEnabled'; diff --git a/x-pack/plugins/search_synonyms/public/plugin.ts b/x-pack/plugins/search_synonyms/public/plugin.ts index dcbd6e30324bd..2c73852e25155 100644 --- a/x-pack/plugins/search_synonyms/public/plugin.ts +++ b/x-pack/plugins/search_synonyms/public/plugin.ts @@ -8,7 +8,6 @@ import type { CoreSetup, Plugin, - CoreStart, PluginInitializerContext, AppMountParameters, } from '@kbn/core/public'; @@ -17,19 +16,27 @@ import { PLUGIN_ID, PLUGIN_NAME, PLUGIN_PATH } from '../common'; import { AppPluginSetupDependencies, AppPluginStartDependencies, + SearchSynonymsConfigType, SearchSynonymsPluginSetup, SearchSynonymsPluginStart, } from './types'; +import { SYNONYMS_UI_FLAG } from '.'; export class SearchSynonymsPlugin implements Plugin { - constructor(_: PluginInitializerContext) {} + private config: SearchSynonymsConfigType; + constructor(initializerContext: PluginInitializerContext) { + this.config = initializerContext.config.get(); + } public setup( core: CoreSetup, - deps: AppPluginSetupDependencies + _: AppPluginSetupDependencies ): SearchSynonymsPluginSetup { + if (!this.config.ui?.enabled && !core.uiSettings.get(SYNONYMS_UI_FLAG, false)) { + return {}; + } core.application.register({ id: PLUGIN_ID, appRoute: '/app/elasticsearch/synonyms', @@ -61,7 +68,7 @@ export class SearchSynonymsPlugin return {}; } - public start(core: CoreStart, deps: AppPluginStartDependencies): SearchSynonymsPluginStart { + public start(): SearchSynonymsPluginStart { return {}; } From ac08dfae2e4aec02c340b55e42c27c877fa38fc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Efe=20G=C3=BCrkan=20YALAMAN?= Date: Tue, 17 Dec 2024 13:16:48 +0100 Subject: [PATCH 03/17] Update navigation on synonyms plugins --- config/serverless.oblt.yml | 1 + config/serverless.security.yml | 1 + packages/deeplinks/search/constants.ts | 1 - packages/deeplinks/search/deep_links.ts | 5 +- packages/deeplinks/search/index.ts | 1 - x-pack/plugins/search_synonyms/kibana.jsonc | 3 ++ .../plugins/search_synonyms/public/plugin.ts | 32 +++++++++++- .../plugins/search_synonyms/public/types.ts | 4 ++ .../plugins/search_synonyms/server/plugin.ts | 50 +++++++++++++++++-- .../plugins/search_synonyms/server/types.ts | 5 ++ 10 files changed, 92 insertions(+), 11 deletions(-) diff --git a/config/serverless.oblt.yml b/config/serverless.oblt.yml index 937954a1c5e84..234646984a9ee 100644 --- a/config/serverless.oblt.yml +++ b/config/serverless.oblt.yml @@ -9,6 +9,7 @@ xpack.securitySolution.enabled: false xpack.search.notebooks.enabled: false xpack.searchPlayground.enabled: false xpack.searchInferenceEndpoints.enabled: false +xpack.searchSynonyms.enabled: false ## Fine-tune the observability solution feature privileges. Also, refer to `serverless.yml` for the project-agnostic overrides. xpack.features.overrides: diff --git a/config/serverless.security.yml b/config/serverless.security.yml index 47a67c293565a..4e113a016dc05 100644 --- a/config/serverless.security.yml +++ b/config/serverless.security.yml @@ -11,6 +11,7 @@ xpack.search.notebooks.enabled: false xpack.searchPlayground.enabled: false xpack.searchInferenceEndpoints.enabled: false xpack.inventory.enabled: false +xpack.searchSynonyms.enabled: false ## Fine-tune the security solution feature privileges. Also, refer to `serverless.yml` for the project-agnostic overrides. xpack.features.overrides: diff --git a/packages/deeplinks/search/constants.ts b/packages/deeplinks/search/constants.ts index 9da6a367d47de..896bd9a24b8aa 100644 --- a/packages/deeplinks/search/constants.ts +++ b/packages/deeplinks/search/constants.ts @@ -9,7 +9,6 @@ export const ENTERPRISE_SEARCH_APP_ID = 'enterpriseSearch'; export const ENTERPRISE_SEARCH_CONTENT_APP_ID = 'enterpriseSearchContent'; -export const ENTERPRISE_SEARCH_SYNONYMS_APP_ID = 'searchSynonyms'; export const ENTERPRISE_SEARCH_APPLICATIONS_APP_ID = 'enterpriseSearchApplications'; export const ENTERPRISE_SEARCH_ANALYTICS_APP_ID = 'enterpriseSearchAnalytics'; export const ENTERPRISE_SEARCH_APPSEARCH_APP_ID = 'appSearch'; diff --git a/packages/deeplinks/search/deep_links.ts b/packages/deeplinks/search/deep_links.ts index 5cbbc665fe8b1..bdb60413991b0 100644 --- a/packages/deeplinks/search/deep_links.ts +++ b/packages/deeplinks/search/deep_links.ts @@ -14,7 +14,6 @@ import { ENTERPRISE_SEARCH_APP_ID, ENTERPRISE_SEARCH_CONTENT_APP_ID, ENTERPRISE_SEARCH_APPLICATIONS_APP_ID, - ENTERPRISE_SEARCH_SYNONYMS_APP_ID, ENTERPRISE_SEARCH_ANALYTICS_APP_ID, ENTERPRISE_SEARCH_APPSEARCH_APP_ID, ENTERPRISE_SEARCH_WORKPLACESEARCH_APP_ID, @@ -34,7 +33,6 @@ import { export type EnterpriseSearchApp = typeof ENTERPRISE_SEARCH_APP_ID; export type EnterpriseSearchContentApp = typeof ENTERPRISE_SEARCH_CONTENT_APP_ID; export type EnterpriseSearchApplicationsApp = typeof ENTERPRISE_SEARCH_APPLICATIONS_APP_ID; -export type EnterpriseSearchSynonymsApp = typeof ENTERPRISE_SEARCH_SYNONYMS_APP_ID; export type EnterpriseSearchAnalyticsApp = typeof ENTERPRISE_SEARCH_ANALYTICS_APP_ID; export type EnterpriseSearchAppsearchApp = typeof ENTERPRISE_SEARCH_APPSEARCH_APP_ID; export type EnterpriseSearchWorkplaceSearchApp = typeof ENTERPRISE_SEARCH_WORKPLACESEARCH_APP_ID; @@ -68,7 +66,6 @@ export type DeepLinkId = | EnterpriseSearchApp | EnterpriseSearchContentApp | EnterpriseSearchApplicationsApp - | EnterpriseSearchSynonymsApp | EnterpriseSearchAnalyticsApp | EnterpriseSearchAppsearchApp | EnterpriseSearchWorkplaceSearchApp @@ -83,7 +80,7 @@ export type DeepLinkId = | `${EnterpriseSearchApplicationsApp}:${ApplicationsLinkId}` | `${EnterpriseSearchAppsearchApp}:${AppsearchLinkId}` | `${SearchInferenceEndpointsId}:${SearchInferenceEndpointsLinkId}` - | `${EnterpriseSearchSynonymsApp}:${SynonymsLinkId}` + | `${SearchSynonymsId}:${SynonymsLinkId}` | SearchStart | SearchIndices | SearchElasticsearch diff --git a/packages/deeplinks/search/index.ts b/packages/deeplinks/search/index.ts index 97ca6b660233d..2b3d392971a5f 100644 --- a/packages/deeplinks/search/index.ts +++ b/packages/deeplinks/search/index.ts @@ -10,7 +10,6 @@ export { ENTERPRISE_SEARCH_APP_ID, ENTERPRISE_SEARCH_CONTENT_APP_ID, - ENTERPRISE_SEARCH_SYNONYMS_APP_ID, ENTERPRISE_SEARCH_APPLICATIONS_APP_ID, ENTERPRISE_SEARCH_ANALYTICS_APP_ID, ENTERPRISE_SEARCH_APPSEARCH_APP_ID, diff --git a/x-pack/plugins/search_synonyms/kibana.jsonc b/x-pack/plugins/search_synonyms/kibana.jsonc index fdafac207629e..26d5ac84de49f 100644 --- a/x-pack/plugins/search_synonyms/kibana.jsonc +++ b/x-pack/plugins/search_synonyms/kibana.jsonc @@ -13,11 +13,14 @@ "searchSynonyms" ], "requiredPlugins": [ + "licensing", + "features", ], "optionalPlugins": [ "cloud", "console", "usageCollection", + "searchNavigation", ], "requiredBundles": [ "kibanaReact", diff --git a/x-pack/plugins/search_synonyms/public/plugin.ts b/x-pack/plugins/search_synonyms/public/plugin.ts index 2c73852e25155..869b6025ea930 100644 --- a/x-pack/plugins/search_synonyms/public/plugin.ts +++ b/x-pack/plugins/search_synonyms/public/plugin.ts @@ -5,11 +5,16 @@ * 2.0. */ +import { BehaviorSubject, type Subscription } from 'rxjs'; + +import { AppStatus } from '@kbn/core/public'; import type { + AppUpdater, CoreSetup, Plugin, PluginInitializerContext, AppMountParameters, + CoreStart, } from '@kbn/core/public'; import { i18n } from '@kbn/i18n'; import { PLUGIN_ID, PLUGIN_NAME, PLUGIN_PATH } from '../common'; @@ -26,6 +31,9 @@ export class SearchSynonymsPlugin implements Plugin { private config: SearchSynonymsConfigType; + private readonly appUpdater$ = new BehaviorSubject(() => ({})); + private licenseSubscription?: Subscription; + constructor(initializerContext: PluginInitializerContext) { this.config = initializerContext.config.get(); } @@ -48,8 +56,11 @@ export class SearchSynonymsPlugin title: i18n.translate('xpack.searchSynonyms.appTitle', { defaultMessage: 'Synonyms', }), + visibleIn: ['globalSearch'], }, ], + status: AppStatus.inaccessible, + updater$: this.appUpdater$, async mount({ element, history }: AppMountParameters) { const { renderApp } = await import('./application'); const [coreStart, depsStart] = await core.getStartServices(); @@ -61,16 +72,33 @@ export class SearchSynonymsPlugin history, }; + depsStart.searchNavigation?.handleOnAppMount(); + return renderApp(coreStart, startDeps, element); }, + visibleIn: [], }); return {}; } - public start(): SearchSynonymsPluginStart { + public start(_: CoreStart, deps: AppPluginStartDependencies): SearchSynonymsPluginStart { + const { licensing } = deps; + this.licenseSubscription = licensing.license$.subscribe((license) => { + const status: AppStatus = + license && license.isAvailable && license.isActive && license.hasAtLeast('enterprise') + ? AppStatus.accessible + : AppStatus.inaccessible; + + this.appUpdater$.next(() => ({ status })); + }); return {}; } - public stop() {} + public stop() { + if (this.licenseSubscription) { + this.licenseSubscription.unsubscribe(); + this.licenseSubscription = undefined; + } + } } diff --git a/x-pack/plugins/search_synonyms/public/types.ts b/x-pack/plugins/search_synonyms/public/types.ts index 5658cbc0b2806..61192647081f0 100644 --- a/x-pack/plugins/search_synonyms/public/types.ts +++ b/x-pack/plugins/search_synonyms/public/types.ts @@ -5,11 +5,15 @@ * 2.0. */ +import { LicensingPluginStart } from '@kbn/licensing-plugin/public'; +import { SearchNavigationPluginStart } from '@kbn/search-navigation/public'; export * from '../common/types'; export interface AppPluginStartDependencies { history: AppMountParameters['history']; console?: ConsolePluginStart; + licensing: LicensingPluginStart; + searchNavigation: SearchNavigationPluginStart; } import { AppMountParameters } from '@kbn/core/public'; import type { ConsolePluginStart } from '@kbn/console-plugin/public'; diff --git a/x-pack/plugins/search_synonyms/server/plugin.ts b/x-pack/plugins/search_synonyms/server/plugin.ts index 8e1548c11b420..c6a9d4f63f7d2 100644 --- a/x-pack/plugins/search_synonyms/server/plugin.ts +++ b/x-pack/plugins/search_synonyms/server/plugin.ts @@ -5,11 +5,24 @@ * 2.0. */ -import { PluginInitializerContext, CoreSetup, CoreStart, Plugin, Logger } from '@kbn/core/server'; +import { + PluginInitializerContext, + CoreSetup, + CoreStart, + Plugin, + Logger, + DEFAULT_APP_CATEGORIES, +} from '@kbn/core/server'; -import { SearchSynonymsPluginSetup, SearchSynonymsPluginStart } from './types'; +import { KibanaFeatureScope } from '@kbn/features-plugin/common'; +import { + SearchSynonymsPluginSetup, + SearchSynonymsPluginSetupDependencies, + SearchSynonymsPluginStart, +} from './types'; import { defineRoutes } from './routes'; +import { PLUGIN_ID, PLUGIN_NAME } from '../common'; export class SearchSynonymsPlugin implements Plugin @@ -20,12 +33,43 @@ export class SearchSynonymsPlugin this.logger = initializerContext.logger.get(); } - public setup(core: CoreSetup) { + public setup(core: CoreSetup, plugins: SearchSynonymsPluginSetupDependencies) { this.logger.debug('searchSynonyms: Setup'); const router = core.http.createRouter(); defineRoutes({ router, logger: this.logger }); + plugins.features.registerKibanaFeature({ + id: PLUGIN_ID, + minimumLicense: 'enterprise', + name: PLUGIN_NAME, + order: 0, + category: DEFAULT_APP_CATEGORIES.enterpriseSearch, + app: ['kibana', PLUGIN_ID], + scope: [KibanaFeatureScope.Spaces, KibanaFeatureScope.Security], + catalogue: [PLUGIN_ID], + privileges: { + all: { + app: ['kibana', PLUGIN_ID], + api: [], + catalogue: [PLUGIN_ID], + savedObject: { + all: [], + read: [], + }, + ui: [], + }, + read: { + disabled: true, + savedObject: { + all: [], + read: [], + }, + ui: [], + }, + }, + }); + return {}; } diff --git a/x-pack/plugins/search_synonyms/server/types.ts b/x-pack/plugins/search_synonyms/server/types.ts index ff25570f9ab5f..de63a55f0b023 100644 --- a/x-pack/plugins/search_synonyms/server/types.ts +++ b/x-pack/plugins/search_synonyms/server/types.ts @@ -5,4 +5,9 @@ * 2.0. */ +import { FeaturesPluginSetup } from '@kbn/features-plugin/server'; export * from '../common/types'; + +export interface SearchSynonymsPluginSetupDependencies { + features: FeaturesPluginSetup; +} From 0706ecad15cab6881ac6d1809c167b960eea3b82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Efe=20G=C3=BCrkan=20YALAMAN?= Date: Tue, 17 Dec 2024 13:51:47 +0100 Subject: [PATCH 04/17] Fix missing config export --- x-pack/plugins/search_synonyms/server/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/x-pack/plugins/search_synonyms/server/index.ts b/x-pack/plugins/search_synonyms/server/index.ts index dee7649a841d2..9b8e954852ef7 100644 --- a/x-pack/plugins/search_synonyms/server/index.ts +++ b/x-pack/plugins/search_synonyms/server/index.ts @@ -7,6 +7,8 @@ import { PluginInitializerContext } from '@kbn/core/server'; +export { config } from './config'; + export async function plugin(initializerContext: PluginInitializerContext) { const { SearchSynonymsPlugin } = await import('./plugin'); return new SearchSynonymsPlugin(initializerContext); From ba7c1f4b448ce41b1adb8f34e3a1e8cf71168bc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Efe=20G=C3=BCrkan=20YALAMAN?= Date: Tue, 17 Dec 2024 14:53:30 +0100 Subject: [PATCH 05/17] Fix quick check failures --- .github/CODEOWNERS | 1 + docs/developer/plugin-list.asciidoc | 4 ++++ packages/kbn-optimizer/limits.yml | 1 + x-pack/plugins/search_synonyms/tsconfig.json | 11 +++++++++++ 4 files changed, 17 insertions(+) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index d9def6481fc90..756a7e2642724 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -944,6 +944,7 @@ x-pack/plugins/search_inference_endpoints @elastic/search-kibana x-pack/plugins/search_notebooks @elastic/search-kibana x-pack/plugins/search_playground @elastic/search-kibana x-pack/plugins/search_solution/search_navigation @elastic/search-kibana +x-pack/plugins/search_synonyms @elastic/search-kibana x-pack/plugins/security @elastic/kibana-security x-pack/plugins/serverless @elastic/appex-sharedux x-pack/plugins/serverless_search @elastic/search-kibana diff --git a/docs/developer/plugin-list.asciidoc b/docs/developer/plugin-list.asciidoc index f18bafe5221b3..dc7134818d8d9 100644 --- a/docs/developer/plugin-list.asciidoc +++ b/docs/developer/plugin-list.asciidoc @@ -859,6 +859,10 @@ detailed information on how Elasticsearch executed the search request. People us to understand why a search request might be slow. +|{kib-repo}blob/{branch}/x-pack/plugins/search_synonyms/README.md[searchSynonyms] +|A plugin to manage synonyms in Elasticsearch through Synonyms APIs through Kibana. + + |{kib-repo}blob/{branch}/x-pack/plugins/security/README.md[security] |See Configuring security in Kibana. diff --git a/packages/kbn-optimizer/limits.yml b/packages/kbn-optimizer/limits.yml index 3152a02cd730f..ee867ebffce49 100644 --- a/packages/kbn-optimizer/limits.yml +++ b/packages/kbn-optimizer/limits.yml @@ -149,6 +149,7 @@ pageLoadAssetSize: searchNotebooks: 18942 searchPlayground: 19325 searchprofiler: 67080 + searchSynonyms: 20262 security: 81771 securitySolution: 98429 securitySolutionEss: 31781 diff --git a/x-pack/plugins/search_synonyms/tsconfig.json b/x-pack/plugins/search_synonyms/tsconfig.json index ba29a72177ee3..fd713cfa92ccf 100644 --- a/x-pack/plugins/search_synonyms/tsconfig.json +++ b/x-pack/plugins/search_synonyms/tsconfig.json @@ -10,6 +10,17 @@ "server/**/*", ], "kbn_references": [ + "@kbn/config-schema", + "@kbn/core", + "@kbn/i18n", + "@kbn/i18n-react", + "@kbn/kibana-react-plugin", + "@kbn/shared-ux-router", + "@kbn/react-kibana-context-render", + "@kbn/console-plugin", + "@kbn/features-plugin", + "@kbn/search-navigation", + "@kbn/licensing-plugin" ], "exclude": [ "target/**/*", From 7cf6cf1ef480551af1da4961f8bfc096ef370fac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Efe=20G=C3=BCrkan=20YALAMAN?= Date: Tue, 17 Dec 2024 17:15:08 +0100 Subject: [PATCH 06/17] FTR fixes --- test/plugin_functional/test_suites/core_plugins/rendering.ts | 1 + x-pack/test/api_integration/apis/features/features/features.ts | 2 ++ x-pack/test/api_integration/apis/security/privileges.ts | 1 + x-pack/test/api_integration/apis/security/privileges_basic.ts | 2 ++ .../spaces_api_integration/spaces_only/telemetry/telemetry.ts | 1 + .../test/ui_capabilities/security_and_spaces/tests/catalogue.ts | 1 + .../test/ui_capabilities/security_and_spaces/tests/nav_links.ts | 1 + 7 files changed, 9 insertions(+) diff --git a/test/plugin_functional/test_suites/core_plugins/rendering.ts b/test/plugin_functional/test_suites/core_plugins/rendering.ts index 87b8fe406263b..6bf4c289ba3e7 100644 --- a/test/plugin_functional/test_suites/core_plugins/rendering.ts +++ b/test/plugin_functional/test_suites/core_plugins/rendering.ts @@ -330,6 +330,7 @@ export default function ({ getService }: PluginFunctionalProviderContext) { 'xpack.searchAssistant.ui.enabled (boolean?)', 'xpack.searchInferenceEndpoints.ui.enabled (boolean?)', 'xpack.searchPlayground.ui.enabled (boolean?)', + 'xpack.searchSynonyms.ui.enabled (boolean?)', 'xpack.security.loginAssistanceMessage (string?)', 'xpack.security.sameSiteCookies (Strict?|Lax?|None?)', 'xpack.security.showInsecureClusterWarning (boolean?)', diff --git a/x-pack/test/api_integration/apis/features/features/features.ts b/x-pack/test/api_integration/apis/features/features/features.ts index bbdce7ab42912..e0b1e48cbd5ba 100644 --- a/x-pack/test/api_integration/apis/features/features/features.ts +++ b/x-pack/test/api_integration/apis/features/features/features.ts @@ -131,6 +131,7 @@ export default function ({ getService }: FtrProviderContext) { 'rulesSettings', 'uptime', 'searchInferenceEndpoints', + 'searchSynonyms', 'searchPlayground', 'siem', 'slo', @@ -185,6 +186,7 @@ export default function ({ getService }: FtrProviderContext) { 'rulesSettings', 'uptime', 'searchInferenceEndpoints', + 'searchSynonyms', 'searchPlayground', 'siem', 'slo', diff --git a/x-pack/test/api_integration/apis/security/privileges.ts b/x-pack/test/api_integration/apis/security/privileges.ts index bb00c34bc5808..1daabb669ba18 100644 --- a/x-pack/test/api_integration/apis/security/privileges.ts +++ b/x-pack/test/api_integration/apis/security/privileges.ts @@ -62,6 +62,7 @@ export default function ({ getService }: FtrProviderContext) { slo: ['all', 'read', 'minimal_all', 'minimal_read'], searchPlayground: ['all', 'read', 'minimal_all', 'minimal_read'], searchInferenceEndpoints: ['all', 'read', 'minimal_all', 'minimal_read'], + searchSynonyms: ['all', 'read', 'minimal_all', 'minimal_read'], fleetv2: [ 'all', 'read', diff --git a/x-pack/test/api_integration/apis/security/privileges_basic.ts b/x-pack/test/api_integration/apis/security/privileges_basic.ts index a7b8ee3fd2091..35a182d0ee74d 100644 --- a/x-pack/test/api_integration/apis/security/privileges_basic.ts +++ b/x-pack/test/api_integration/apis/security/privileges_basic.ts @@ -54,6 +54,7 @@ export default function ({ getService }: FtrProviderContext) { securitySolutionCasesV2: ['all', 'read', 'minimal_all', 'minimal_read'], searchPlayground: ['all', 'read', 'minimal_all', 'minimal_read'], searchInferenceEndpoints: ['all', 'read', 'minimal_all', 'minimal_read'], + searchSynonyms: ['all', 'read', 'minimal_all', 'minimal_read'], fleetv2: ['all', 'read', 'minimal_all', 'minimal_read'], fleet: ['all', 'read', 'minimal_all', 'minimal_read'], stackAlerts: ['all', 'read', 'minimal_all', 'minimal_read'], @@ -151,6 +152,7 @@ export default function ({ getService }: FtrProviderContext) { slo: ['all', 'read', 'minimal_all', 'minimal_read'], searchPlayground: ['all', 'read', 'minimal_all', 'minimal_read'], searchInferenceEndpoints: ['all', 'read', 'minimal_all', 'minimal_read'], + searchSynonyms: ['all', 'read', 'minimal_all', 'minimal_read'], fleetv2: [ 'agent_policies_all', 'agent_policies_read', diff --git a/x-pack/test/spaces_api_integration/spaces_only/telemetry/telemetry.ts b/x-pack/test/spaces_api_integration/spaces_only/telemetry/telemetry.ts index 1af3b0e593e06..b934e9b3333cd 100644 --- a/x-pack/test/spaces_api_integration/spaces_only/telemetry/telemetry.ts +++ b/x-pack/test/spaces_api_integration/spaces_only/telemetry/telemetry.ts @@ -86,6 +86,7 @@ export default function ({ getService }: FtrProviderContext) { enterpriseSearchApplications: 0, enterpriseSearchAnalytics: 0, searchInferenceEndpoints: 0, + searchSynonyms: 0, searchPlayground: 0, siem: 0, securitySolutionCases: 0, diff --git a/x-pack/test/ui_capabilities/security_and_spaces/tests/catalogue.ts b/x-pack/test/ui_capabilities/security_and_spaces/tests/catalogue.ts index 71324846b2160..4e9401cc41481 100644 --- a/x-pack/test/ui_capabilities/security_and_spaces/tests/catalogue.ts +++ b/x-pack/test/ui_capabilities/security_and_spaces/tests/catalogue.ts @@ -89,6 +89,7 @@ export default function catalogueTests({ getService }: FtrProviderContext) { 'enterpriseSearchElasticsearch', 'searchPlayground', 'searchInferenceEndpoints', + 'searchSynonyms', 'appSearch', 'observabilityAIAssistant', 'workplaceSearch', diff --git a/x-pack/test/ui_capabilities/security_and_spaces/tests/nav_links.ts b/x-pack/test/ui_capabilities/security_and_spaces/tests/nav_links.ts index 75408726ab8c9..a75dd62e6c6bc 100644 --- a/x-pack/test/ui_capabilities/security_and_spaces/tests/nav_links.ts +++ b/x-pack/test/ui_capabilities/security_and_spaces/tests/nav_links.ts @@ -63,6 +63,7 @@ export default function navLinksTests({ getService }: FtrProviderContext) { 'enterpriseSearchAnalytics', 'searchPlayground', 'searchInferenceEndpoints', + 'searchSynonyms', 'guidedOnboardingFeature', 'securitySolutionAssistant', 'securitySolutionAttackDiscovery', From 78c132cdbb741fff9a8fffe27f32598988a7bab7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Efe=20G=C3=BCrkan=20YALAMAN?= Date: Mon, 23 Dec 2024 16:09:23 +0100 Subject: [PATCH 07/17] Review changes --- config/serverless.es.yml | 4 +++ packages/deeplinks/search/constants.ts | 2 +- packages/deeplinks/search/deep_links.ts | 4 +-- .../plugins/search_synonyms/common/index.ts | 1 - .../plugins/search_synonyms/common/types.ts | 7 +--- .../plugins/search_synonyms/public/plugin.ts | 34 +++---------------- .../plugins/search_synonyms/public/types.ts | 2 -- .../plugins/search_synonyms/server/config.ts | 7 ++-- .../plugins/search_synonyms/server/plugin.ts | 10 +++--- .../search/config.feature_flags.ts | 3 ++ 10 files changed, 23 insertions(+), 51 deletions(-) diff --git a/config/serverless.es.yml b/config/serverless.es.yml index 2d5ba84ece795..c715c748bb38a 100644 --- a/config/serverless.es.yml +++ b/config/serverless.es.yml @@ -132,3 +132,7 @@ aiAssistantManagementSelection.preferredAIAssistantType: "observability" xpack.observabilityAiAssistantManagement.logSourcesEnabled: false xpack.observabilityAiAssistantManagement.spacesEnabled: false xpack.observabilityAiAssistantManagement.visibilityEnabled: false + + +# Synonyms UI +xpack.searchSynonyms.enabled: false diff --git a/packages/deeplinks/search/constants.ts b/packages/deeplinks/search/constants.ts index 896bd9a24b8aa..d1992d22da120 100644 --- a/packages/deeplinks/search/constants.ts +++ b/packages/deeplinks/search/constants.ts @@ -18,7 +18,7 @@ export const SERVERLESS_ES_CONNECTORS_ID = 'serverlessConnectors'; export const SERVERLESS_ES_WEB_CRAWLERS_ID = 'serverlessWebCrawlers'; export const ES_SEARCH_PLAYGROUND_ID = 'searchPlayground'; export const SERVERLESS_ES_SEARCH_INFERENCE_ENDPOINTS_ID = 'searchInferenceEndpoints'; -export const SERVERLESS_ES_SEARCH_SYNONYMS_ID = 'searchSynonyms'; +export const ES_SEARCH_SYNONYMS_ID = 'searchSynonyms'; export const SEARCH_HOMEPAGE = 'searchHomepage'; export const SEARCH_INDICES_START = 'elasticsearchStart'; export const SEARCH_INDICES = 'elasticsearchIndices'; diff --git a/packages/deeplinks/search/deep_links.ts b/packages/deeplinks/search/deep_links.ts index bdb60413991b0..662481cd038d5 100644 --- a/packages/deeplinks/search/deep_links.ts +++ b/packages/deeplinks/search/deep_links.ts @@ -27,7 +27,7 @@ import { SEARCH_VECTOR_SEARCH, SEARCH_SEMANTIC_SEARCH, SEARCH_AI_SEARCH, - SERVERLESS_ES_SEARCH_SYNONYMS_ID, + ES_SEARCH_SYNONYMS_ID, } from './constants'; export type EnterpriseSearchApp = typeof ENTERPRISE_SEARCH_APP_ID; @@ -41,7 +41,7 @@ export type ConnectorsId = typeof SERVERLESS_ES_CONNECTORS_ID; export type ServerlessWebCrawlers = typeof SERVERLESS_ES_WEB_CRAWLERS_ID; export type SearchPlaygroundId = typeof ES_SEARCH_PLAYGROUND_ID; export type SearchInferenceEndpointsId = typeof SERVERLESS_ES_SEARCH_INFERENCE_ENDPOINTS_ID; -export type SearchSynonymsId = typeof SERVERLESS_ES_SEARCH_SYNONYMS_ID; +export type SearchSynonymsId = typeof ES_SEARCH_SYNONYMS_ID; export type SearchHomepage = typeof SEARCH_HOMEPAGE; export type SearchStart = typeof SEARCH_INDICES_START; export type SearchIndices = typeof SEARCH_INDICES; diff --git a/x-pack/plugins/search_synonyms/common/index.ts b/x-pack/plugins/search_synonyms/common/index.ts index a34bbadf6a787..31c4a7869f5e7 100644 --- a/x-pack/plugins/search_synonyms/common/index.ts +++ b/x-pack/plugins/search_synonyms/common/index.ts @@ -7,4 +7,3 @@ export const PLUGIN_ID = 'searchSynonyms'; export const PLUGIN_NAME = 'Synonyms'; -export const PLUGIN_PATH = '/synonyms'; diff --git a/x-pack/plugins/search_synonyms/common/types.ts b/x-pack/plugins/search_synonyms/common/types.ts index 31bcb54416888..90fc8bbe91a89 100644 --- a/x-pack/plugins/search_synonyms/common/types.ts +++ b/x-pack/plugins/search_synonyms/common/types.ts @@ -11,14 +11,9 @@ export interface SearchSynonymsPluginSetup {} // eslint-disable-next-line @typescript-eslint/no-empty-interface export interface SearchSynonymsPluginStart {} -// eslint-disable-next-line @typescript-eslint/no-empty-interface -export interface SearchSynonymsConfigType {} - // eslint-disable-next-line @typescript-eslint/no-empty-interface export interface AppPluginSetupDependencies {} export interface SearchSynonymsConfigType { - ui: { - enabled: boolean; - }; + enabled: boolean; } diff --git a/x-pack/plugins/search_synonyms/public/plugin.ts b/x-pack/plugins/search_synonyms/public/plugin.ts index 869b6025ea930..e345213e21587 100644 --- a/x-pack/plugins/search_synonyms/public/plugin.ts +++ b/x-pack/plugins/search_synonyms/public/plugin.ts @@ -5,19 +5,14 @@ * 2.0. */ -import { BehaviorSubject, type Subscription } from 'rxjs'; - -import { AppStatus } from '@kbn/core/public'; import type { - AppUpdater, CoreSetup, Plugin, PluginInitializerContext, AppMountParameters, - CoreStart, } from '@kbn/core/public'; import { i18n } from '@kbn/i18n'; -import { PLUGIN_ID, PLUGIN_NAME, PLUGIN_PATH } from '../common'; +import { PLUGIN_ID, PLUGIN_NAME } from '../common'; import { AppPluginSetupDependencies, AppPluginStartDependencies, @@ -31,9 +26,6 @@ export class SearchSynonymsPlugin implements Plugin { private config: SearchSynonymsConfigType; - private readonly appUpdater$ = new BehaviorSubject(() => ({})); - private licenseSubscription?: Subscription; - constructor(initializerContext: PluginInitializerContext) { this.config = initializerContext.config.get(); } @@ -42,7 +34,7 @@ export class SearchSynonymsPlugin core: CoreSetup, _: AppPluginSetupDependencies ): SearchSynonymsPluginSetup { - if (!this.config.ui?.enabled && !core.uiSettings.get(SYNONYMS_UI_FLAG, false)) { + if (!this.config.enabled || !core.uiSettings.get(SYNONYMS_UI_FLAG, false)) { return {}; } core.application.register({ @@ -52,15 +44,13 @@ export class SearchSynonymsPlugin deepLinks: [ { id: 'synonyms', - path: PLUGIN_PATH, + path: '/', title: i18n.translate('xpack.searchSynonyms.appTitle', { defaultMessage: 'Synonyms', }), visibleIn: ['globalSearch'], }, ], - status: AppStatus.inaccessible, - updater$: this.appUpdater$, async mount({ element, history }: AppMountParameters) { const { renderApp } = await import('./application'); const [coreStart, depsStart] = await core.getStartServices(); @@ -82,23 +72,9 @@ export class SearchSynonymsPlugin return {}; } - public start(_: CoreStart, deps: AppPluginStartDependencies): SearchSynonymsPluginStart { - const { licensing } = deps; - this.licenseSubscription = licensing.license$.subscribe((license) => { - const status: AppStatus = - license && license.isAvailable && license.isActive && license.hasAtLeast('enterprise') - ? AppStatus.accessible - : AppStatus.inaccessible; - - this.appUpdater$.next(() => ({ status })); - }); + public start(): SearchSynonymsPluginStart { return {}; } - public stop() { - if (this.licenseSubscription) { - this.licenseSubscription.unsubscribe(); - this.licenseSubscription = undefined; - } - } + public stop() {} } diff --git a/x-pack/plugins/search_synonyms/public/types.ts b/x-pack/plugins/search_synonyms/public/types.ts index 61192647081f0..d30d4fad2aacf 100644 --- a/x-pack/plugins/search_synonyms/public/types.ts +++ b/x-pack/plugins/search_synonyms/public/types.ts @@ -5,14 +5,12 @@ * 2.0. */ -import { LicensingPluginStart } from '@kbn/licensing-plugin/public'; import { SearchNavigationPluginStart } from '@kbn/search-navigation/public'; export * from '../common/types'; export interface AppPluginStartDependencies { history: AppMountParameters['history']; console?: ConsolePluginStart; - licensing: LicensingPluginStart; searchNavigation: SearchNavigationPluginStart; } import { AppMountParameters } from '@kbn/core/public'; diff --git a/x-pack/plugins/search_synonyms/server/config.ts b/x-pack/plugins/search_synonyms/server/config.ts index 5c48b3912019b..f1f151475fb50 100644 --- a/x-pack/plugins/search_synonyms/server/config.ts +++ b/x-pack/plugins/search_synonyms/server/config.ts @@ -9,17 +9,14 @@ import { schema, TypeOf } from '@kbn/config-schema'; import { PluginConfigDescriptor } from '@kbn/core/server'; const configSchema = schema.object({ - enabled: schema.boolean({ defaultValue: true }), - ui: schema.object({ - enabled: schema.boolean({ defaultValue: false }), - }), + enabled: schema.boolean({ defaultValue: false }), }); export type SearchPlaygroundConfig = TypeOf; export const config: PluginConfigDescriptor = { exposeToBrowser: { - ui: true, + enabled: true, }, schema: configSchema, }; diff --git a/x-pack/plugins/search_synonyms/server/plugin.ts b/x-pack/plugins/search_synonyms/server/plugin.ts index c6a9d4f63f7d2..0281c22d4e769 100644 --- a/x-pack/plugins/search_synonyms/server/plugin.ts +++ b/x-pack/plugins/search_synonyms/server/plugin.ts @@ -41,7 +41,6 @@ export class SearchSynonymsPlugin plugins.features.registerKibanaFeature({ id: PLUGIN_ID, - minimumLicense: 'enterprise', name: PLUGIN_NAME, order: 0, category: DEFAULT_APP_CATEGORIES.enterpriseSearch, @@ -51,21 +50,22 @@ export class SearchSynonymsPlugin privileges: { all: { app: ['kibana', PLUGIN_ID], - api: [], + api: ['synonyms:manage', 'synonyms:read'], catalogue: [PLUGIN_ID], savedObject: { all: [], read: [], }, - ui: [], + ui: ['read', 'save'], }, read: { - disabled: true, + app: ['kibana', PLUGIN_ID], + api: ['synonyms:read'], savedObject: { all: [], read: [], }, - ui: [], + ui: ['read'], }, }, }); diff --git a/x-pack/test_serverless/functional/test_suites/search/config.feature_flags.ts b/x-pack/test_serverless/functional/test_suites/search/config.feature_flags.ts index b7c818821d36c..538e575379f01 100644 --- a/x-pack/test_serverless/functional/test_suites/search/config.feature_flags.ts +++ b/x-pack/test_serverless/functional/test_suites/search/config.feature_flags.ts @@ -37,6 +37,9 @@ export default createTestConfig({ searchPlayground: { pathname: '/app/search_playground', }, + searchSynonyms: { + pathname: '/app/search_synonyms', + }, elasticsearchStart: { pathname: '/app/elasticsearch/start', }, From 807c206c23076479c74e26395745eee1a381dafb Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Mon, 23 Dec 2024 15:21:23 +0000 Subject: [PATCH 08/17] [CI] Auto-commit changed files from 'node scripts/lint_ts_projects --fix' --- x-pack/plugins/search_synonyms/tsconfig.json | 1 - 1 file changed, 1 deletion(-) diff --git a/x-pack/plugins/search_synonyms/tsconfig.json b/x-pack/plugins/search_synonyms/tsconfig.json index fd713cfa92ccf..281487212ad4d 100644 --- a/x-pack/plugins/search_synonyms/tsconfig.json +++ b/x-pack/plugins/search_synonyms/tsconfig.json @@ -20,7 +20,6 @@ "@kbn/console-plugin", "@kbn/features-plugin", "@kbn/search-navigation", - "@kbn/licensing-plugin" ], "exclude": [ "target/**/*", From 9bcf3773e58762344af0d7eb9f2170d40acca1d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Efe=20G=C3=BCrkan=20YALAMAN?= Date: Mon, 23 Dec 2024 19:18:50 +0100 Subject: [PATCH 09/17] Fix FTRs --- test/plugin_functional/test_suites/core_plugins/rendering.ts | 1 - x-pack/test/api_integration/apis/features/features/features.ts | 1 - x-pack/test/api_integration/apis/security/privileges.ts | 1 - x-pack/test/api_integration/apis/security/privileges_basic.ts | 1 - .../spaces_api_integration/spaces_only/telemetry/telemetry.ts | 1 - 5 files changed, 5 deletions(-) diff --git a/test/plugin_functional/test_suites/core_plugins/rendering.ts b/test/plugin_functional/test_suites/core_plugins/rendering.ts index b992072dac73b..1bda105ba07a6 100644 --- a/test/plugin_functional/test_suites/core_plugins/rendering.ts +++ b/test/plugin_functional/test_suites/core_plugins/rendering.ts @@ -329,7 +329,6 @@ export default function ({ getService }: PluginFunctionalProviderContext) { 'xpack.searchAssistant.ui.enabled (boolean?)', 'xpack.searchInferenceEndpoints.ui.enabled (boolean?)', 'xpack.searchPlayground.ui.enabled (boolean?)', - 'xpack.searchSynonyms.ui.enabled (boolean?)', 'xpack.security.loginAssistanceMessage (string?)', 'xpack.security.sameSiteCookies (Strict?|Lax?|None?)', 'xpack.security.showInsecureClusterWarning (boolean?)', diff --git a/x-pack/test/api_integration/apis/features/features/features.ts b/x-pack/test/api_integration/apis/features/features/features.ts index e0b1e48cbd5ba..4ca972549f0cb 100644 --- a/x-pack/test/api_integration/apis/features/features/features.ts +++ b/x-pack/test/api_integration/apis/features/features/features.ts @@ -131,7 +131,6 @@ export default function ({ getService }: FtrProviderContext) { 'rulesSettings', 'uptime', 'searchInferenceEndpoints', - 'searchSynonyms', 'searchPlayground', 'siem', 'slo', diff --git a/x-pack/test/api_integration/apis/security/privileges.ts b/x-pack/test/api_integration/apis/security/privileges.ts index 1daabb669ba18..bb00c34bc5808 100644 --- a/x-pack/test/api_integration/apis/security/privileges.ts +++ b/x-pack/test/api_integration/apis/security/privileges.ts @@ -62,7 +62,6 @@ export default function ({ getService }: FtrProviderContext) { slo: ['all', 'read', 'minimal_all', 'minimal_read'], searchPlayground: ['all', 'read', 'minimal_all', 'minimal_read'], searchInferenceEndpoints: ['all', 'read', 'minimal_all', 'minimal_read'], - searchSynonyms: ['all', 'read', 'minimal_all', 'minimal_read'], fleetv2: [ 'all', 'read', diff --git a/x-pack/test/api_integration/apis/security/privileges_basic.ts b/x-pack/test/api_integration/apis/security/privileges_basic.ts index 35a182d0ee74d..ccf4f2a4e0594 100644 --- a/x-pack/test/api_integration/apis/security/privileges_basic.ts +++ b/x-pack/test/api_integration/apis/security/privileges_basic.ts @@ -54,7 +54,6 @@ export default function ({ getService }: FtrProviderContext) { securitySolutionCasesV2: ['all', 'read', 'minimal_all', 'minimal_read'], searchPlayground: ['all', 'read', 'minimal_all', 'minimal_read'], searchInferenceEndpoints: ['all', 'read', 'minimal_all', 'minimal_read'], - searchSynonyms: ['all', 'read', 'minimal_all', 'minimal_read'], fleetv2: ['all', 'read', 'minimal_all', 'minimal_read'], fleet: ['all', 'read', 'minimal_all', 'minimal_read'], stackAlerts: ['all', 'read', 'minimal_all', 'minimal_read'], diff --git a/x-pack/test/spaces_api_integration/spaces_only/telemetry/telemetry.ts b/x-pack/test/spaces_api_integration/spaces_only/telemetry/telemetry.ts index b934e9b3333cd..1af3b0e593e06 100644 --- a/x-pack/test/spaces_api_integration/spaces_only/telemetry/telemetry.ts +++ b/x-pack/test/spaces_api_integration/spaces_only/telemetry/telemetry.ts @@ -86,7 +86,6 @@ export default function ({ getService }: FtrProviderContext) { enterpriseSearchApplications: 0, enterpriseSearchAnalytics: 0, searchInferenceEndpoints: 0, - searchSynonyms: 0, searchPlayground: 0, siem: 0, securitySolutionCases: 0, From e43981a337e11ffeeddaa44fe36044794db62372 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Efe=20G=C3=BCrkan=20YALAMAN?= Date: Mon, 23 Dec 2024 20:52:37 +0100 Subject: [PATCH 10/17] Fix privilege FTR --- x-pack/test/api_integration/apis/security/privileges_basic.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/x-pack/test/api_integration/apis/security/privileges_basic.ts b/x-pack/test/api_integration/apis/security/privileges_basic.ts index ccf4f2a4e0594..a7b8ee3fd2091 100644 --- a/x-pack/test/api_integration/apis/security/privileges_basic.ts +++ b/x-pack/test/api_integration/apis/security/privileges_basic.ts @@ -151,7 +151,6 @@ export default function ({ getService }: FtrProviderContext) { slo: ['all', 'read', 'minimal_all', 'minimal_read'], searchPlayground: ['all', 'read', 'minimal_all', 'minimal_read'], searchInferenceEndpoints: ['all', 'read', 'minimal_all', 'minimal_read'], - searchSynonyms: ['all', 'read', 'minimal_all', 'minimal_read'], fleetv2: [ 'agent_policies_all', 'agent_policies_read', From 4097ac57d40180512ed7a3f5e3ca3ddd99f0ff65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Efe=20G=C3=BCrkan=20YALAMAN?= Date: Thu, 2 Jan 2025 16:44:36 +0100 Subject: [PATCH 11/17] Rebase and review changes --- config/serverless.es.yml | 4 --- config/serverless.oblt.yml | 1 - config/serverless.security.yml | 1 - config/serverless.yml | 1 + package.json | 2 +- tsconfig.base.json | 4 +-- .../search}/plugins/search_synonyms/README.md | 0 .../plugins/search_synonyms/common/index.ts | 15 +++++++++++ .../plugins/search_synonyms/common/types.ts | 0 .../search_synonyms/common/ui_flags.ts} | 3 +-- .../plugins/search_synonyms/jest.config.js | 0 .../plugins/search_synonyms/kibana.jsonc | 3 --- .../search_synonyms/public/application.tsx | 0 .../plugins/search_synonyms/public/index.ts | 2 -- .../plugins/search_synonyms/public/plugin.ts | 26 +++++-------------- .../plugins/search_synonyms/public/types.ts | 8 +++--- .../plugins/search_synonyms/server/config.ts | 3 --- .../plugins/search_synonyms/server/index.ts | 0 .../plugins/search_synonyms/server/plugin.ts | 5 ++-- .../plugins/search_synonyms/server/routes.ts | 0 .../plugins/search_synonyms/server/types.ts | 0 .../plugins/search_synonyms/tsconfig.json | 0 .../search/config.feature_flags.ts | 2 +- yarn.lock | 2 +- 24 files changed, 35 insertions(+), 47 deletions(-) rename x-pack/{ => solutions/search}/plugins/search_synonyms/README.md (100%) create mode 100644 x-pack/solutions/search/plugins/search_synonyms/common/index.ts rename x-pack/{ => solutions/search}/plugins/search_synonyms/common/types.ts (100%) rename x-pack/{plugins/search_synonyms/common/index.ts => solutions/search/plugins/search_synonyms/common/ui_flags.ts} (75%) rename x-pack/{ => solutions/search}/plugins/search_synonyms/jest.config.js (100%) rename x-pack/{ => solutions/search}/plugins/search_synonyms/kibana.jsonc (88%) rename x-pack/{ => solutions/search}/plugins/search_synonyms/public/application.tsx (100%) rename x-pack/{ => solutions/search}/plugins/search_synonyms/public/index.ts (88%) rename x-pack/{ => solutions/search}/plugins/search_synonyms/public/plugin.ts (69%) rename x-pack/{ => solutions/search}/plugins/search_synonyms/public/types.ts (92%) rename x-pack/{ => solutions/search}/plugins/search_synonyms/server/config.ts (93%) rename x-pack/{ => solutions/search}/plugins/search_synonyms/server/index.ts (100%) rename x-pack/{ => solutions/search}/plugins/search_synonyms/server/plugin.ts (93%) rename x-pack/{ => solutions/search}/plugins/search_synonyms/server/routes.ts (100%) rename x-pack/{ => solutions/search}/plugins/search_synonyms/server/types.ts (100%) rename x-pack/{ => solutions/search}/plugins/search_synonyms/tsconfig.json (100%) diff --git a/config/serverless.es.yml b/config/serverless.es.yml index c715c748bb38a..2d5ba84ece795 100644 --- a/config/serverless.es.yml +++ b/config/serverless.es.yml @@ -132,7 +132,3 @@ aiAssistantManagementSelection.preferredAIAssistantType: "observability" xpack.observabilityAiAssistantManagement.logSourcesEnabled: false xpack.observabilityAiAssistantManagement.spacesEnabled: false xpack.observabilityAiAssistantManagement.visibilityEnabled: false - - -# Synonyms UI -xpack.searchSynonyms.enabled: false diff --git a/config/serverless.oblt.yml b/config/serverless.oblt.yml index 234646984a9ee..937954a1c5e84 100644 --- a/config/serverless.oblt.yml +++ b/config/serverless.oblt.yml @@ -9,7 +9,6 @@ xpack.securitySolution.enabled: false xpack.search.notebooks.enabled: false xpack.searchPlayground.enabled: false xpack.searchInferenceEndpoints.enabled: false -xpack.searchSynonyms.enabled: false ## Fine-tune the observability solution feature privileges. Also, refer to `serverless.yml` for the project-agnostic overrides. xpack.features.overrides: diff --git a/config/serverless.security.yml b/config/serverless.security.yml index fc0f29b92c127..0e3a0c92f8546 100644 --- a/config/serverless.security.yml +++ b/config/serverless.security.yml @@ -11,7 +11,6 @@ xpack.search.notebooks.enabled: false xpack.searchPlayground.enabled: false xpack.searchInferenceEndpoints.enabled: false xpack.inventory.enabled: false -xpack.searchSynonyms.enabled: false ## Fine-tune the security solution feature privileges. Also, refer to `serverless.yml` for the project-agnostic overrides. xpack.features.overrides: diff --git a/config/serverless.yml b/config/serverless.yml index 6c7125d0e47f0..e7629c5053fa4 100644 --- a/config/serverless.yml +++ b/config/serverless.yml @@ -8,6 +8,7 @@ xpack.fleet.internal.activeAgentsSoftLimit: 25000 xpack.fleet.internal.onlyAllowAgentUpgradeToKnownVersions: true xpack.fleet.internal.retrySetupOnBoot: true xpack.fleet.internal.useMeteringApi: true +xpack.searchSynonyms.enabled: false ## Fine-tune the feature privileges. xpack.features.overrides: diff --git a/package.json b/package.json index 5c9ef25d34453..bec230d6af21e 100644 --- a/package.json +++ b/package.json @@ -815,7 +815,7 @@ "@kbn/search-playground": "link:x-pack/solutions/search/plugins/search_playground", "@kbn/search-response-warnings": "link:src/platform/packages/shared/kbn-search-response-warnings", "@kbn/search-shared-ui": "link:x-pack/solutions/search/packages/search/shared_ui", - "@kbn/search-synonyms": "link:x-pack/plugins/search_synonyms", + "@kbn/search-synonyms": "link:x-pack/solutions/search/plugins/search_synonyms", "@kbn/search-types": "link:src/platform/packages/shared/kbn-search-types", "@kbn/searchprofiler-plugin": "link:x-pack/platform/plugins/shared/searchprofiler", "@kbn/security-api-key-management": "link:x-pack/packages/security/api_key_management", diff --git a/tsconfig.base.json b/tsconfig.base.json index 8ea45bdf44584..99413e8dae882 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -1606,8 +1606,8 @@ "@kbn/search-response-warnings/*": ["src/platform/packages/shared/kbn-search-response-warnings/*"], "@kbn/search-shared-ui": ["x-pack/solutions/search/packages/search/shared_ui"], "@kbn/search-shared-ui/*": ["x-pack/solutions/search/packages/search/shared_ui/*"], - "@kbn/search-synonyms": ["x-pack/plugins/search_synonyms"], - "@kbn/search-synonyms/*": ["x-pack/plugins/search_synonyms/*"], + "@kbn/search-synonyms": ["x-pack/solutions/search/plugins/search_synonyms"], + "@kbn/search-synonyms/*": ["x-pack/solutions/search/plugins/search_synonyms/*"], "@kbn/search-types": ["src/platform/packages/shared/kbn-search-types"], "@kbn/search-types/*": ["src/platform/packages/shared/kbn-search-types/*"], "@kbn/searchprofiler-plugin": ["x-pack/platform/plugins/shared/searchprofiler"], diff --git a/x-pack/plugins/search_synonyms/README.md b/x-pack/solutions/search/plugins/search_synonyms/README.md similarity index 100% rename from x-pack/plugins/search_synonyms/README.md rename to x-pack/solutions/search/plugins/search_synonyms/README.md diff --git a/x-pack/solutions/search/plugins/search_synonyms/common/index.ts b/x-pack/solutions/search/plugins/search_synonyms/common/index.ts new file mode 100644 index 0000000000000..2ab4629a71e7e --- /dev/null +++ b/x-pack/solutions/search/plugins/search_synonyms/common/index.ts @@ -0,0 +1,15 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { i18n } from '@kbn/i18n'; + +export const PLUGIN_ID = 'searchSynonyms'; +export const PLUGIN_NAME = 'Synonyms'; + +export const PLUGIN_TITLE = i18n.translate('xpack.searchSynonyms.pluginTitle', { + defaultMessage: 'Synonyms', +}); diff --git a/x-pack/plugins/search_synonyms/common/types.ts b/x-pack/solutions/search/plugins/search_synonyms/common/types.ts similarity index 100% rename from x-pack/plugins/search_synonyms/common/types.ts rename to x-pack/solutions/search/plugins/search_synonyms/common/types.ts diff --git a/x-pack/plugins/search_synonyms/common/index.ts b/x-pack/solutions/search/plugins/search_synonyms/common/ui_flags.ts similarity index 75% rename from x-pack/plugins/search_synonyms/common/index.ts rename to x-pack/solutions/search/plugins/search_synonyms/common/ui_flags.ts index 31c4a7869f5e7..0fd2aa78bed48 100644 --- a/x-pack/plugins/search_synonyms/common/index.ts +++ b/x-pack/solutions/search/plugins/search_synonyms/common/ui_flags.ts @@ -5,5 +5,4 @@ * 2.0. */ -export const PLUGIN_ID = 'searchSynonyms'; -export const PLUGIN_NAME = 'Synonyms'; +export const SYNONYMS_UI_FLAG = 'searchSynonyms:synonymsEnabled'; diff --git a/x-pack/plugins/search_synonyms/jest.config.js b/x-pack/solutions/search/plugins/search_synonyms/jest.config.js similarity index 100% rename from x-pack/plugins/search_synonyms/jest.config.js rename to x-pack/solutions/search/plugins/search_synonyms/jest.config.js diff --git a/x-pack/plugins/search_synonyms/kibana.jsonc b/x-pack/solutions/search/plugins/search_synonyms/kibana.jsonc similarity index 88% rename from x-pack/plugins/search_synonyms/kibana.jsonc rename to x-pack/solutions/search/plugins/search_synonyms/kibana.jsonc index 26d5ac84de49f..434936655b317 100644 --- a/x-pack/plugins/search_synonyms/kibana.jsonc +++ b/x-pack/solutions/search/plugins/search_synonyms/kibana.jsonc @@ -13,13 +13,10 @@ "searchSynonyms" ], "requiredPlugins": [ - "licensing", "features", ], "optionalPlugins": [ - "cloud", "console", - "usageCollection", "searchNavigation", ], "requiredBundles": [ diff --git a/x-pack/plugins/search_synonyms/public/application.tsx b/x-pack/solutions/search/plugins/search_synonyms/public/application.tsx similarity index 100% rename from x-pack/plugins/search_synonyms/public/application.tsx rename to x-pack/solutions/search/plugins/search_synonyms/public/application.tsx diff --git a/x-pack/plugins/search_synonyms/public/index.ts b/x-pack/solutions/search/plugins/search_synonyms/public/index.ts similarity index 88% rename from x-pack/plugins/search_synonyms/public/index.ts rename to x-pack/solutions/search/plugins/search_synonyms/public/index.ts index 4e1d1ab027e03..fea6fd2060348 100644 --- a/x-pack/plugins/search_synonyms/public/index.ts +++ b/x-pack/solutions/search/plugins/search_synonyms/public/index.ts @@ -12,5 +12,3 @@ import { SearchSynonymsPlugin } from './plugin'; export function plugin(initializerContext: PluginInitializerContext) { return new SearchSynonymsPlugin(initializerContext); } - -export const SYNONYMS_UI_FLAG = 'searchSynonyms:synonymsEnabled'; diff --git a/x-pack/plugins/search_synonyms/public/plugin.ts b/x-pack/solutions/search/plugins/search_synonyms/public/plugin.ts similarity index 69% rename from x-pack/plugins/search_synonyms/public/plugin.ts rename to x-pack/solutions/search/plugins/search_synonyms/public/plugin.ts index e345213e21587..c6762d8b545c3 100644 --- a/x-pack/plugins/search_synonyms/public/plugin.ts +++ b/x-pack/solutions/search/plugins/search_synonyms/public/plugin.ts @@ -5,49 +5,37 @@ * 2.0. */ -import type { - CoreSetup, - Plugin, - PluginInitializerContext, - AppMountParameters, -} from '@kbn/core/public'; -import { i18n } from '@kbn/i18n'; -import { PLUGIN_ID, PLUGIN_NAME } from '../common'; +import type { CoreSetup, Plugin, AppMountParameters } from '@kbn/core/public'; +import { PLUGIN_ID, PLUGIN_NAME, PLUGIN_TITLE } from '../common'; import { AppPluginSetupDependencies, AppPluginStartDependencies, - SearchSynonymsConfigType, SearchSynonymsPluginSetup, SearchSynonymsPluginStart, } from './types'; -import { SYNONYMS_UI_FLAG } from '.'; +import { SYNONYMS_UI_FLAG } from '../common/ui_flags'; export class SearchSynonymsPlugin implements Plugin { - private config: SearchSynonymsConfigType; - constructor(initializerContext: PluginInitializerContext) { - this.config = initializerContext.config.get(); - } + constructor() {} public setup( core: CoreSetup, _: AppPluginSetupDependencies ): SearchSynonymsPluginSetup { - if (!this.config.enabled || !core.uiSettings.get(SYNONYMS_UI_FLAG, false)) { + if (!core.settings.client.get(SYNONYMS_UI_FLAG, false)) { return {}; } core.application.register({ id: PLUGIN_ID, appRoute: '/app/elasticsearch/synonyms', - title: PLUGIN_NAME, + title: PLUGIN_TITLE, deepLinks: [ { id: 'synonyms', path: '/', - title: i18n.translate('xpack.searchSynonyms.appTitle', { - defaultMessage: 'Synonyms', - }), + title: PLUGIN_TITLE, visibleIn: ['globalSearch'], }, ], diff --git a/x-pack/plugins/search_synonyms/public/types.ts b/x-pack/solutions/search/plugins/search_synonyms/public/types.ts similarity index 92% rename from x-pack/plugins/search_synonyms/public/types.ts rename to x-pack/solutions/search/plugins/search_synonyms/public/types.ts index d30d4fad2aacf..eec1ad13ade6c 100644 --- a/x-pack/plugins/search_synonyms/public/types.ts +++ b/x-pack/solutions/search/plugins/search_synonyms/public/types.ts @@ -6,12 +6,12 @@ */ import { SearchNavigationPluginStart } from '@kbn/search-navigation/public'; -export * from '../common/types'; +import { AppMountParameters } from '@kbn/core/public'; +import type { ConsolePluginStart } from '@kbn/console-plugin/public'; +export * from '../common/types'; export interface AppPluginStartDependencies { history: AppMountParameters['history']; console?: ConsolePluginStart; - searchNavigation: SearchNavigationPluginStart; + searchNavigation?: SearchNavigationPluginStart; } -import { AppMountParameters } from '@kbn/core/public'; -import type { ConsolePluginStart } from '@kbn/console-plugin/public'; diff --git a/x-pack/plugins/search_synonyms/server/config.ts b/x-pack/solutions/search/plugins/search_synonyms/server/config.ts similarity index 93% rename from x-pack/plugins/search_synonyms/server/config.ts rename to x-pack/solutions/search/plugins/search_synonyms/server/config.ts index f1f151475fb50..b76d647a692be 100644 --- a/x-pack/plugins/search_synonyms/server/config.ts +++ b/x-pack/solutions/search/plugins/search_synonyms/server/config.ts @@ -15,8 +15,5 @@ const configSchema = schema.object({ export type SearchPlaygroundConfig = TypeOf; export const config: PluginConfigDescriptor = { - exposeToBrowser: { - enabled: true, - }, schema: configSchema, }; diff --git a/x-pack/plugins/search_synonyms/server/index.ts b/x-pack/solutions/search/plugins/search_synonyms/server/index.ts similarity index 100% rename from x-pack/plugins/search_synonyms/server/index.ts rename to x-pack/solutions/search/plugins/search_synonyms/server/index.ts diff --git a/x-pack/plugins/search_synonyms/server/plugin.ts b/x-pack/solutions/search/plugins/search_synonyms/server/plugin.ts similarity index 93% rename from x-pack/plugins/search_synonyms/server/plugin.ts rename to x-pack/solutions/search/plugins/search_synonyms/server/plugin.ts index 0281c22d4e769..5e07a6ae80d3d 100644 --- a/x-pack/plugins/search_synonyms/server/plugin.ts +++ b/x-pack/solutions/search/plugins/search_synonyms/server/plugin.ts @@ -22,7 +22,7 @@ import { } from './types'; import { defineRoutes } from './routes'; -import { PLUGIN_ID, PLUGIN_NAME } from '../common'; +import { PLUGIN_ID, PLUGIN_TITLE } from '../common'; export class SearchSynonymsPlugin implements Plugin @@ -34,14 +34,13 @@ export class SearchSynonymsPlugin } public setup(core: CoreSetup, plugins: SearchSynonymsPluginSetupDependencies) { - this.logger.debug('searchSynonyms: Setup'); const router = core.http.createRouter(); defineRoutes({ router, logger: this.logger }); plugins.features.registerKibanaFeature({ id: PLUGIN_ID, - name: PLUGIN_NAME, + name: PLUGIN_TITLE, order: 0, category: DEFAULT_APP_CATEGORIES.enterpriseSearch, app: ['kibana', PLUGIN_ID], diff --git a/x-pack/plugins/search_synonyms/server/routes.ts b/x-pack/solutions/search/plugins/search_synonyms/server/routes.ts similarity index 100% rename from x-pack/plugins/search_synonyms/server/routes.ts rename to x-pack/solutions/search/plugins/search_synonyms/server/routes.ts diff --git a/x-pack/plugins/search_synonyms/server/types.ts b/x-pack/solutions/search/plugins/search_synonyms/server/types.ts similarity index 100% rename from x-pack/plugins/search_synonyms/server/types.ts rename to x-pack/solutions/search/plugins/search_synonyms/server/types.ts diff --git a/x-pack/plugins/search_synonyms/tsconfig.json b/x-pack/solutions/search/plugins/search_synonyms/tsconfig.json similarity index 100% rename from x-pack/plugins/search_synonyms/tsconfig.json rename to x-pack/solutions/search/plugins/search_synonyms/tsconfig.json diff --git a/x-pack/test_serverless/functional/test_suites/search/config.feature_flags.ts b/x-pack/test_serverless/functional/test_suites/search/config.feature_flags.ts index 538e575379f01..d56bd086180d2 100644 --- a/x-pack/test_serverless/functional/test_suites/search/config.feature_flags.ts +++ b/x-pack/test_serverless/functional/test_suites/search/config.feature_flags.ts @@ -38,7 +38,7 @@ export default createTestConfig({ pathname: '/app/search_playground', }, searchSynonyms: { - pathname: '/app/search_synonyms', + pathname: '/app/elasticsearch/search_synonyms', }, elasticsearchStart: { pathname: '/app/elasticsearch/start', diff --git a/yarn.lock b/yarn.lock index 8ba5fe6f97542..d7b954c03b2b5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7029,7 +7029,7 @@ version "0.0.0" uid "" -"@kbn/search-synonyms@link:x-pack/plugins/search_synonyms": +"@kbn/search-synonyms@link:x-pack/solutions/search/plugins/search_synonyms": version "0.0.0" uid "" From eeefab0a39e3ab5fe1083f62093dd0fb86649835 Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Thu, 2 Jan 2025 15:54:17 +0000 Subject: [PATCH 12/17] [CI] Auto-commit changed files from 'node scripts/generate codeowners' --- .github/CODEOWNERS | 1 + docs/developer/plugin-list.asciidoc | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 9aff023ae99f6..8d42a98512a62 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -962,6 +962,7 @@ x-pack/solutions/search/plugins/search_inference_endpoints @elastic/search-kiban x-pack/solutions/search/plugins/search_notebooks @elastic/search-kibana x-pack/solutions/search/plugins/search_playground @elastic/search-kibana x-pack/solutions/search/plugins/search_solution/search_navigation @elastic/search-kibana +x-pack/solutions/search/plugins/search_synonyms @elastic/search-kibana x-pack/solutions/search/plugins/serverless_search @elastic/search-kibana x-pack/solutions/security/packages/data_table @elastic/security-threat-hunting-investigations x-pack/solutions/security/packages/data-stream-adapter @elastic/security-threat-hunting diff --git a/docs/developer/plugin-list.asciidoc b/docs/developer/plugin-list.asciidoc index f15993b6624e3..91d407f8f17db 100644 --- a/docs/developer/plugin-list.asciidoc +++ b/docs/developer/plugin-list.asciidoc @@ -856,7 +856,7 @@ detailed information on how Elasticsearch executed the search request. People us to understand why a search request might be slow. -|{kib-repo}blob/{branch}/x-pack/plugins/search_synonyms/README.md[searchSynonyms] +|{kib-repo}blob/{branch}/x-pack/solutions/search/plugins/search_synonyms/README.md[searchSynonyms] |A plugin to manage synonyms in Elasticsearch through Synonyms APIs through Kibana. From 1a609dfa1ea3d63340d1c8ca85928de62965d483 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Efe=20G=C3=BCrkan=20YALAMAN?= Date: Thu, 2 Jan 2025 16:56:03 +0100 Subject: [PATCH 13/17] Update tsconfig base path --- x-pack/solutions/search/plugins/search_synonyms/tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/solutions/search/plugins/search_synonyms/tsconfig.json b/x-pack/solutions/search/plugins/search_synonyms/tsconfig.json index 281487212ad4d..f8af8bac5e3d3 100644 --- a/x-pack/solutions/search/plugins/search_synonyms/tsconfig.json +++ b/x-pack/solutions/search/plugins/search_synonyms/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../../../tsconfig.base.json", "compilerOptions": { "outDir": "target/types", }, From cafd72232c2d9af5173b41098167ae66ea50f4ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Efe=20G=C3=BCrkan=20YALAMAN?= Date: Thu, 2 Jan 2025 18:54:41 +0100 Subject: [PATCH 14/17] Fix types --- .../search/plugins/search_synonyms/public/index.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/x-pack/solutions/search/plugins/search_synonyms/public/index.ts b/x-pack/solutions/search/plugins/search_synonyms/public/index.ts index fea6fd2060348..254e3206ef64b 100644 --- a/x-pack/solutions/search/plugins/search_synonyms/public/index.ts +++ b/x-pack/solutions/search/plugins/search_synonyms/public/index.ts @@ -5,10 +5,8 @@ * 2.0. */ -import { PluginInitializerContext } from '@kbn/core/public'; - import { SearchSynonymsPlugin } from './plugin'; -export function plugin(initializerContext: PluginInitializerContext) { - return new SearchSynonymsPlugin(initializerContext); +export function plugin() { + return new SearchSynonymsPlugin(); } From c32620e4bb28d6942604551206442e3e275598ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Efe=20G=C3=BCrkan=20YALAMAN?= Date: Thu, 2 Jan 2025 22:04:57 +0100 Subject: [PATCH 15/17] Fix checks --- .../search/plugins/search_synonyms/jest.config.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/x-pack/solutions/search/plugins/search_synonyms/jest.config.js b/x-pack/solutions/search/plugins/search_synonyms/jest.config.js index 5dc5e60c49cfe..0f2b06ee0fb16 100644 --- a/x-pack/solutions/search/plugins/search_synonyms/jest.config.js +++ b/x-pack/solutions/search/plugins/search_synonyms/jest.config.js @@ -7,9 +7,11 @@ module.exports = { preset: '@kbn/test', - rootDir: '../../..', - roots: ['/x-pack/plugins/search_synonyms'], + rootDir: '../../../../..', + roots: ['/x-pack/solutions/search/plugins/search_synonyms'], coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/search_synonyms', coverageReporters: ['text', 'html'], - collectCoverageFrom: ['/x-pack/plugins/search_synonyms/{public,server}/**/*.{ts,tsx}'], + collectCoverageFrom: [ + '/x-pack/solutions/search/plugins/search_synonyms/{public,server}/**/*.{ts,tsx}', + ], }; From b5b5df3f0ceda8328a080e522bfd559ac4a550ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Efe=20G=C3=BCrkan=20YALAMAN?= Date: Mon, 6 Jan 2025 10:26:57 +0100 Subject: [PATCH 16/17] Remove wrongfully added lines due to merge conflict --- .github/CODEOWNERS | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 825f3b78ab685..20c1749b15087 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -3306,22 +3306,6 @@ x-pack/solutions/observability/plugins/streams_app @elastic/streams-program-team x-pack/solutions/observability/plugins/synthetics @elastic/obs-ux-management-team x-pack/solutions/observability/plugins/uptime @elastic/obs-ux-management-team x-pack/solutions/observability/plugins/ux @elastic/obs-ux-infra_services-team -x-pack/solutions/search/x-pack/solutions/search/packages/kbn-ipynb @elastic/search-kibana -x-pack/solutions/search/x-pack/solutions/search/packages/kbn-search-api-keys-components @elastic/search-kibana -x-pack/solutions/search/x-pack/solutions/search/packages/kbn-search-api-keys-server @elastic/search-kibana -x-pack/solutions/search/x-pack/solutions/search/packages/kbn-search-index-documents @elastic/search-kibana -x-pack/solutions/search/solutions/search/packages/search/shared_ui @elastic/search-kibana -x-pack/solutions/search/solutions/search/plugins/enterprise_search @elastic/search-kibana -x-pack/solutions/search/solutions/search/plugins/search_assistant @elastic/search-kibana -x-pack/solutions/search/solutions/search/plugins/search_connectors @elastic/search-kibana -x-pack/solutions/search/solutions/search/plugins/search_homepage @elastic/search-kibana -x-pack/solutions/search/solutions/search/plugins/search_indices @elastic/search-kibana -x-pack/solutions/search/solutions/search/plugins/search_inference_endpoints @elastic/search-kibana -x-pack/solutions/search/solutions/search/plugins/search_notebooks @elastic/search-kibana -x-pack/solutions/search/solutions/search/plugins/search_playground @elastic/search-kibana -x-pack/solutions/search/solutions/search/plugins/search_synonyms @elastic/search-kibana -x-pack/solutions/search/solutions/search/plugins/search_solution/search_navigation @elastic/search-kibana -x-pack/solutions/search/solutions/search/plugins/serverless_search @elastic/search-kibana x-pack/solutions/security/packages/data_table @elastic/security-threat-hunting-investigations x-pack/solutions/security/packages/ecs_data_quality_dashboard @elastic/security-threat-hunting-explore x-pack/solutions/security/packages/features @elastic/security-threat-hunting-explore From 2e4e87f654855ab9df48149f6dbe7fabf664ee5f Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Mon, 6 Jan 2025 09:36:20 +0000 Subject: [PATCH 17/17] [CI] Auto-commit changed files from 'node scripts/build_plugin_list_docs' --- docs/developer/plugin-list.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/developer/plugin-list.asciidoc b/docs/developer/plugin-list.asciidoc index 70b95a0618d1e..af970f58432b3 100644 --- a/docs/developer/plugin-list.asciidoc +++ b/docs/developer/plugin-list.asciidoc @@ -989,4 +989,4 @@ include::{kibana-root}/src/plugins/expressions/README.asciidoc[leveloffset=+1] include::{kibana-root}/src/platform/plugins/shared/ui_actions/README.asciidoc[leveloffset=+1] include::{kibana-root}/x-pack/platform/plugins/shared/dashboard_enhanced/README.asciidoc[leveloffset=+1] include::{kibana-root}/x-pack/platform/plugins/shared/embeddable_enhanced/README.asciidoc[leveloffset=+1] -include::{kibana-root}/x-pack/platform/plugins/private/translations/README.asciidoc[leveloffset=+1] \ No newline at end of file +include::{kibana-root}/x-pack/platform/plugins/private/translations/README.asciidoc[leveloffset=+1]