Skip to content

Commit

Permalink
remove legacy kibana plugin (#76064) (#76605)
Browse files Browse the repository at this point in the history
* remove legacy kibana plugin

* as ES as a dependency to security instead of kibana

* remove 'kibana' plugin presence check in so mixin

* moved the `kibana` config section to the server
  • Loading branch information
pgayvallet committed Sep 3, 2020
1 parent 148459f commit 5e53862
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 103 deletions.
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 @@ -232,6 +232,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
autocompleteTimeout: Joi.number().integer().min(1).default(1000),
}).default(),

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

0 comments on commit 5e53862

Please sign in to comment.