From c2eb6dcbc2e115ab0146f782b7bc55ba37fe104e Mon Sep 17 00:00:00 2001 From: Luke Elmers Date: Fri, 10 Sep 2021 11:13:05 -0600 Subject: [PATCH 01/11] Log deprecations for implicitly disable-able plugins. --- .../kbn-config/src/config_service.test.ts | 31 +++++++++++++++++++ packages/kbn-config/src/config_service.ts | 27 ++++++++++++++-- 2 files changed, 55 insertions(+), 3 deletions(-) diff --git a/packages/kbn-config/src/config_service.test.ts b/packages/kbn-config/src/config_service.test.ts index aa520e7189e5..ca5493f2281f 100644 --- a/packages/kbn-config/src/config_service.test.ts +++ b/packages/kbn-config/src/config_service.test.ts @@ -364,6 +364,37 @@ test('read "enabled" even if its schema is not present', async () => { expect(isEnabled).toBe(true); }); +test('logs deprecation if schema is not present and "enabled" is used', async () => { + const initialConfig = { + foo: { + enabled: true, + }, + }; + + const rawConfigProvider = rawConfigServiceMock.create({ rawConfig: initialConfig }); + const configService = new ConfigService(rawConfigProvider, defaultEnv, logger); + + await configService.isEnabledAtPath('foo'); + expect(configService.getHandledDeprecatedConfigs()).toMatchInlineSnapshot(` + Array [ + Array [ + "foo", + Array [ + Object { + "correctiveActions": Object { + "manualSteps": Array [ + "Remove foo.enabled from your Kibana config.", + ], + }, + "message": "\\"foo.enabled\\" has been deprecated and will be removed in 8.0.", + "title": "Setting \\"foo.enabled\\" is deprecated", + }, + ], + ], + ] + `); +}); + test('allows plugins to specify "enabled" flag via validation schema', async () => { const initialConfig = {}; diff --git a/packages/kbn-config/src/config_service.ts b/packages/kbn-config/src/config_service.ts index 514992891ad1..2b124e0fbf05 100644 --- a/packages/kbn-config/src/config_service.ts +++ b/packages/kbn-config/src/config_service.ts @@ -177,6 +177,23 @@ export class ConfigService { // if plugin hasn't got a config schema, we try to read "enabled" directly const isEnabled = validatedConfig?.enabled ?? config.get(enabledPath); + // if we implicitly added an `enabled` config to a plugin without a schema, + // we log a deprecation warning, as this will not be supported in 8.0 + if (validatedConfig?.enabled === undefined && isEnabled !== undefined) { + const deprecationPath = pathToString(enabledPath); + const deprecatedConfigDetails: DeprecatedConfigDetails = { + title: `Setting "${deprecationPath}" is deprecated`, + message: `"${deprecationPath}" has been deprecated and will be removed in 8.0.`, + correctiveActions: { + manualSteps: [`Remove ${deprecationPath} from your Kibana config.`], + }, + }; + this.addDeprecationProvider(namespace, () => [ + (settings, fromPath, addDeprecation) => addDeprecation(deprecatedConfigDetails), + ]); + this.markDeprecatedConfigAsHandled(namespace, deprecatedConfigDetails); + } + // not declared. consider that plugin is enabled by default if (isEnabled === undefined) { return true; @@ -220,9 +237,7 @@ export class ConfigService { if (!context.silent) { deprecationMessages.push(context.message); } - const handledDeprecatedConfig = this.handledDeprecatedConfigs.get(domainId) || []; - handledDeprecatedConfig.push(context); - this.handledDeprecatedConfigs.set(domainId, handledDeprecatedConfig); + this.markDeprecatedConfigAsHandled(domainId, context); }; applyDeprecations(rawConfig, deprecations, createAddDeprecation); @@ -260,6 +275,12 @@ export class ConfigService { this.log.debug(`Marking config path as handled: ${path}`); this.handledPaths.add(path); } + + private markDeprecatedConfigAsHandled(domainId: string, config: DeprecatedConfigDetails) { + const handledDeprecatedConfig = this.handledDeprecatedConfigs.get(domainId) || []; + handledDeprecatedConfig.push(config); + this.handledDeprecatedConfigs.set(domainId, handledDeprecatedConfig); + } } const createPluginEnabledPath = (configPath: string | string[]) => { From 3958eb5e5f9b3caea6ca28101a4c57f1d9e80a8b Mon Sep 17 00:00:00 2001 From: Luke Elmers Date: Fri, 10 Sep 2021 11:35:25 -0600 Subject: [PATCH 02/11] Add explicit 'enabled' option to plugins which will need it moving forward. --- src/plugins/vis_types/pie/config.ts | 15 +++++++++++++++ src/plugins/vis_types/pie/server/index.ts | 7 +++++++ src/plugins/vis_types/pie/tsconfig.json | 3 ++- src/plugins/vis_types/xy/config.ts | 15 +++++++++++++++ src/plugins/vis_types/xy/kibana.json | 2 +- src/plugins/vis_types/xy/server/index.ts | 17 +++++++++++++++++ src/plugins/vis_types/xy/server/plugin.ts | 19 +++++++++++++++++++ src/plugins/vis_types/xy/tsconfig.json | 3 ++- 8 files changed, 78 insertions(+), 3 deletions(-) create mode 100644 src/plugins/vis_types/pie/config.ts create mode 100644 src/plugins/vis_types/xy/config.ts create mode 100644 src/plugins/vis_types/xy/server/index.ts create mode 100644 src/plugins/vis_types/xy/server/plugin.ts diff --git a/src/plugins/vis_types/pie/config.ts b/src/plugins/vis_types/pie/config.ts new file mode 100644 index 000000000000..b831d26854c3 --- /dev/null +++ b/src/plugins/vis_types/pie/config.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { schema, TypeOf } from '@kbn/config-schema'; + +export const configSchema = schema.object({ + enabled: schema.boolean({ defaultValue: true }), +}); + +export type ConfigSchema = TypeOf; diff --git a/src/plugins/vis_types/pie/server/index.ts b/src/plugins/vis_types/pie/server/index.ts index 201071fbb5fc..1e92bedb3d11 100644 --- a/src/plugins/vis_types/pie/server/index.ts +++ b/src/plugins/vis_types/pie/server/index.ts @@ -5,6 +5,13 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ + +import { PluginConfigDescriptor } from 'src/core/server'; +import { configSchema, ConfigSchema } from '../config'; import { VisTypePieServerPlugin } from './plugin'; +export const config: PluginConfigDescriptor = { + schema: configSchema, +}; + export const plugin = () => new VisTypePieServerPlugin(); diff --git a/src/plugins/vis_types/pie/tsconfig.json b/src/plugins/vis_types/pie/tsconfig.json index 9a0a3418d72d..99e25a4eba63 100644 --- a/src/plugins/vis_types/pie/tsconfig.json +++ b/src/plugins/vis_types/pie/tsconfig.json @@ -9,7 +9,8 @@ "include": [ "common/**/*", "public/**/*", - "server/**/*" + "server/**/*", + "*.ts" ], "references": [ { "path": "../../../core/tsconfig.json" }, diff --git a/src/plugins/vis_types/xy/config.ts b/src/plugins/vis_types/xy/config.ts new file mode 100644 index 000000000000..b831d26854c3 --- /dev/null +++ b/src/plugins/vis_types/xy/config.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { schema, TypeOf } from '@kbn/config-schema'; + +export const configSchema = schema.object({ + enabled: schema.boolean({ defaultValue: true }), +}); + +export type ConfigSchema = TypeOf; diff --git a/src/plugins/vis_types/xy/kibana.json b/src/plugins/vis_types/xy/kibana.json index 1666a346e348..1606af5944ad 100644 --- a/src/plugins/vis_types/xy/kibana.json +++ b/src/plugins/vis_types/xy/kibana.json @@ -2,7 +2,7 @@ "id": "visTypeXy", "version": "kibana", "ui": true, - "server": false, + "server": true, "requiredPlugins": ["charts", "data", "expressions", "visualizations", "usageCollection"], "requiredBundles": ["kibanaUtils", "visDefaultEditor"], "extraPublicDirs": ["common/index"], diff --git a/src/plugins/vis_types/xy/server/index.ts b/src/plugins/vis_types/xy/server/index.ts new file mode 100644 index 000000000000..9dfa405ee27b --- /dev/null +++ b/src/plugins/vis_types/xy/server/index.ts @@ -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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { PluginConfigDescriptor } from 'src/core/server'; +import { configSchema, ConfigSchema } from '../config'; +import { VisTypeXYServerPlugin } from './plugin'; + +export const config: PluginConfigDescriptor = { + schema: configSchema, +}; + +export const plugin = () => new VisTypeXYServerPlugin(); diff --git a/src/plugins/vis_types/xy/server/plugin.ts b/src/plugins/vis_types/xy/server/plugin.ts new file mode 100644 index 000000000000..5cb0687cf188 --- /dev/null +++ b/src/plugins/vis_types/xy/server/plugin.ts @@ -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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { Plugin } from 'src/core/server'; + +export class VisTypeXYServerPlugin implements Plugin { + public setup() { + return {}; + } + + public start() { + return {}; + } +} diff --git a/src/plugins/vis_types/xy/tsconfig.json b/src/plugins/vis_types/xy/tsconfig.json index f1f65b6218e8..ab3f3d1252ed 100644 --- a/src/plugins/vis_types/xy/tsconfig.json +++ b/src/plugins/vis_types/xy/tsconfig.json @@ -9,7 +9,8 @@ "include": [ "common/**/*", "public/**/*", - "server/**/*" + "server/**/*", + "*.ts" ], "references": [ { "path": "../../../core/tsconfig.json" }, From e2c26608927a80bd6e42524b9cfb920d2a6f7a4b Mon Sep 17 00:00:00 2001 From: Luke Elmers Date: Fri, 10 Sep 2021 11:44:49 -0600 Subject: [PATCH 03/11] Add manual deprecation as an example. --- src/plugins/apm_oss/server/index.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/plugins/apm_oss/server/index.ts b/src/plugins/apm_oss/server/index.ts index bf6baf187607..6bb01bd9c86d 100644 --- a/src/plugins/apm_oss/server/index.ts +++ b/src/plugins/apm_oss/server/index.ts @@ -13,6 +13,17 @@ import { APMOSSPlugin } from './plugin'; const deprecations: ConfigDeprecationProvider = ({ unused }) => [ unused('fleetMode'), unused('indexPattern'), + (settings, fromPath, addDeprecation) => { + if (settings.apm_oss?.enabled !== undefined) { + addDeprecation({ + title: `Setting "${fromPath}.enabled" is deprecated`, + message: `"${fromPath}.enabled" has been deprecated and will be removed in 8.0.`, + correctiveActions: { + manualSteps: [`Remove ${fromPath}.enabled from your Kibana config.`], + }, + }); + } + }, ]; export const config = { From 5041f8c5a5b8a794cb2b10bbae0370b4e961cd14 Mon Sep 17 00:00:00 2001 From: Luke Elmers Date: Mon, 13 Sep 2021 16:56:19 -0600 Subject: [PATCH 04/11] Add 'deprecate' and 'deprecateFromRoot' to ConfigDeprecationFactory. --- .../deprecation/deprecation_factory.test.ts | 136 +++++++++++++++++- .../src/deprecation/deprecation_factory.ts | 51 +++++++ packages/kbn-config/src/deprecation/types.ts | 38 +++++ src/plugins/apm_oss/server/index.ts | 14 +- 4 files changed, 226 insertions(+), 13 deletions(-) diff --git a/packages/kbn-config/src/deprecation/deprecation_factory.test.ts b/packages/kbn-config/src/deprecation/deprecation_factory.test.ts index 0a605cbc1c53..8031508a3ad4 100644 --- a/packages/kbn-config/src/deprecation/deprecation_factory.test.ts +++ b/packages/kbn-config/src/deprecation/deprecation_factory.test.ts @@ -10,7 +10,8 @@ import { DeprecatedConfigDetails } from './types'; import { configDeprecationFactory } from './deprecation_factory'; describe('DeprecationFactory', () => { - const { rename, unused, renameFromRoot, unusedFromRoot } = configDeprecationFactory; + const { deprecate, deprecateFromRoot, rename, renameFromRoot, unused, unusedFromRoot } = + configDeprecationFactory; const addDeprecation = jest.fn(); @@ -18,6 +19,139 @@ describe('DeprecationFactory', () => { addDeprecation.mockClear(); }); + describe('deprecate', () => { + it('logs a warning when property is present', () => { + const rawConfig = { + myplugin: { + deprecated: 'deprecated', + valid: 'valid', + }, + someOtherPlugin: { + property: 'value', + }, + }; + const commands = deprecate('deprecated', '8.0.0')(rawConfig, 'myplugin', addDeprecation); + expect(commands).toBeUndefined(); + expect(addDeprecation.mock.calls).toMatchInlineSnapshot(` + Array [ + Array [ + Object { + "correctiveActions": Object { + "manualSteps": Array [ + "Remove \\"myplugin.deprecated\\" from the Kibana config file, CLI flag, or environment variable (in Docker only) before upgrading to 8.0.0.", + ], + }, + "message": "Configuring \\"myplugin.deprecated\\" is deprecated and will be removed in 8.0.0.", + "title": "Setting \\"myplugin.deprecated\\" is deprecated", + }, + ], + ] + `); + }); + + it('handles deeply nested keys', () => { + const rawConfig = { + myplugin: { + section: { + deprecated: 'deprecated', + }, + valid: 'valid', + }, + someOtherPlugin: { + property: 'value', + }, + }; + const commands = deprecate('section.deprecated', '8.0.0')( + rawConfig, + 'myplugin', + addDeprecation + ); + expect(commands).toBeUndefined(); + expect(addDeprecation.mock.calls).toMatchInlineSnapshot(` + Array [ + Array [ + Object { + "correctiveActions": Object { + "manualSteps": Array [ + "Remove \\"myplugin.section.deprecated\\" from the Kibana config file, CLI flag, or environment variable (in Docker only) before upgrading to 8.0.0.", + ], + }, + "message": "Configuring \\"myplugin.section.deprecated\\" is deprecated and will be removed in 8.0.0.", + "title": "Setting \\"myplugin.section.deprecated\\" is deprecated", + }, + ], + ] + `); + }); + + it('does not log if unused property is not present', () => { + const rawConfig = { + myplugin: { + valid: 'valid', + }, + someOtherPlugin: { + property: 'value', + }, + }; + const commands = deprecate('deprecated', '8.0.0')(rawConfig, 'myplugin', addDeprecation); + expect(commands).toBeUndefined(); + expect(addDeprecation).toBeCalledTimes(0); + }); + }); + + describe('deprecateFromRoot', () => { + it('logs a warning when property is present', () => { + const rawConfig = { + myplugin: { + deprecated: 'deprecated', + valid: 'valid', + }, + someOtherPlugin: { + property: 'value', + }, + }; + const commands = deprecateFromRoot('myplugin.deprecated', '8.0.0')( + rawConfig, + 'does-not-matter', + addDeprecation + ); + expect(commands).toBeUndefined(); + expect(addDeprecation.mock.calls).toMatchInlineSnapshot(` + Array [ + Array [ + Object { + "correctiveActions": Object { + "manualSteps": Array [ + "Remove \\"myplugin.deprecated\\" from the Kibana config file, CLI flag, or environment variable (in Docker only) before upgrading to 8.0.0.", + ], + }, + "message": "Configuring \\"myplugin.deprecated\\" is deprecated and will be removed in 8.0.0.", + "title": "Setting \\"myplugin.deprecated\\" is deprecated", + }, + ], + ] + `); + }); + + it('does not log if unused property is not present', () => { + const rawConfig = { + myplugin: { + valid: 'valid', + }, + someOtherPlugin: { + property: 'value', + }, + }; + const commands = deprecateFromRoot('myplugin.deprecated', '8.0.0')( + rawConfig, + 'does-not-matter', + addDeprecation + ); + expect(commands).toBeUndefined(); + expect(addDeprecation).toBeCalledTimes(0); + }); + }); + describe('rename', () => { it('moves the property to rename and logs a warning if old property exist and new one does not', () => { const rawConfig = { diff --git a/packages/kbn-config/src/deprecation/deprecation_factory.ts b/packages/kbn-config/src/deprecation/deprecation_factory.ts index 119b9b11237d..e7496c84f4c6 100644 --- a/packages/kbn-config/src/deprecation/deprecation_factory.ts +++ b/packages/kbn-config/src/deprecation/deprecation_factory.ts @@ -24,6 +24,37 @@ const getDeprecationTitle = (deprecationPath: string) => { }); }; +const _deprecate = ( + config: Record, + rootPath: string, + addDeprecation: AddConfigDeprecation, + deprecatedKey: string, + removeBy: string, + details?: Partial +): void => { + const fullPath = getPath(rootPath, deprecatedKey); + if (get(config, fullPath) === undefined) { + return; + } + addDeprecation({ + title: getDeprecationTitle(fullPath), + message: i18n.translate('kbnConfig.deprecations.deprecatedSettingMessage', { + defaultMessage: 'Configuring "{fullPath}" is deprecated and will be removed in {removeBy}.', + values: { fullPath, removeBy }, + }), + correctiveActions: { + manualSteps: [ + i18n.translate('kbnConfig.deprecations.deprecatedSetting.manualStepOneMessage', { + defaultMessage: + 'Remove "{fullPath}" from the Kibana config file, CLI flag, or environment variable (in Docker only) before upgrading to {removeBy}.', + values: { fullPath, removeBy }, + }), + ], + }, + ...details, + }); +}; + const _rename = ( config: Record, rootPath: string, @@ -125,6 +156,24 @@ const _unused = ( }; }; +const deprecate = + ( + unusedKey: string, + removeBy: string, + details?: Partial + ): ConfigDeprecation => + (config, rootPath, addDeprecation) => + _deprecate(config, rootPath, addDeprecation, unusedKey, removeBy, details); + +const deprecateFromRoot = + ( + unusedKey: string, + removeBy: string, + details?: Partial + ): ConfigDeprecation => + (config, rootPath, addDeprecation) => + _deprecate(config, '', addDeprecation, unusedKey, removeBy, details); + const rename = (oldKey: string, newKey: string, details?: Partial): ConfigDeprecation => (config, rootPath, addDeprecation) => @@ -154,6 +203,8 @@ const getPath = (rootPath: string, subPath: string) => * @internal */ export const configDeprecationFactory: ConfigDeprecationFactory = { + deprecate, + deprecateFromRoot, rename, renameFromRoot, unused, diff --git a/packages/kbn-config/src/deprecation/types.ts b/packages/kbn-config/src/deprecation/types.ts index 0e1f36121e50..47a31b9e6725 100644 --- a/packages/kbn-config/src/deprecation/types.ts +++ b/packages/kbn-config/src/deprecation/types.ts @@ -91,6 +91,7 @@ export interface ConfigDeprecationCommand { * @example * ```typescript * const provider: ConfigDeprecationProvider = ({ rename, unused }) => [ + * deprecate('deprecatedKey', '8.0.0'), * rename('oldKey', 'newKey'), * unused('deprecatedKey'), * (config, path) => ({ unset: [{ key: 'path.to.key' }] }) @@ -119,6 +120,43 @@ export type ConfigDeprecationProvider = (factory: ConfigDeprecationFactory) => C */ export interface ConfigDeprecationFactory { + /** + * Deprecate a configuration property from inside a plugin's configuration path. + * Will log a deprecation warning if the deprecatedKey was found. + * + * @example + * Log a deprecation warning indicating 'myplugin.deprecatedKey' should be removed by `8.0.0` + * ```typescript + * const provider: ConfigDeprecationProvider = ({ deprecate }) => [ + * deprecate('deprecatedKey', '8.0.0'), + * ] + * ``` + */ + deprecate( + deprecatedKey: string, + removeBy: string, + details?: Partial + ): ConfigDeprecation; + /** + * Deprecate a configuration property from the root configuration. + * Will log a deprecation warning if the deprecatedKey was found. + * + * This should be only used when deprecating properties from different configuration's path. + * To deprecate properties from inside a plugin's configuration, use 'deprecate' instead. + * + * @example + * Log a deprecation warning indicating 'myplugin.deprecatedKey' should be removed by `8.0.0` + * ```typescript + * const provider: ConfigDeprecationProvider = ({ deprecate }) => [ + * deprecateFromRoot('deprecatedKey', '8.0.0'), + * ] + * ``` + */ + deprecateFromRoot( + deprecatedKey: string, + removeBy: string, + details?: Partial + ): ConfigDeprecation; /** * Rename a configuration property from inside a plugin's configuration path. * Will log a deprecation warning if the oldKey was found and deprecation applied. diff --git a/src/plugins/apm_oss/server/index.ts b/src/plugins/apm_oss/server/index.ts index 6bb01bd9c86d..f2f6777672e3 100644 --- a/src/plugins/apm_oss/server/index.ts +++ b/src/plugins/apm_oss/server/index.ts @@ -10,20 +10,10 @@ import { schema, TypeOf } from '@kbn/config-schema'; import { ConfigDeprecationProvider, PluginInitializerContext } from '../../../core/server'; import { APMOSSPlugin } from './plugin'; -const deprecations: ConfigDeprecationProvider = ({ unused }) => [ +const deprecations: ConfigDeprecationProvider = ({ deprecate, unused }) => [ + deprecate('enabled', '8.0.0'), unused('fleetMode'), unused('indexPattern'), - (settings, fromPath, addDeprecation) => { - if (settings.apm_oss?.enabled !== undefined) { - addDeprecation({ - title: `Setting "${fromPath}.enabled" is deprecated`, - message: `"${fromPath}.enabled" has been deprecated and will be removed in 8.0.`, - correctiveActions: { - manualSteps: [`Remove ${fromPath}.enabled from your Kibana config.`], - }, - }); - } - }, ]; export const config = { From 0dd26ca32970e837c0d65499c402f2c008dd7eeb Mon Sep 17 00:00:00 2001 From: Luke Elmers Date: Tue, 14 Sep 2021 16:59:51 -0600 Subject: [PATCH 05/11] Deprecate 'enabled' config for plugins with expicit config schemas. --- .../kbn-config/src/config_service.test.ts | 4 +- packages/kbn-config/src/config_service.ts | 6 +- src/plugins/console/server/index.ts | 2 +- x-pack/plugins/apm/server/index.ts | 82 ++++++++++--------- x-pack/plugins/cases/server/index.ts | 3 +- x-pack/plugins/cloud/server/config.ts | 1 + .../cross_cluster_replication/server/index.ts | 1 + .../encrypted_saved_objects/server/index.ts | 7 +- .../plugins/enterprise_search/server/index.ts | 1 + x-pack/plugins/fleet/server/index.ts | 3 +- x-pack/plugins/graph/server/index.ts | 1 + .../server/index.ts | 1 + .../plugins/index_management/server/index.ts | 5 +- x-pack/plugins/infra/server/plugin.ts | 10 ++- x-pack/plugins/lens/server/index.ts | 1 + .../license_management/server/index.ts | 1 + x-pack/plugins/lists/server/index.ts | 7 +- x-pack/plugins/logstash/server/index.ts | 1 + x-pack/plugins/maps/server/index.ts | 3 +- .../plugins/metrics_entities/server/index.ts | 7 +- .../monitoring/server/deprecations.test.js | 3 +- .../plugins/monitoring/server/deprecations.ts | 2 + x-pack/plugins/observability/server/index.ts | 7 +- x-pack/plugins/osquery/server/index.ts | 7 +- .../plugins/remote_clusters/server/config.ts | 1 + x-pack/plugins/rollup/server/index.ts | 1 + x-pack/plugins/rule_registry/server/config.ts | 4 +- .../saved_objects_tagging/server/config.ts | 1 + .../plugins/security_solution/server/index.ts | 3 +- .../plugins/snapshot_restore/server/index.ts | 1 + x-pack/plugins/timelines/server/index.ts | 7 +- .../upgrade_assistant/public/plugin.ts | 6 +- .../plugins/upgrade_assistant/server/index.ts | 2 +- 33 files changed, 118 insertions(+), 74 deletions(-) diff --git a/packages/kbn-config/src/config_service.test.ts b/packages/kbn-config/src/config_service.test.ts index ca5493f2281f..754de1c0a99f 100644 --- a/packages/kbn-config/src/config_service.test.ts +++ b/packages/kbn-config/src/config_service.test.ts @@ -383,10 +383,10 @@ test('logs deprecation if schema is not present and "enabled" is used', async () Object { "correctiveActions": Object { "manualSteps": Array [ - "Remove foo.enabled from your Kibana config.", + "Remove \\"foo.enabled\\" from the Kibana config file, CLI flag, or environment variable (in Docker only) before upgrading to 8.0.0.", ], }, - "message": "\\"foo.enabled\\" has been deprecated and will be removed in 8.0.", + "message": "Configuring \\"foo.enabled\\" is deprecated and will be removed in 8.0.0.", "title": "Setting \\"foo.enabled\\" is deprecated", }, ], diff --git a/packages/kbn-config/src/config_service.ts b/packages/kbn-config/src/config_service.ts index 2b124e0fbf05..207f400128ac 100644 --- a/packages/kbn-config/src/config_service.ts +++ b/packages/kbn-config/src/config_service.ts @@ -183,9 +183,11 @@ export class ConfigService { const deprecationPath = pathToString(enabledPath); const deprecatedConfigDetails: DeprecatedConfigDetails = { title: `Setting "${deprecationPath}" is deprecated`, - message: `"${deprecationPath}" has been deprecated and will be removed in 8.0.`, + message: `Configuring "${deprecationPath}" is deprecated and will be removed in 8.0.0.`, correctiveActions: { - manualSteps: [`Remove ${deprecationPath} from your Kibana config.`], + manualSteps: [ + `Remove "${deprecationPath}" from the Kibana config file, CLI flag, or environment variable (in Docker only) before upgrading to 8.0.0.`, + ], }, }; this.addDeprecationProvider(namespace, () => [ diff --git a/src/plugins/console/server/index.ts b/src/plugins/console/server/index.ts index 736a7e1ae3c9..cd05652c6283 100644 --- a/src/plugins/console/server/index.ts +++ b/src/plugins/console/server/index.ts @@ -16,6 +16,6 @@ export { ConsoleSetup, ConsoleStart } from './types'; export const plugin = (ctx: PluginInitializerContext) => new ConsoleServerPlugin(ctx); export const config: PluginConfigDescriptor = { - deprecations: ({ unused }) => [unused('ssl')], + deprecations: ({ deprecate, unused, rename }) => [deprecate('enabled', '8.0.0'), unused('ssl')], schema: configSchema, }; diff --git a/x-pack/plugins/apm/server/index.ts b/x-pack/plugins/apm/server/index.ts index 6ba412bd2202..2c21ff17f779 100644 --- a/x-pack/plugins/apm/server/index.ts +++ b/x-pack/plugins/apm/server/index.ts @@ -6,56 +6,62 @@ */ import { schema, TypeOf } from '@kbn/config-schema'; -import { PluginInitializerContext } from 'src/core/server'; +import { + PluginInitializerContext, + PluginConfigDescriptor, +} from 'src/core/server'; import { APMOSSConfig } from 'src/plugins/apm_oss/server'; import { APMPlugin } from './plugin'; import { SearchAggregatedTransactionSetting } from '../common/aggregated_transactions'; +const configSchema = schema.object({ + enabled: schema.boolean({ defaultValue: true }), + serviceMapEnabled: schema.boolean({ defaultValue: true }), + serviceMapFingerprintBucketSize: schema.number({ defaultValue: 100 }), + serviceMapTraceIdBucketSize: schema.number({ defaultValue: 65 }), + serviceMapFingerprintGlobalBucketSize: schema.number({ + defaultValue: 1000, + }), + serviceMapTraceIdGlobalBucketSize: schema.number({ defaultValue: 6 }), + serviceMapMaxTracesPerRequest: schema.number({ defaultValue: 50 }), + autocreateApmIndexPattern: schema.boolean({ defaultValue: true }), + ui: schema.object({ + enabled: schema.boolean({ defaultValue: true }), + transactionGroupBucketSize: schema.number({ defaultValue: 1000 }), + maxTraceItems: schema.number({ defaultValue: 1000 }), + }), + searchAggregatedTransactions: schema.oneOf( + [ + schema.literal(SearchAggregatedTransactionSetting.auto), + schema.literal(SearchAggregatedTransactionSetting.always), + schema.literal(SearchAggregatedTransactionSetting.never), + ], + { defaultValue: SearchAggregatedTransactionSetting.auto } + ), + telemetryCollectionEnabled: schema.boolean({ defaultValue: true }), + metricsInterval: schema.number({ defaultValue: 30 }), + maxServiceEnvironments: schema.number({ defaultValue: 100 }), + maxServiceSelection: schema.number({ defaultValue: 50 }), + profilingEnabled: schema.boolean({ defaultValue: false }), + agent: schema.object({ + migrations: schema.object({ + enabled: schema.boolean({ defaultValue: false }), + }), + }), +}); + // plugin config -export const config = { +export const config: PluginConfigDescriptor = { + deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')], exposeToBrowser: { serviceMapEnabled: true, ui: true, profilingEnabled: true, }, - schema: schema.object({ - enabled: schema.boolean({ defaultValue: true }), - serviceMapEnabled: schema.boolean({ defaultValue: true }), - serviceMapFingerprintBucketSize: schema.number({ defaultValue: 100 }), - serviceMapTraceIdBucketSize: schema.number({ defaultValue: 65 }), - serviceMapFingerprintGlobalBucketSize: schema.number({ - defaultValue: 1000, - }), - serviceMapTraceIdGlobalBucketSize: schema.number({ defaultValue: 6 }), - serviceMapMaxTracesPerRequest: schema.number({ defaultValue: 50 }), - autocreateApmIndexPattern: schema.boolean({ defaultValue: true }), - ui: schema.object({ - enabled: schema.boolean({ defaultValue: true }), - transactionGroupBucketSize: schema.number({ defaultValue: 1000 }), - maxTraceItems: schema.number({ defaultValue: 1000 }), - }), - searchAggregatedTransactions: schema.oneOf( - [ - schema.literal(SearchAggregatedTransactionSetting.auto), - schema.literal(SearchAggregatedTransactionSetting.always), - schema.literal(SearchAggregatedTransactionSetting.never), - ], - { defaultValue: SearchAggregatedTransactionSetting.auto } - ), - telemetryCollectionEnabled: schema.boolean({ defaultValue: true }), - metricsInterval: schema.number({ defaultValue: 30 }), - maxServiceEnvironments: schema.number({ defaultValue: 100 }), - maxServiceSelection: schema.number({ defaultValue: 50 }), - profilingEnabled: schema.boolean({ defaultValue: false }), - agent: schema.object({ - migrations: schema.object({ - enabled: schema.boolean({ defaultValue: false }), - }), - }), - }), + schema: configSchema, }; -export type APMXPackConfig = TypeOf; +export type APMXPackConfig = TypeOf; export type APMConfig = ReturnType; // plugin config and ui indices settings diff --git a/x-pack/plugins/cases/server/index.ts b/x-pack/plugins/cases/server/index.ts index 5e433b46b80e..ad76724eb49f 100644 --- a/x-pack/plugins/cases/server/index.ts +++ b/x-pack/plugins/cases/server/index.ts @@ -15,7 +15,8 @@ export const config: PluginConfigDescriptor = { exposeToBrowser: { markdownPlugins: true, }, - deprecations: ({ renameFromRoot }) => [ + deprecations: ({ deprecate, renameFromRoot }) => [ + deprecate('enabled', '8.0.0'), renameFromRoot('xpack.case.enabled', 'xpack.cases.enabled'), ], }; diff --git a/x-pack/plugins/cloud/server/config.ts b/x-pack/plugins/cloud/server/config.ts index 4b83071bf473..2cc413178c3a 100644 --- a/x-pack/plugins/cloud/server/config.ts +++ b/x-pack/plugins/cloud/server/config.ts @@ -52,5 +52,6 @@ export const config: PluginConfigDescriptor = { organization_url: true, full_story: true, }, + deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')], schema: configSchema, }; diff --git a/x-pack/plugins/cross_cluster_replication/server/index.ts b/x-pack/plugins/cross_cluster_replication/server/index.ts index b1803950614d..a6a3ec0fe575 100644 --- a/x-pack/plugins/cross_cluster_replication/server/index.ts +++ b/x-pack/plugins/cross_cluster_replication/server/index.ts @@ -17,4 +17,5 @@ export const config: PluginConfigDescriptor = { exposeToBrowser: { ui: true, }, + deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')], }; diff --git a/x-pack/plugins/encrypted_saved_objects/server/index.ts b/x-pack/plugins/encrypted_saved_objects/server/index.ts index 2706da22d108..b765f1fcaf6f 100644 --- a/x-pack/plugins/encrypted_saved_objects/server/index.ts +++ b/x-pack/plugins/encrypted_saved_objects/server/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { PluginInitializerContext } from 'src/core/server'; +import type { PluginConfigDescriptor, PluginInitializerContext } from 'src/core/server'; import { ConfigSchema } from './config'; import { EncryptedSavedObjectsPlugin } from './plugin'; @@ -15,6 +15,9 @@ export { EncryptedSavedObjectsPluginSetup, EncryptedSavedObjectsPluginStart } fr export { EncryptedSavedObjectsClient } from './saved_objects'; export type { IsMigrationNeededPredicate } from './create_migration'; -export const config = { schema: ConfigSchema }; +export const config: PluginConfigDescriptor = { + schema: ConfigSchema, + deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')], +}; export const plugin = (initializerContext: PluginInitializerContext) => new EncryptedSavedObjectsPlugin(initializerContext); diff --git a/x-pack/plugins/enterprise_search/server/index.ts b/x-pack/plugins/enterprise_search/server/index.ts index ecd068c8bdbd..dae584a883bd 100644 --- a/x-pack/plugins/enterprise_search/server/index.ts +++ b/x-pack/plugins/enterprise_search/server/index.ts @@ -37,4 +37,5 @@ export const config: PluginConfigDescriptor = { exposeToBrowser: { host: true, }, + deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')], }; diff --git a/x-pack/plugins/fleet/server/index.ts b/x-pack/plugins/fleet/server/index.ts index 21cdf659f2f5..cb122c94a9a8 100644 --- a/x-pack/plugins/fleet/server/index.ts +++ b/x-pack/plugins/fleet/server/index.ts @@ -38,7 +38,8 @@ export const config: PluginConfigDescriptor = { epm: true, agents: true, }, - deprecations: ({ renameFromRoot, unused, unusedFromRoot }) => [ + deprecations: ({ deprecate, renameFromRoot, unused, unusedFromRoot }) => [ + deprecate('enabled', '8.0.0'), // Fleet plugin was named ingestManager before renameFromRoot('xpack.ingestManager.enabled', 'xpack.fleet.enabled'), renameFromRoot('xpack.ingestManager.registryUrl', 'xpack.fleet.registryUrl'), diff --git a/x-pack/plugins/graph/server/index.ts b/x-pack/plugins/graph/server/index.ts index 10ddca631a89..528e122da9a4 100644 --- a/x-pack/plugins/graph/server/index.ts +++ b/x-pack/plugins/graph/server/index.ts @@ -18,4 +18,5 @@ export const config: PluginConfigDescriptor = { savePolicy: true, }, schema: configSchema, + deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')], }; diff --git a/x-pack/plugins/index_lifecycle_management/server/index.ts b/x-pack/plugins/index_lifecycle_management/server/index.ts index e90518dbfa35..1f8b01913fd3 100644 --- a/x-pack/plugins/index_lifecycle_management/server/index.ts +++ b/x-pack/plugins/index_lifecycle_management/server/index.ts @@ -17,4 +17,5 @@ export const config: PluginConfigDescriptor = { exposeToBrowser: { ui: true, }, + deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')], }; diff --git a/x-pack/plugins/index_management/server/index.ts b/x-pack/plugins/index_management/server/index.ts index 507401398a40..14b67e2ffd58 100644 --- a/x-pack/plugins/index_management/server/index.ts +++ b/x-pack/plugins/index_management/server/index.ts @@ -5,15 +5,16 @@ * 2.0. */ -import { PluginInitializerContext } from 'src/core/server'; +import { PluginInitializerContext, PluginConfigDescriptor } from 'src/core/server'; import { IndexMgmtServerPlugin } from './plugin'; import { configSchema } from './config'; export const plugin = (context: PluginInitializerContext) => new IndexMgmtServerPlugin(context); -export const config = { +export const config: PluginConfigDescriptor = { schema: configSchema, + deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')], }; /** @public */ diff --git a/x-pack/plugins/infra/server/plugin.ts b/x-pack/plugins/infra/server/plugin.ts index de445affc178..b77b81cf41ee 100644 --- a/x-pack/plugins/infra/server/plugin.ts +++ b/x-pack/plugins/infra/server/plugin.ts @@ -9,7 +9,12 @@ import { Server } from '@hapi/hapi'; import { schema, TypeOf } from '@kbn/config-schema'; import { i18n } from '@kbn/i18n'; import { Logger } from '@kbn/logging'; -import { CoreSetup, PluginInitializerContext, Plugin } from 'src/core/server'; +import { + CoreSetup, + PluginInitializerContext, + Plugin, + PluginConfigDescriptor, +} from 'src/core/server'; import { LOGS_FEATURE_ID, METRICS_FEATURE_ID } from '../common/constants'; import { InfraStaticSourceConfiguration } from '../common/source_configuration/source_configuration'; import { inventoryViewSavedObjectType } from '../common/saved_objects/inventory_view'; @@ -36,7 +41,7 @@ import { createGetLogQueryFields } from './services/log_queries/get_log_query_fi import { handleEsError } from '../../../../src/plugins/es_ui_shared/server'; import { RulesService } from './services/rules'; -export const config = { +export const config: PluginConfigDescriptor = { schema: schema.object({ enabled: schema.boolean({ defaultValue: true }), inventory: schema.object({ @@ -63,6 +68,7 @@ export const config = { }) ), }), + deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')], }; export type InfraConfig = TypeOf; diff --git a/x-pack/plugins/lens/server/index.ts b/x-pack/plugins/lens/server/index.ts index 08f1eb156273..e2117506e9b7 100644 --- a/x-pack/plugins/lens/server/index.ts +++ b/x-pack/plugins/lens/server/index.ts @@ -19,6 +19,7 @@ import { configSchema, ConfigSchema } from '../config'; export const config: PluginConfigDescriptor = { schema: configSchema, + deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')], }; export const plugin = (initializerContext: PluginInitializerContext) => diff --git a/x-pack/plugins/license_management/server/index.ts b/x-pack/plugins/license_management/server/index.ts index 7a24845c981e..e78ffe07b50c 100644 --- a/x-pack/plugins/license_management/server/index.ts +++ b/x-pack/plugins/license_management/server/index.ts @@ -17,4 +17,5 @@ export const config: PluginConfigDescriptor = { exposeToBrowser: { ui: true, }, + deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')], }; diff --git a/x-pack/plugins/lists/server/index.ts b/x-pack/plugins/lists/server/index.ts index 250b5e79ed10..7e1283927aa8 100644 --- a/x-pack/plugins/lists/server/index.ts +++ b/x-pack/plugins/lists/server/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { PluginInitializerContext } from '../../../../src/core/server'; +import { PluginConfigDescriptor, PluginInitializerContext } from '../../../../src/core/server'; import { ConfigSchema } from './config'; import { ListPlugin } from './plugin'; @@ -19,6 +19,9 @@ export { export { ExceptionListClient } from './services/exception_lists/exception_list_client'; export type { ListPluginSetup, ListsApiRequestHandlerContext } from './types'; -export const config = { schema: ConfigSchema }; +export const config: PluginConfigDescriptor = { + deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')], + schema: ConfigSchema, +}; export const plugin = (initializerContext: PluginInitializerContext): ListPlugin => new ListPlugin(initializerContext); diff --git a/x-pack/plugins/logstash/server/index.ts b/x-pack/plugins/logstash/server/index.ts index 4606a518fa8c..33f3777297f6 100644 --- a/x-pack/plugins/logstash/server/index.ts +++ b/x-pack/plugins/logstash/server/index.ts @@ -15,4 +15,5 @@ export const config: PluginConfigDescriptor = { schema: schema.object({ enabled: schema.boolean({ defaultValue: true }), }), + deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')], }; diff --git a/x-pack/plugins/maps/server/index.ts b/x-pack/plugins/maps/server/index.ts index a884b2354b58..291bb28eed44 100644 --- a/x-pack/plugins/maps/server/index.ts +++ b/x-pack/plugins/maps/server/index.ts @@ -23,7 +23,8 @@ export const config: PluginConfigDescriptor = { preserveDrawingBuffer: true, }, schema: configSchema, - deprecations: () => [ + deprecations: ({ deprecate }) => [ + deprecate('enabled', '8.0.0'), ( completeConfig: Record, rootPath: string, diff --git a/x-pack/plugins/metrics_entities/server/index.ts b/x-pack/plugins/metrics_entities/server/index.ts index b4d35eb90f48..c8f9d81347bd 100644 --- a/x-pack/plugins/metrics_entities/server/index.ts +++ b/x-pack/plugins/metrics_entities/server/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { PluginInitializerContext } from '../../../../src/core/server'; +import { PluginConfigDescriptor, PluginInitializerContext } from '../../../../src/core/server'; import { ConfigSchema } from './config'; import { MetricsEntitiesPlugin } from './plugin'; @@ -13,7 +13,10 @@ import { MetricsEntitiesPlugin } from './plugin'; // This exports static code and TypeScript types, // as well as, Kibana Platform `plugin()` initializer. -export const config = { schema: ConfigSchema }; +export const config: PluginConfigDescriptor = { + deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')], + schema: ConfigSchema, +}; export const plugin = (initializerContext: PluginInitializerContext): MetricsEntitiesPlugin => { return new MetricsEntitiesPlugin(initializerContext); }; diff --git a/x-pack/plugins/monitoring/server/deprecations.test.js b/x-pack/plugins/monitoring/server/deprecations.test.js index 5aff34389207..fe0c1850968e 100644 --- a/x-pack/plugins/monitoring/server/deprecations.test.js +++ b/x-pack/plugins/monitoring/server/deprecations.test.js @@ -11,12 +11,13 @@ import { deprecations as deprecationsModule } from './deprecations'; // TODO: tests were not running before and are not up to date describe.skip('monitoring plugin deprecations', function () { let transformDeprecations; + const deprecate = jest.fn(() => jest.fn()); const rename = jest.fn(() => jest.fn()); const renameFromRoot = jest.fn(() => jest.fn()); const fromPath = 'monitoring'; beforeAll(function () { - const deprecations = deprecationsModule({ rename, renameFromRoot }); + const deprecations = deprecationsModule({ deprecate, rename, renameFromRoot }); transformDeprecations = (settings, fromPath, addDeprecation = noop) => { deprecations.forEach((deprecation) => deprecation(settings, fromPath, addDeprecation)); }; diff --git a/x-pack/plugins/monitoring/server/deprecations.ts b/x-pack/plugins/monitoring/server/deprecations.ts index ac1c2a0d7ac1..3554abd56958 100644 --- a/x-pack/plugins/monitoring/server/deprecations.ts +++ b/x-pack/plugins/monitoring/server/deprecations.ts @@ -18,10 +18,12 @@ import { CLUSTER_ALERTS_ADDRESS_CONFIG_KEY } from '../common/constants'; * @return {Array} array of rename operations and callback function for rename logging */ export const deprecations = ({ + deprecate, rename, renameFromRoot, }: ConfigDeprecationFactory): ConfigDeprecation[] => { return [ + deprecate('enabled', '8.0.0'), // This order matters. The "blanket rename" needs to happen at the end renameFromRoot('xpack.monitoring.max_bucket_size', 'monitoring.ui.max_bucket_size'), renameFromRoot('xpack.monitoring.min_interval_seconds', 'monitoring.ui.min_interval_seconds'), diff --git a/x-pack/plugins/observability/server/index.ts b/x-pack/plugins/observability/server/index.ts index 9a62602859c5..97a17b0d1115 100644 --- a/x-pack/plugins/observability/server/index.ts +++ b/x-pack/plugins/observability/server/index.ts @@ -9,7 +9,7 @@ /* eslint-disable @kbn/eslint/no_export_all */ import { schema, TypeOf } from '@kbn/config-schema'; -import { PluginInitializerContext } from 'src/core/server'; +import { PluginConfigDescriptor, PluginInitializerContext } from 'src/core/server'; import { ObservabilityPlugin, ObservabilityPluginSetup } from './plugin'; import { createOrUpdateIndex, Mappings } from './utils/create_or_update_index'; import { ScopedAnnotationsClient } from './lib/annotations/bootstrap_annotations'; @@ -18,9 +18,9 @@ export { rangeQuery, kqlQuery } from './utils/queries'; export * from './types'; -export const config = { +export const config: PluginConfigDescriptor = { exposeToBrowser: { - unsafe: { alertingExperience: { enabled: true }, cases: { enabled: true } }, + unsafe: true, }, schema: schema.object({ enabled: schema.boolean({ defaultValue: true }), @@ -33,6 +33,7 @@ export const config = { cases: schema.object({ enabled: schema.boolean({ defaultValue: false }) }), }), }), + deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')], }; export type ObservabilityConfig = TypeOf; diff --git a/x-pack/plugins/osquery/server/index.ts b/x-pack/plugins/osquery/server/index.ts index 30bc5ed5bd83..385515c28509 100644 --- a/x-pack/plugins/osquery/server/index.ts +++ b/x-pack/plugins/osquery/server/index.ts @@ -5,11 +5,12 @@ * 2.0. */ -import { PluginInitializerContext } from '../../../../src/core/server'; +import { PluginConfigDescriptor, PluginInitializerContext } from '../../../../src/core/server'; import { OsqueryPlugin } from './plugin'; -import { ConfigSchema } from './config'; +import { ConfigSchema, ConfigType } from './config'; -export const config = { +export const config: PluginConfigDescriptor = { + deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')], schema: ConfigSchema, exposeToBrowser: { enabled: true, diff --git a/x-pack/plugins/remote_clusters/server/config.ts b/x-pack/plugins/remote_clusters/server/config.ts index e0fadea5d41f..8f379ec5613c 100644 --- a/x-pack/plugins/remote_clusters/server/config.ts +++ b/x-pack/plugins/remote_clusters/server/config.ts @@ -18,6 +18,7 @@ export const configSchema = schema.object({ export type ConfigType = TypeOf; export const config: PluginConfigDescriptor = { + deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')], schema: configSchema, exposeToBrowser: { ui: true, diff --git a/x-pack/plugins/rollup/server/index.ts b/x-pack/plugins/rollup/server/index.ts index aa96f3ae0aac..e77e0e6f15d7 100644 --- a/x-pack/plugins/rollup/server/index.ts +++ b/x-pack/plugins/rollup/server/index.ts @@ -13,5 +13,6 @@ export const plugin = (pluginInitializerContext: PluginInitializerContext) => new RollupPlugin(pluginInitializerContext); export const config: PluginConfigDescriptor = { + deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')], schema: configSchema, }; diff --git a/x-pack/plugins/rule_registry/server/config.ts b/x-pack/plugins/rule_registry/server/config.ts index 481c5fe3cce8..62f29a9e0629 100644 --- a/x-pack/plugins/rule_registry/server/config.ts +++ b/x-pack/plugins/rule_registry/server/config.ts @@ -6,8 +6,10 @@ */ import { schema, TypeOf } from '@kbn/config-schema'; +import { PluginConfigDescriptor } from 'src/core/server'; -export const config = { +export const config: PluginConfigDescriptor = { + deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')], schema: schema.object({ enabled: schema.boolean({ defaultValue: true }), write: schema.object({ diff --git a/x-pack/plugins/saved_objects_tagging/server/config.ts b/x-pack/plugins/saved_objects_tagging/server/config.ts index f4f0bd1cf1aa..183779aa6f22 100644 --- a/x-pack/plugins/saved_objects_tagging/server/config.ts +++ b/x-pack/plugins/saved_objects_tagging/server/config.ts @@ -16,6 +16,7 @@ const configSchema = schema.object({ export type SavedObjectsTaggingConfigType = TypeOf; export const config: PluginConfigDescriptor = { + deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')], schema: configSchema, exposeToBrowser: { cache_refresh_interval: true, diff --git a/x-pack/plugins/security_solution/server/index.ts b/x-pack/plugins/security_solution/server/index.ts index 7e3da726f6eb..b72a21c0da64 100644 --- a/x-pack/plugins/security_solution/server/index.ts +++ b/x-pack/plugins/security_solution/server/index.ts @@ -20,7 +20,8 @@ export const config: PluginConfigDescriptor = { enableExperimental: true, }, schema: configSchema, - deprecations: ({ renameFromRoot }) => [ + deprecations: ({ deprecate, renameFromRoot }) => [ + deprecate('enabled', '8.0.0'), renameFromRoot('xpack.siem.enabled', 'xpack.securitySolution.enabled'), renameFromRoot( 'xpack.siem.maxRuleImportExportSize', diff --git a/x-pack/plugins/snapshot_restore/server/index.ts b/x-pack/plugins/snapshot_restore/server/index.ts index d85d03923df1..e10bffd6073d 100644 --- a/x-pack/plugins/snapshot_restore/server/index.ts +++ b/x-pack/plugins/snapshot_restore/server/index.ts @@ -12,6 +12,7 @@ import { configSchema, SnapshotRestoreConfig } from './config'; export const plugin = (ctx: PluginInitializerContext) => new SnapshotRestoreServerPlugin(ctx); export const config: PluginConfigDescriptor = { + deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')], schema: configSchema, exposeToBrowser: { slm_ui: true, diff --git a/x-pack/plugins/timelines/server/index.ts b/x-pack/plugins/timelines/server/index.ts index 8ad2bafdcc13..229a257d8f54 100644 --- a/x-pack/plugins/timelines/server/index.ts +++ b/x-pack/plugins/timelines/server/index.ts @@ -5,11 +5,12 @@ * 2.0. */ -import { PluginInitializerContext } from '../../../../src/core/server'; +import { PluginInitializerContext, PluginConfigDescriptor } from '../../../../src/core/server'; import { TimelinesPlugin } from './plugin'; -import { ConfigSchema } from './config'; +import { ConfigSchema, ConfigType } from './config'; -export const config = { +export const config: PluginConfigDescriptor = { + deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')], schema: ConfigSchema, exposeToBrowser: { enabled: true, diff --git a/x-pack/plugins/upgrade_assistant/public/plugin.ts b/x-pack/plugins/upgrade_assistant/public/plugin.ts index 974d5e03da2e..64c21997b12c 100644 --- a/x-pack/plugins/upgrade_assistant/public/plugin.ts +++ b/x-pack/plugins/upgrade_assistant/public/plugin.ts @@ -19,11 +19,7 @@ export class UpgradeAssistantUIPlugin { constructor(private ctx: PluginInitializerContext) {} setup(coreSetup: CoreSetup, { management, cloud, share }: SetupDependencies) { - const { enabled, readonly } = this.ctx.config.get(); - - if (!enabled) { - return; - } + const { readonly } = this.ctx.config.get(); const appRegistrar = management.sections.section.stack; const kibanaVersion = new SemVer(this.ctx.env.packageInfo.version); diff --git a/x-pack/plugins/upgrade_assistant/server/index.ts b/x-pack/plugins/upgrade_assistant/server/index.ts index 035a6515de15..5591276b2fa3 100644 --- a/x-pack/plugins/upgrade_assistant/server/index.ts +++ b/x-pack/plugins/upgrade_assistant/server/index.ts @@ -14,9 +14,9 @@ export const plugin = (ctx: PluginInitializerContext) => { }; export const config: PluginConfigDescriptor = { + deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')], schema: configSchema, exposeToBrowser: { - enabled: true, readonly: true, }, }; From 6fa764d6c40755c4aafe184f8dec709390ecd850 Mon Sep 17 00:00:00 2001 From: Luke Elmers Date: Wed, 15 Sep 2021 11:31:56 -0600 Subject: [PATCH 06/11] Add deprecation notices to the docs. --- docs/dev-tools/console/console.asciidoc | 1 + docs/settings/alert-action-settings.asciidoc | 1 + docs/settings/apm-settings.asciidoc | 3 ++- docs/settings/dev-settings.asciidoc | 3 +++ docs/settings/fleet-settings.asciidoc | 3 ++- .../settings/general-infra-logs-ui-settings.asciidoc | 3 ++- docs/settings/graph-settings.asciidoc | 1 + docs/settings/ml-settings.asciidoc | 3 ++- docs/settings/monitoring-settings.asciidoc | 3 ++- docs/settings/security-settings.asciidoc | 3 ++- docs/settings/spaces-settings.asciidoc | 5 +++-- docs/settings/url-drilldown-settings.asciidoc | 3 ++- docs/setup/docker.asciidoc | 2 +- docs/setup/settings.asciidoc | 12 +++++++----- docs/user/plugins.asciidoc | 4 +++- 15 files changed, 34 insertions(+), 16 deletions(-) diff --git a/docs/dev-tools/console/console.asciidoc b/docs/dev-tools/console/console.asciidoc index e1cd156e6a9e..f29ddb1a600d 100644 --- a/docs/dev-tools/console/console.asciidoc +++ b/docs/dev-tools/console/console.asciidoc @@ -134,6 +134,7 @@ shortcuts, click *Help*. [[console-settings]] === Disable Console +deprecated:[7.16.0,"In 8.0 and later, this setting will no longer be supported."] If you don’t want to use *Console*, you can disable it by setting `console.enabled` to `false` in your `kibana.yml` configuration file. Changing this setting causes the server to regenerate assets on the next startup, diff --git a/docs/settings/alert-action-settings.asciidoc b/docs/settings/alert-action-settings.asciidoc index 2086a0490d05..405cfd2dc1af 100644 --- a/docs/settings/alert-action-settings.asciidoc +++ b/docs/settings/alert-action-settings.asciidoc @@ -32,6 +32,7 @@ Be sure to back up the encryption key value somewhere safe, as your alerting rul ==== Action settings `xpack.actions.enabled`:: +deprecated:[7.16.0,"In 8.0 and later, this setting will no longer be supported."] Feature toggle that enables Actions in {kib}. If `false`, all features dependent on Actions are disabled, including the *Observability* and *Security* apps. Default: `true`. diff --git a/docs/settings/apm-settings.asciidoc b/docs/settings/apm-settings.asciidoc index ea874752eb54..916a5d92b1f4 100644 --- a/docs/settings/apm-settings.asciidoc +++ b/docs/settings/apm-settings.asciidoc @@ -46,7 +46,8 @@ Changing these settings may disable features of the APM App. [cols="2*<"] |=== | `xpack.apm.enabled` - | Set to `false` to disable the APM app. Defaults to `true`. + | deprecated:[7.16.0,"In 8.0 and later, this setting will no longer be supported."] + Set to `false` to disable the APM app. Defaults to `true`. | `xpack.apm.maxServiceEnvironments` | Maximum number of unique service environments recognized by the UI. Defaults to `100`. diff --git a/docs/settings/dev-settings.asciidoc b/docs/settings/dev-settings.asciidoc index b7edf36851d9..bcf4420cdadc 100644 --- a/docs/settings/dev-settings.asciidoc +++ b/docs/settings/dev-settings.asciidoc @@ -13,6 +13,7 @@ They are enabled by default. ==== Grok Debugger settings `xpack.grokdebugger.enabled` {ess-icon}:: +deprecated:[7.16.0,"In 8.0 and later, this setting will no longer be supported."] Set to `true` to enable the <>. Defaults to `true`. @@ -21,6 +22,7 @@ Set to `true` to enable the <>. Defaults to `t ==== {searchprofiler} settings `xpack.searchprofiler.enabled`:: +deprecated:[7.16.0,"In 8.0 and later, this setting will no longer be supported."] Set to `true` to enable the <>. Defaults to `true`. [float] @@ -28,4 +30,5 @@ Set to `true` to enable the <>. Defaults to `tr ==== Painless Lab settings `xpack.painless_lab.enabled`:: +deprecated:[7.16.0,"In 8.0 and later, this setting will no longer be supported."] When set to `true`, enables the <>. Defaults to `true`. diff --git a/docs/settings/fleet-settings.asciidoc b/docs/settings/fleet-settings.asciidoc index 734c87aab204..f5c69e0c865f 100644 --- a/docs/settings/fleet-settings.asciidoc +++ b/docs/settings/fleet-settings.asciidoc @@ -21,7 +21,8 @@ See the {fleet-guide}/index.html[{fleet}] docs for more information. [cols="2*<"] |=== | `xpack.fleet.enabled` {ess-icon} - | Set to `true` (default) to enable {fleet}. + | deprecated:[7.16.0,"In 8.0 and later, this setting will no longer be supported."] + Set to `true` (default) to enable {fleet}. | `xpack.fleet.agents.enabled` {ess-icon} | Set to `true` (default) to enable {fleet}. |=== diff --git a/docs/settings/general-infra-logs-ui-settings.asciidoc b/docs/settings/general-infra-logs-ui-settings.asciidoc index 2a9d4df1ff43..282239dcf166 100644 --- a/docs/settings/general-infra-logs-ui-settings.asciidoc +++ b/docs/settings/general-infra-logs-ui-settings.asciidoc @@ -1,7 +1,8 @@ [cols="2*<"] |=== | `xpack.infra.enabled` - | Set to `false` to disable the Logs and Metrics app plugin {kib}. Defaults to `true`. + | deprecated:[7.16.0,"In 8.0 and later, this setting will no longer be supported."] + Set to `false` to disable the Logs and Metrics app plugin {kib}. Defaults to `true`. | `xpack.infra.sources.default.logAlias` | Index pattern for matching indices that contain log data. Defaults to `filebeat-*,kibana_sample_data_logs*`. To match multiple wildcard patterns, use a comma to separate the names, with no space after the comma. For example, `logstash-app1-*,default-logs-*`. diff --git a/docs/settings/graph-settings.asciidoc b/docs/settings/graph-settings.asciidoc index 093edb0d0854..793a8aae7315 100644 --- a/docs/settings/graph-settings.asciidoc +++ b/docs/settings/graph-settings.asciidoc @@ -8,4 +8,5 @@ You do not need to configure any settings to use the {graph-features}. `xpack.graph.enabled` {ess-icon}:: +deprecated:[7.16.0,"In 8.0 and later, this setting will no longer be supported."] Set to `false` to disable the {graph-features}. diff --git a/docs/settings/ml-settings.asciidoc b/docs/settings/ml-settings.asciidoc index 92d0c0b491ce..59fa236e0827 100644 --- a/docs/settings/ml-settings.asciidoc +++ b/docs/settings/ml-settings.asciidoc @@ -14,7 +14,8 @@ enabled by default. [cols="2*<"] |=== | `xpack.ml.enabled` {ess-icon} - | Set to `true` (default) to enable {kib} {ml-features}. + + | deprecated:[7.16.0,"In 8.0 and later, this setting will no longer be supported."] + Set to `true` (default) to enable {kib} {ml-features}. + + If set to `false` in `kibana.yml`, the {ml} icon is hidden in this {kib} instance. If `xpack.ml.enabled` is set to `true` in `elasticsearch.yml`, however, diff --git a/docs/settings/monitoring-settings.asciidoc b/docs/settings/monitoring-settings.asciidoc index 31148f0abf4e..03c11007c64c 100644 --- a/docs/settings/monitoring-settings.asciidoc +++ b/docs/settings/monitoring-settings.asciidoc @@ -32,7 +32,8 @@ For more information, see [cols="2*<"] |=== | `monitoring.enabled` - | Set to `true` (default) to enable the {monitor-features} in {kib}. Unlike the + | deprecated:[7.16.0,"In 8.0 and later, this setting will no longer be supported."] + Set to `true` (default) to enable the {monitor-features} in {kib}. Unlike the <> setting, when this setting is `false`, the monitoring back-end does not run and {kib} stats are not sent to the monitoring cluster. diff --git a/docs/settings/security-settings.asciidoc b/docs/settings/security-settings.asciidoc index 69f255f36105..5e4b267c0f4d 100644 --- a/docs/settings/security-settings.asciidoc +++ b/docs/settings/security-settings.asciidoc @@ -15,7 +15,8 @@ You do not need to configure any additional settings to use the [cols="2*<"] |=== | `xpack.security.enabled` - | By default, {kib} automatically detects whether to enable the + | deprecated:[7.16.0,"In 8.0 and later, this setting will no longer be supported."] + By default, {kib} automatically detects whether to enable the {security-features} based on the license and whether {es} {security-features} are enabled. + + diff --git a/docs/settings/spaces-settings.asciidoc b/docs/settings/spaces-settings.asciidoc index 3b643f76f0c0..8504464da1df 100644 --- a/docs/settings/spaces-settings.asciidoc +++ b/docs/settings/spaces-settings.asciidoc @@ -15,8 +15,9 @@ roles when Security is enabled. [cols="2*<"] |=== | `xpack.spaces.enabled` - | Set to `true` (default) to enable Spaces in {kib}. - This setting is deprecated. Starting in 8.0, it will not be possible to disable this plugin. + | deprecated:[7.16.0,"In 8.0 and later, this setting will no longer be supported."] + Set to `true` (default) to enable Spaces in {kib}. + This setting is deprecated. Starting in 8.0, it will not be possible to disable this plugin. | `xpack.spaces.maxSpaces` | The maximum amount of Spaces that can be used with this instance of {kib}. Some operations diff --git a/docs/settings/url-drilldown-settings.asciidoc b/docs/settings/url-drilldown-settings.asciidoc index 8be3a21bfbff..ca414d4f650e 100644 --- a/docs/settings/url-drilldown-settings.asciidoc +++ b/docs/settings/url-drilldown-settings.asciidoc @@ -9,7 +9,8 @@ Configure the URL drilldown settings in your `kibana.yml` configuration file. [cols="2*<"] |=== | [[url-drilldown-enabled]] `url_drilldown.enabled` - | When `true`, enables URL drilldowns on your {kib} instance. + | deprecated:[7.16.0,"In 8.0 and later, this setting will no longer be supported."] + When `true`, enables URL drilldowns on your {kib} instance. | [[external-URL-policy]] `externalUrl.policy` | Configures the external URL policies. URL drilldowns respect the global *External URL* service, which you can use to deny or allow external URLs. diff --git a/docs/setup/docker.asciidoc b/docs/setup/docker.asciidoc index cc14e79c54f1..01fc6e2e76f9 100644 --- a/docs/setup/docker.asciidoc +++ b/docs/setup/docker.asciidoc @@ -125,7 +125,7 @@ Some example translations are shown here: **Environment Variable**:: **Kibana Setting** `SERVER_NAME`:: `server.name` `SERVER_BASEPATH`:: `server.basePath` -`MONITORING_ENABLED`:: `monitoring.enabled` +`ELASTICSEARCH_HOSTS`:: `elasticsearch.hosts` In general, any setting listed in <> can be configured with this technique. diff --git a/docs/setup/settings.asciidoc b/docs/setup/settings.asciidoc index e8d0b4b593c3..2f4fd4d052da 100644 --- a/docs/setup/settings.asciidoc +++ b/docs/setup/settings.asciidoc @@ -21,7 +21,8 @@ configuration using `${MY_ENV_VAR}` syntax. |=== | `console.enabled:` - | Toggling this causes the server to regenerate assets on the next startup, + | deprecated:[7.16.0,"In 8.0 and later, this setting will no longer be supported."] +Toggling this causes the server to regenerate assets on the next startup, which may cause a delay before pages start being served. Set to `false` to disable Console. *Default: `true`* @@ -794,12 +795,13 @@ sources and images. When false, Vega can only get data from {es}. *Default: `fal | Enables you to view the underlying documents in a data series from a dashboard panel. *Default: `false`* | `xpack.license_management.enabled` - | Set this value to false to -disable the License Management UI. *Default: `true`* + | deprecated:[7.16.0,"In 8.0 and later, this setting will no longer be supported."] +Set this value to false to disable the License Management UI. +*Default: `true`* | `xpack.rollup.enabled:` - | Set this value to false to disable the -Rollup UI. *Default: true* + | deprecated:[7.16.0,"In 8.0 and later, this setting will no longer be supported."] +Set this value to false to disable the Rollup UI. *Default: true* | `i18n.locale` {ess-icon} | Set this value to change the {kib} interface language. diff --git a/docs/user/plugins.asciidoc b/docs/user/plugins.asciidoc index 0ef5d1a23751..c604526d6c93 100644 --- a/docs/user/plugins.asciidoc +++ b/docs/user/plugins.asciidoc @@ -149,6 +149,8 @@ NOTE: Removing a plugin will result in an "optimize" run which will delay the ne [[disable-plugin]] == Disable plugins +deprecated:[7.16.0,"In 8.0 and later, this setting will only be supported for a subset of plugins that have opted in to the behavior."] + Use the following command to disable a plugin: [source,shell] @@ -158,7 +160,7 @@ Use the following command to disable a plugin: NOTE: Disabling or enabling a plugin will result in an "optimize" run which will delay the start of {kib}. -<1> You can find a plugin's plugin ID as the value of the `name` property in the plugin's `package.json` file. +<1> You can find a plugin's plugin ID as the value of the `name` property in the plugin's `kibana.json` file. [float] [[configure-plugin-manager]] From 0baca69716eb599fde604eb25aab90373258881b Mon Sep 17 00:00:00 2001 From: Luke Elmers Date: Mon, 20 Sep 2021 12:06:24 -0600 Subject: [PATCH 07/11] Bump stdout maxListeners in legacy logging. --- packages/kbn-legacy-logging/src/setup_logging.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/kbn-legacy-logging/src/setup_logging.ts b/packages/kbn-legacy-logging/src/setup_logging.ts index 800ed2e52327..a5b51f191a35 100644 --- a/packages/kbn-legacy-logging/src/setup_logging.ts +++ b/packages/kbn-legacy-logging/src/setup_logging.ts @@ -23,7 +23,7 @@ export async function setupLogging( // thrown every time we start the server. // In order to keep using the legacy logger until we remove it I'm just adding // a new hard limit here. - process.stdout.setMaxListeners(40); + process.stdout.setMaxListeners(55); return await server.register({ plugin: good, From 1541ff13701a09f56259383f7cc56ec84a0e4cf3 Mon Sep 17 00:00:00 2001 From: Luke Elmers Date: Tue, 21 Sep 2021 13:58:44 -0600 Subject: [PATCH 08/11] Remove duplicate UA entry. --- packages/kbn-config/src/config_service.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/kbn-config/src/config_service.ts b/packages/kbn-config/src/config_service.ts index 207f400128ac..5883ce8ab513 100644 --- a/packages/kbn-config/src/config_service.ts +++ b/packages/kbn-config/src/config_service.ts @@ -190,9 +190,7 @@ export class ConfigService { ], }, }; - this.addDeprecationProvider(namespace, () => [ - (settings, fromPath, addDeprecation) => addDeprecation(deprecatedConfigDetails), - ]); + this.deprecationLog.warn(deprecatedConfigDetails.message); this.markDeprecatedConfigAsHandled(namespace, deprecatedConfigDetails); } From aa279ba0267a3fc55704fb5c39e4b1563dbaa0c9 Mon Sep 17 00:00:00 2001 From: Luke Elmers Date: Tue, 21 Sep 2021 13:59:09 -0600 Subject: [PATCH 09/11] Bump legacy logging maxListeners for 7.x branch. --- packages/kbn-legacy-logging/src/setup_logging.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/kbn-legacy-logging/src/setup_logging.ts b/packages/kbn-legacy-logging/src/setup_logging.ts index a5b51f191a35..a045469e8125 100644 --- a/packages/kbn-legacy-logging/src/setup_logging.ts +++ b/packages/kbn-legacy-logging/src/setup_logging.ts @@ -23,7 +23,7 @@ export async function setupLogging( // thrown every time we start the server. // In order to keep using the legacy logger until we remove it I'm just adding // a new hard limit here. - process.stdout.setMaxListeners(55); + process.stdout.setMaxListeners(60); return await server.register({ plugin: good, From 452194b46f3113f0a1ca4f2584d460efc2f6d240 Mon Sep 17 00:00:00 2001 From: Luke Elmers Date: Wed, 22 Sep 2021 11:17:11 -0600 Subject: [PATCH 10/11] Fix typo in deprecation factory. --- .../kbn-config/src/deprecation/deprecation_factory.test.ts | 4 ++-- packages/kbn-config/src/deprecation/deprecation_factory.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/kbn-config/src/deprecation/deprecation_factory.test.ts b/packages/kbn-config/src/deprecation/deprecation_factory.test.ts index 8031508a3ad4..385c5285ac57 100644 --- a/packages/kbn-config/src/deprecation/deprecation_factory.test.ts +++ b/packages/kbn-config/src/deprecation/deprecation_factory.test.ts @@ -266,7 +266,7 @@ describe('DeprecationFactory', () => { "Remove \\"myplugin.deprecated\\" from the config.", ], }, - "message": "Setting \\"$myplugin.deprecated\\" has been replaced by \\"$myplugin.renamed\\". However, both keys are present. Ignoring \\"$myplugin.deprecated\\"", + "message": "Setting \\"myplugin.deprecated\\" has been replaced by \\"myplugin.renamed\\". However, both keys are present. Ignoring \\"$myplugin.deprecated\\"", "title": "Setting \\"myplugin.deprecated\\" is deprecated", }, ], @@ -403,7 +403,7 @@ describe('DeprecationFactory', () => { "Remove \\"myplugin.deprecated\\" from the config.", ], }, - "message": "Setting \\"$myplugin.deprecated\\" has been replaced by \\"$myplugin.renamed\\". However, both keys are present. Ignoring \\"$myplugin.deprecated\\"", + "message": "Setting \\"myplugin.deprecated\\" has been replaced by \\"myplugin.renamed\\". However, both keys are present. Ignoring \\"$myplugin.deprecated\\"", "title": "Setting \\"myplugin.deprecated\\" is deprecated", }, ], diff --git a/packages/kbn-config/src/deprecation/deprecation_factory.ts b/packages/kbn-config/src/deprecation/deprecation_factory.ts index e7496c84f4c6..29e99b5df767 100644 --- a/packages/kbn-config/src/deprecation/deprecation_factory.ts +++ b/packages/kbn-config/src/deprecation/deprecation_factory.ts @@ -98,7 +98,7 @@ const _rename = ( title: getDeprecationTitle(fullOldPath), message: i18n.translate('kbnConfig.deprecations.conflictSettingMessage', { defaultMessage: - 'Setting "${fullOldPath}" has been replaced by "${fullNewPath}". However, both keys are present. Ignoring "${fullOldPath}"', + 'Setting "{fullOldPath}" has been replaced by "{fullNewPath}". However, both keys are present. Ignoring "${fullOldPath}"', values: { fullOldPath, fullNewPath }, }), correctiveActions: { From e608e85af46d3585d38c4432daa5f41a7389b470 Mon Sep 17 00:00:00 2001 From: Luke Elmers Date: Wed, 22 Sep 2021 11:51:28 -0600 Subject: [PATCH 11/11] Fix missed typo --- .../kbn-config/src/deprecation/deprecation_factory.test.ts | 4 ++-- packages/kbn-config/src/deprecation/deprecation_factory.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/kbn-config/src/deprecation/deprecation_factory.test.ts b/packages/kbn-config/src/deprecation/deprecation_factory.test.ts index 385c5285ac57..dfd6b8fac681 100644 --- a/packages/kbn-config/src/deprecation/deprecation_factory.test.ts +++ b/packages/kbn-config/src/deprecation/deprecation_factory.test.ts @@ -266,7 +266,7 @@ describe('DeprecationFactory', () => { "Remove \\"myplugin.deprecated\\" from the config.", ], }, - "message": "Setting \\"myplugin.deprecated\\" has been replaced by \\"myplugin.renamed\\". However, both keys are present. Ignoring \\"$myplugin.deprecated\\"", + "message": "Setting \\"myplugin.deprecated\\" has been replaced by \\"myplugin.renamed\\". However, both keys are present. Ignoring \\"myplugin.deprecated\\"", "title": "Setting \\"myplugin.deprecated\\" is deprecated", }, ], @@ -403,7 +403,7 @@ describe('DeprecationFactory', () => { "Remove \\"myplugin.deprecated\\" from the config.", ], }, - "message": "Setting \\"myplugin.deprecated\\" has been replaced by \\"myplugin.renamed\\". However, both keys are present. Ignoring \\"$myplugin.deprecated\\"", + "message": "Setting \\"myplugin.deprecated\\" has been replaced by \\"myplugin.renamed\\". However, both keys are present. Ignoring \\"myplugin.deprecated\\"", "title": "Setting \\"myplugin.deprecated\\" is deprecated", }, ], diff --git a/packages/kbn-config/src/deprecation/deprecation_factory.ts b/packages/kbn-config/src/deprecation/deprecation_factory.ts index 29e99b5df767..1d61733715bd 100644 --- a/packages/kbn-config/src/deprecation/deprecation_factory.ts +++ b/packages/kbn-config/src/deprecation/deprecation_factory.ts @@ -98,7 +98,7 @@ const _rename = ( title: getDeprecationTitle(fullOldPath), message: i18n.translate('kbnConfig.deprecations.conflictSettingMessage', { defaultMessage: - 'Setting "{fullOldPath}" has been replaced by "{fullNewPath}". However, both keys are present. Ignoring "${fullOldPath}"', + 'Setting "{fullOldPath}" has been replaced by "{fullNewPath}". However, both keys are present. Ignoring "{fullOldPath}"', values: { fullOldPath, fullNewPath }, }), correctiveActions: {