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

remove legacy kibana plugin #76064

Merged
Merged
Show file tree
Hide file tree
Changes from 6 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
39 changes: 0 additions & 39 deletions src/legacy/core_plugins/kibana/index.js

This file was deleted.

9 changes: 0 additions & 9 deletions src/legacy/core_plugins/kibana/package.json

This file was deleted.

7 changes: 0 additions & 7 deletions src/legacy/core_plugins/kibana/public/index.scss

This file was deleted.

23 changes: 0 additions & 23 deletions src/legacy/core_plugins/kibana/server/ui_setting_defaults.js

This file was deleted.

9 changes: 9 additions & 0 deletions src/legacy/server/config/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,15 @@ export default () =>
locale: Joi.string().default('en'),
}).default(),

// temporarily moved here from the (now deleted) kibana legacy plugin
kibana: Joi.object({
enabled: Joi.boolean().default(true),
index: Joi.string().default('.kibana'),
autocompleteTerminateAfter: Joi.number().integer().min(1).default(100000),
// TODO Also allow units here like in elasticsearch config once this is moved to the new platform
Copy link
Contributor

@mshustov mshustov Aug 31, 2020

Choose a reason for hiding this comment

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

which team will be owning them? Both input_control_vis and data consume them

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yea, cleaning up the legacy server's config may require some discussions. Fortunately this is not required to shut down the legacy plugin system

autocompleteTimeout: Joi.number().integer().min(1).default(1000),
}).default(),

Comment on lines +234 to +242
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Some legacy code are still accessing these config properties from legacy. I moved them into the server's schema for now. This will have to be handled properly when we remove the legacy server totally.

Copy link
Contributor

Choose a reason for hiding this comment

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

We can remove quite a few validations here, not in the current PR, for sure

savedObjects: Joi.object({
maxImportPayloadBytes: Joi.number().default(10485760),
maxImportExportSize: Joi.number().default(10000),
Expand Down
8 changes: 0 additions & 8 deletions src/legacy/server/saved_objects/saved_objects_mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,6 @@ export function savedObjectsMixin(kbnServer, server) {

server.decorate('server', 'kibanaMigrator', migrator);

const warn = (message) => server.log(['warning', 'saved-objects'], message);
// we use kibana.index which is technically defined in the kibana plugin, so if
// we don't have the plugin (mainly tests) we can't initialize the saved objects
if (!kbnServer.pluginSpecs.some((p) => p.getId() === 'kibana')) {
warn('Saved Objects uninitialized because the Kibana plugin is disabled.');
return;
}

const serializer = kbnServer.newPlatform.start.core.savedObjects.createSerializer();

const createRepository = (callCluster, includedHiddenTypes = []) => {
Expand Down
15 changes: 0 additions & 15 deletions src/legacy/server/saved_objects/saved_objects_mixin.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,21 +161,6 @@ describe('Saved Objects Mixin', () => {
};
});

describe('no kibana plugin', () => {
it('should not try to create anything', () => {
mockKbnServer.pluginSpecs.some = () => false;
savedObjectsMixin(mockKbnServer, mockServer);
expect(mockServer.log).toHaveBeenCalledWith(expect.any(Array), expect.any(String));
expect(mockServer.decorate).toHaveBeenCalledWith(
'server',
'kibanaMigrator',
expect.any(Object)
);
expect(mockServer.decorate).toHaveBeenCalledTimes(1);
expect(mockServer.route).not.toHaveBeenCalled();
});
});

describe('Saved object service', () => {
let service;

Expand Down
2 changes: 1 addition & 1 deletion x-pack/legacy/plugins/security/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const security = (kibana: Record<string, any>) =>
new kibana.Plugin({
id: 'security',
publicDir: resolve(__dirname, 'public'),
require: ['kibana'],
require: ['elasticsearch'],
configPrefix: 'xpack.security',
config: (Joi: Root) =>
Joi.object({ enabled: Joi.boolean().default(true) })
Expand Down
2 changes: 1 addition & 1 deletion x-pack/legacy/plugins/spaces/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const spaces = (kibana: Record<string, any>) =>
id: 'spaces',
configPrefix: 'xpack.spaces',
publicDir: resolve(__dirname, 'public'),
require: ['kibana', 'elasticsearch', 'xpack_main'],
require: ['elasticsearch', 'xpack_main'],
config(Joi: any) {
return Joi.object({
enabled: Joi.boolean().default(true),
Expand Down