-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Whitelist 'enabled' config for Platform plugins #58713
Comments
Pinging @elastic/kibana-platform (Team:Platform) |
to note: In LP we require a plugin to define it explicitly, fallback to the deault schema otherwise kibana/src/legacy/plugin_discovery/plugin_config/schema.js Lines 28 to 32 in 8e9a8a8
|
On second thought, should @elastic/kibana-app-arch do you have any thoughts on this? Is there any valid reason we would want to disable some of the more "core" plugins? The only thing I can think of is for testing a slimmer Kibana for some reason. |
Kibana would be pretty useless without the
This is the only valid reason I can think of as well, and I believe it is an approach APM uses in testing. But I would argue that it might actually make life easier for folks in this scenario, because it would prevent them from accidentally disabling a plugin that was somewhere in My vote would be to stick with the legacy platform approach of requiring all plugins to have an |
This is where I'm leaning as well, though I'd like to make it a bit less confusing than legacy and not provide a default schema at all if none is specified. The only downside I can think of to this approach is documenting the If we do go with this approach, there's really no work to do here in Core itself. It is up to plugins to make sure their config schema includes Alternatively, we could add the export const config = {
schema: schema.object({
enabled: schema.oneOf([true], { defaultValue: true })
})
} The code in Core would look something like (some of these APIs don't currently exist): if (!plugin.config.schema.includes('enabled')) {
plugin.config.schema.extend({
enabled: schema.boolean({ defaultValue: true })
});
} |
+1 for that. |
Let's do this: go with what we have now (require plugins to specify this option explicitly) and later work on improving the DX here in the future (by implementing a bit more magic as proposed above). |
I want to note that the NP actually does mirror the legacy behavior here: if no config schema is specified at all, plugins still have an implicit However this value is not exposed to plugins (not particularly useful anyways). |
Just wanted to note for posterity that this no longer appears to be the case. Currently, setting If kibana/packages/kbn-config/src/config_service.ts Lines 177 to 183 in 237256a
However, the So at this point, the only reason for a plugin to specify EDIT: Josh has helpfully clarified in #89584 (comment) that the implicit config is in fact added, but only when there isn't a config schema to begin with (key words I missed above are |
If a plugin doesn't explicitly define an
enabled
config schema, then disabling the plugin inkibana.yml
will throw a validation error.The text was updated successfully, but these errors were encountered: