diff --git a/docs/dev-tools/console/console.asciidoc b/docs/dev-tools/console/console.asciidoc index e1cd156e6a9e4..f29ddb1a600db 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 050d14e4992d6..91e6b379a0620 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 67de6f8d24960..d812576878f2b 100644 --- a/docs/settings/apm-settings.asciidoc +++ b/docs/settings/apm-settings.asciidoc @@ -41,7 +41,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 b7edf36851d91..bcf4420cdadca 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 3411f39309709..bf5c84324b0b9 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 2a9d4df1ff43c..282239dcf166c 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 093edb0d08547..793a8aae73158 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 92d0c0b491ce7..59fa236e08275 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 31148f0abf4e1..03c11007c64c4 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 455ee76deefe3..906af1dfbb28e 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 3b643f76f0c09..8504464da1dfb 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 8be3a21bfbffc..ca414d4f650e9 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 cc14e79c54f15..01fc6e2e76f92 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 78b776c85c937..c098fb697de04 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`* @@ -706,12 +707,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 0ef5d1a237510..c604526d6c933 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]] diff --git a/packages/kbn-config/src/config_service.test.ts b/packages/kbn-config/src/config_service.test.ts index aa520e7189e54..754de1c0a99f5 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 the Kibana config file, CLI flag, or environment variable (in Docker only) before upgrading to 8.0.0.", + ], + }, + "message": "Configuring \\"foo.enabled\\" is deprecated and will be removed in 8.0.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 514992891ad1b..5883ce8ab513c 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: `Configuring "${deprecationPath}" is deprecated and will be removed in 8.0.0.`, + correctiveActions: { + manualSteps: [ + `Remove "${deprecationPath}" from the Kibana config file, CLI flag, or environment variable (in Docker only) before upgrading to 8.0.0.`, + ], + }, + }; + this.deprecationLog.warn(deprecatedConfigDetails.message); + 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[]) => { diff --git a/packages/kbn-config/src/deprecation/deprecation_factory.test.ts b/packages/kbn-config/src/deprecation/deprecation_factory.test.ts index 0a605cbc1c532..dfd6b8fac681f 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 = { @@ -132,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", }, ], @@ -269,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 119b9b11237dc..1d61733715bd9 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, @@ -67,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: { @@ -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 0e1f36121e50e..47a31b9e6725a 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/packages/kbn-legacy-logging/src/setup_logging.ts b/packages/kbn-legacy-logging/src/setup_logging.ts index 800ed2e523274..a045469e81251 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(60); return await server.register({ plugin: good, diff --git a/src/plugins/apm_oss/server/index.ts b/src/plugins/apm_oss/server/index.ts index bf6baf1876074..f2f6777672e33 100644 --- a/src/plugins/apm_oss/server/index.ts +++ b/src/plugins/apm_oss/server/index.ts @@ -10,7 +10,8 @@ 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'), ]; diff --git a/src/plugins/console/server/index.ts b/src/plugins/console/server/index.ts index 736a7e1ae3c97..cd05652c62838 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/src/plugins/vis_types/pie/config.ts b/src/plugins/vis_types/pie/config.ts new file mode 100644 index 0000000000000..b831d26854c30 --- /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 201071fbb5fca..1e92bedb3d11c 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 9a0a3418d72db..99e25a4eba632 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 0000000000000..b831d26854c30 --- /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 1666a346e3482..1606af5944ad3 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 0000000000000..9dfa405ee27b8 --- /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 0000000000000..5cb0687cf1889 --- /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 f1f65b6218e82..ab3f3d1252ed8 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" }, diff --git a/x-pack/plugins/apm/server/index.ts b/x-pack/plugins/apm/server/index.ts index 6ba412bd22029..2c21ff17f779b 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 5e433b46b80e5..ad76724eb49f7 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 4b83071bf473a..2cc413178c3ae 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 b1803950614d8..a6a3ec0fe5753 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 2706da22d108b..b765f1fcaf6fa 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 ecd068c8bdbd9..dae584a883bd7 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 05ad8a9a9c83f..accd5e040f4f0 100644 --- a/x-pack/plugins/fleet/server/index.ts +++ b/x-pack/plugins/fleet/server/index.ts @@ -42,7 +42,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 10ddca631a898..528e122da9a4d 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 e90518dbfa357..1f8b01913fd3e 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 507401398a407..14b67e2ffd581 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 de445affc178e..b77b81cf41ee1 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 08f1eb1562739..e2117506e9b72 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 7a24845c981e9..e78ffe07b50c0 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 250b5e79ed109..7e1283927aa86 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 4606a518fa8c5..33f3777297f63 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 b57f9ec9c29b1..603273efe0d95 100644 --- a/x-pack/plugins/maps/server/index.ts +++ b/x-pack/plugins/maps/server/index.ts @@ -22,7 +22,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 b4d35eb90f486..c8f9d81347bdb 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 2931f704a4478..4c12979e97804 100644 --- a/x-pack/plugins/monitoring/server/deprecations.test.js +++ b/x-pack/plugins/monitoring/server/deprecations.test.js @@ -10,12 +10,13 @@ import { deprecations as deprecationsModule } from './deprecations'; describe('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 3e4d1627b0ae2..cb09bbdb5a87c 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 9a62602859c54..97a17b0d11153 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 30bc5ed5bd835..385515c285093 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 e0fadea5d41f7..8f379ec5613c8 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 aa96f3ae0aac3..e77e0e6f15d72 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 481c5fe3cce8b..62f29a9e06294 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 f4f0bd1cf1aa0..183779aa6f229 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 7e3da726f6ebe..b72a21c0da643 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 d85d03923df1f..e10bffd6073d2 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 8ad2bafdcc13a..229a257d8f549 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 3aa712573f0c2..5edb638e1bc5b 100644 --- a/x-pack/plugins/upgrade_assistant/public/plugin.ts +++ b/x-pack/plugins/upgrade_assistant/public/plugin.ts @@ -17,11 +17,7 @@ export class UpgradeAssistantUIPlugin { constructor(private ctx: PluginInitializerContext) {} setup(coreSetup: CoreSetup, { management, cloud }: 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 035a6515de152..5591276b2fa34 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, }, };