-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Kibana deprecation API shouldn't default level
to critical
#114197
Comments
Pinging @elastic/kibana-core (Team:Core) |
@cjcenizal So basically you are proposing that we make These are the current kibana/packages/kbn-config/src/deprecation/types.ts Lines 22 to 45 in 58bab91
|
Correct. |
It does make sense imho. Such significant fields should always be explicitly specified instead of allowing to fallback to an opinionated default. |
Yeah agree, this makes sense to me too, just wanted to make sure I wasn't missing something. I'll add it to our list so we can discuss if it's possible to squeeze in. Wrangling all of the codeowners will be the tedious part here; changing the service is straightforward. |
@pgayvallet @lukeelmers To me, the primary goal is to ensure that every deprecation that's been registered as critical really does need to be critical. Which implies that this process should include some kind of review or audit. Theoretically, we could say that a deprecation that's been registered with the wrong level is a bug, so could be fixed after FF. Can we approach this on two tracks?
Critical vs warningDevs will also need to know how to decide whether a deprecation is critical or warning.
|
Thanks @cjcenizal -- was just going to ping you today to suggest something similar 🙂 Right now it doesn't look like we'll be able to fit in the work to make the field required instead of optional in time for feature freeze, mainly due to the need to coordinate with all teams. So I'm +1 on your suggestion to start by pinging every team to do an audit and decide for themselves whether a We will then take changing the default as a follow-up task. @pgayvallet As you are working through the other changes to the deprecation API, would you be willing to create a separate issue that we can use to ping all of the affected teams (since I think you said you already had an inventory of them)? Then we can keep the scope of this issue focused on changing the default, and slot it in for sometime in the near-ish future. |
Sure, will do. Just a few comments and a question first. Note that I only have a list of non-factory Here, we'll also need the inventory of features deprecations registered via the Hardest part is the current divergence in term of deprecations between We have a remaining question here: Should we also enforce every factory-based (e.g e.g, atm, an export const config: PluginConfigDescriptor<ConfigType> = {
schema,
deprecations: ({ unused }) => [
unused('ssl'),
],
}; it's currently possible to define the export const config: PluginConfigDescriptor<ConfigType> = {
schema,
deprecations: ({ unused }) => [
unused('ssl', { level: 'warning' }),
],
}; do we want to also make |
@pgayvallet Thanks for outlining your approach. Great question. Given that our goal is to double-check all critical deprecations and re-level any that should be warnings, I think we do want to make level mandatory for all factory-based deprecations. In terms of DX, I could imagine someone making the case that developers will benefit from factory-specific defaults, and that they could intuit the default level value should be critical given that these factories imply hard breaking changes. But TBH I haven’t used them enough to be confident to make that case myself, so I fall back on the weaker argument of striving for consistency: if level is mandatory in one place it should be mandatory everywhere. |
Yea, it all depends on the target version (the version we're planning to effectively remove the config setting) e.g
in |
Yep 💯 -- While I much prefer the DX of not having to specify a level, it feels like we won't really have much of a choice but to make it required for the factory-based deprecations as well. Otherwise there will always be a scenario where the level is either too "low" or too "high", depending on the branch. |
Created #115344 to track adding |
Per https://github.com/elastic/kibana/blob/master/src/core/server/deprecations/deprecations_service.ts#L190, deprecations default to
level: critical
if one isn't provided.Default values are unhelpful in this case, because we want the consumer to be very thoughtful and deliberate when choosing whether a deprecation should be critical (thereby blocking the upgrade) or a warning (thereby optional). A default value makes it easy for developers to overlook this important decision. In contrast, forcing developers to be explicit about the
level
will nudge them to consider which level is most appropriate for the deprecation.The text was updated successfully, but these errors were encountered: