Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Search] search_indices: scaffold empty plugin #190748

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,7 @@ packages/kbn-search-errors @elastic/kibana-data-discovery
examples/search_examples @elastic/kibana-data-discovery
x-pack/plugins/search_homepage @elastic/search-kibana
packages/kbn-search-index-documents @elastic/search-kibana
x-pack/plugins/search_indices @elastic/search-kibana
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
Expand Down
4 changes: 4 additions & 0 deletions docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,10 @@ It uses Chromium and Puppeteer underneath to run the browser in headless mode.
|The Search Homepage is a shared homepage for elasticsearch users.


|{kib-repo}blob/{branch}/x-pack/plugins/search_indices/README.mdx[searchIndices]
|The Search Indices plugin is a shared set of pages for elasticsearch users across stack and serverless search solutions.


|{kib-repo}blob/{branch}/x-pack/plugins/search_inference_endpoints/README.md[searchInferenceEndpoints]
|The Inference Endpoints is a tool used to manage inference endpoints

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,7 @@
"@kbn/search-examples-plugin": "link:examples/search_examples",
"@kbn/search-homepage": "link:x-pack/plugins/search_homepage",
"@kbn/search-index-documents": "link:packages/kbn-search-index-documents",
"@kbn/search-indices": "link:x-pack/plugins/search_indices",
"@kbn/search-inference-endpoints": "link:x-pack/plugins/search_inference_endpoints",
"@kbn/search-notebooks": "link:x-pack/plugins/search_notebooks",
"@kbn/search-playground": "link:x-pack/plugins/search_playground",
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-optimizer/limits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ pageLoadAssetSize:
searchAssistant: 19831
searchConnectors: 30000
searchHomepage: 19831
searchIndices: 20519
searchInferenceEndpoints: 20470
searchNotebooks: 18942
searchPlayground: 19325
Expand Down
2 changes: 2 additions & 0 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -1474,6 +1474,8 @@
"@kbn/search-homepage/*": ["x-pack/plugins/search_homepage/*"],
"@kbn/search-index-documents": ["packages/kbn-search-index-documents"],
"@kbn/search-index-documents/*": ["packages/kbn-search-index-documents/*"],
"@kbn/search-indices": ["x-pack/plugins/search_indices"],
"@kbn/search-indices/*": ["x-pack/plugins/search_indices/*"],
"@kbn/search-inference-endpoints": ["x-pack/plugins/search_inference_endpoints"],
"@kbn/search-inference-endpoints/*": ["x-pack/plugins/search_inference_endpoints/*"],
"@kbn/search-notebooks": ["x-pack/plugins/search_notebooks"],
Expand Down
1 change: 1 addition & 0 deletions x-pack/.i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
"xpack.runtimeFields": "plugins/runtime_fields",
"xpack.screenshotting": "plugins/screenshotting",
"xpack.searchHomepage": "plugins/search_homepage",
"xpack.searchIndices": "plugins/search_indices",
"xpack.searchNotebooks": "plugins/search_notebooks",
"xpack.searchPlayground": "plugins/search_playground",
"xpack.searchInferenceEndpoints": "plugins/search_inference_endpoints",
Expand Down
3 changes: 3 additions & 0 deletions x-pack/plugins/search_indices/README.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Search Indices

The Search Indices plugin is a shared set of pages for elasticsearch users across stack and serverless search solutions.
9 changes: 9 additions & 0 deletions x-pack/plugins/search_indices/common/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* 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 = 'searchIndices';
export const PLUGIN_NAME = 'searchIndices';
15 changes: 15 additions & 0 deletions x-pack/plugins/search_indices/jest.config.js
Original file line number Diff line number Diff line change
@@ -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: ['<rootDir>/x-pack/plugins/search_indices'],
coverageDirectory: '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/search_indices',
coverageReporters: ['text', 'html'],
collectCoverageFrom: ['<rootDir>/x-pack/plugins/search_indices/{public,server}/**/*.{ts,tsx}'],
};
23 changes: 23 additions & 0 deletions x-pack/plugins/search_indices/kibana.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"type": "plugin",
"id": "@kbn/search-indices",
"owner": "@elastic/search-kibana",
"plugin": {
"id": "searchIndices",
"server": true,
"browser": true,
"configPath": [
"xpack",
"searchIndices"
],
"requiredPlugins": [
"share",
],
"optionalPlugins": [
"cloud",
"console",
"usageCollection",
],
"requiredBundles": []
}
}
15 changes: 15 additions & 0 deletions x-pack/plugins/search_indices/public/index.ts
Original file line number Diff line number Diff line change
@@ -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 { SearchIndicesPlugin } from './plugin';

// This exports static code and TypeScript types,
// as well as, Kibana Platform `plugin()` initializer.
export function plugin() {
return new SearchIndicesPlugin();
}
export type { SearchIndicesPluginSetup, SearchIndicesPluginStart } from './types';
23 changes: 23 additions & 0 deletions x-pack/plugins/search_indices/public/plugin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* 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, CoreStart, Plugin } from '@kbn/core/public';
import type { SearchIndicesPluginSetup, SearchIndicesPluginStart } from './types';

export class SearchIndicesPlugin
implements Plugin<SearchIndicesPluginSetup, SearchIndicesPluginStart>
{
public setup(core: CoreSetup): SearchIndicesPluginSetup {
return {};
}

public start(core: CoreStart): SearchIndicesPluginStart {
return {};
}

public stop() {}
}
17 changes: 17 additions & 0 deletions x-pack/plugins/search_indices/public/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* 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 { NavigationPublicPluginStart } from '@kbn/navigation-plugin/public';

// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface SearchIndicesPluginSetup {}
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface SearchIndicesPluginStart {}

export interface AppPluginStartDependencies {
navigation: NavigationPublicPluginStart;
}
19 changes: 19 additions & 0 deletions x-pack/plugins/search_indices/server/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* 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: false }),
});

export type SearchIndicesConfig = TypeOf<typeof configSchema>;

export const config: PluginConfigDescriptor<SearchIndicesConfig> = {
schema: configSchema,
};
17 changes: 17 additions & 0 deletions x-pack/plugins/search_indices/server/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* 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 { PluginInitializerContext } from '@kbn/core/server';

export { config } from './config';

export async function plugin(initializerContext: PluginInitializerContext) {
const { SearchIndicesPlugin } = await import('./plugin');
return new SearchIndicesPlugin(initializerContext);
}

export type { SearchIndicesPluginSetup, SearchIndicesPluginStart } from './types';
45 changes: 45 additions & 0 deletions x-pack/plugins/search_indices/server/plugin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* 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 {
PluginInitializerContext,
CoreSetup,
CoreStart,
Plugin,
Logger,
} from '@kbn/core/server';

import type { SearchIndicesPluginSetup, SearchIndicesPluginStart } from './types';
import { defineRoutes } from './routes';

export class SearchIndicesPlugin
implements Plugin<SearchIndicesPluginSetup, SearchIndicesPluginStart>
{
private readonly logger: Logger;

constructor(initializerContext: PluginInitializerContext) {
this.logger = initializerContext.logger.get();
}

public setup(core: CoreSetup) {
this.logger.debug('searchIndices: Setup');
this.logger.info('searchIndices test');
const router = core.http.createRouter();

// Register server side APIs
defineRoutes(router);

return {};
}

public start(core: CoreStart) {
this.logger.debug('searchIndices: Started');
return {};
}

public stop() {}
}
10 changes: 10 additions & 0 deletions x-pack/plugins/search_indices/server/routes/index.ts
Original file line number Diff line number Diff line change
@@ -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 type { IRouter } from '@kbn/core/server';

export function defineRoutes(router: IRouter) {}
11 changes: 11 additions & 0 deletions x-pack/plugins/search_indices/server/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* 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 SearchIndicesPluginSetup {}
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface SearchIndicesPluginStart {}
21 changes: 21 additions & 0 deletions x-pack/plugins/search_indices/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "target/types"
},
"include": [
"__mocks__/**/*",
"common/**/*",
"public/**/*",
"server/**/*",
"../../../typings/**/*"
],
"kbn_references": [
"@kbn/core",
"@kbn/navigation-plugin",
"@kbn/config-schema",
],
"exclude": [
"target/**/*",
]
}
1 change: 1 addition & 0 deletions x-pack/plugins/serverless_search/kibana.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"indexManagement",
"searchConnectors",
"searchHomepage",
"searchIndices",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: since the plugin doesn't export any contract yet, I'd hold off declaring the dependency unless there's any specific reason to force a certain order in the execution of the plugins.

"searchInferenceEndpoints",
"usageCollection"
],
Expand Down
4 changes: 4 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6244,6 +6244,10 @@
version "0.0.0"
uid ""

"@kbn/search-indices@link:x-pack/plugins/search_indices":
version "0.0.0"
uid ""

"@kbn/search-inference-endpoints@link:x-pack/plugins/search_inference_endpoints":
version "0.0.0"
uid ""
Expand Down