Skip to content
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

Gracefully handle deprecated core API's #119866

Closed
1 of 6 tasks
TinaHeiligers opened this issue Nov 29, 2021 · 5 comments · Fixed by #127744
Closed
1 of 6 tasks

Gracefully handle deprecated core API's #119866

TinaHeiligers opened this issue Nov 29, 2021 · 5 comments · Fixed by #127744
Labels
Feature:Legacy Removal Issues related to removing legacy Kibana impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:small Small Level of Effort Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc technical debt Improvement of the software architecture and operational architecture

Comments

@TinaHeiligers
Copy link
Contributor

TinaHeiligers commented Nov 29, 2021

A number of core API's were deprecated during the 7.x series and we need to come up with a plan to eventually remove them.
Before we can do that, in the interests of backward compatibility, we need to ensure that the deprecated API's are not being used.

In #77997, we identified the following API's that need to be tracked and monitored for usage:

track and Monitor:

In src/core/server/*:

In src/core/public/*:

Scope:

  • Identify where the APIs are used
  • Remove 'em (or create a task for codeowners to remove)
@TinaHeiligers TinaHeiligers added Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc loe:needs-research This issue requires some research before it can be worked on or estimated technical debt Improvement of the software architecture and operational architecture impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. Feature:Legacy Removal Issues related to removing legacy Kibana labels Nov 29, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-core (Team:Core)

@exalate-issue-sync exalate-issue-sync bot added loe:small Small Level of Effort and removed loe:needs-research This issue requires some research before it can be worked on or estimated labels Nov 30, 2021
@TinaHeiligers
Copy link
Contributor Author

TinaHeiligers commented Dec 1, 2021

Audit results:

httpServiceSetup.auth doesn’t appear to be used directly but we need to clean up the types:
HttpServiceStart and HttpServiceSetup are still coupled so removing auth from the setup contract type will also remove it from start.

IRenderOptions.vars is used to [add RUM config] (https://github.com/elastic/kibana/blob/main/src/core/server/http_resources/http_resources_service.ts#L98-L100) added in (#92784)

CoreSetup.injectedMetadata and CoreStart.injectedMetadata are still being used extensively throughout core (also in bootstrap) and the following plugins:

Since these deprecations don't have a fixed date for removal (yet), we need to consider if it's worth following through on the deprecations and eventually sunset them or keep the support and remove the deprecation.

@TinaHeiligers TinaHeiligers self-assigned this Dec 1, 2021
@lukeelmers
Copy link
Member

After discussing, we decided the scope here will be:

  • adding @removeBy to each of the APIs so we can get a report of who is using the deprecated APIs in the docs (see Remove unreferenced deprecated APIs #121823)
  • create a list of any items that aren't explicitly marked as deprecated yet so we can decide whether to deprecate them

@TinaHeiligers TinaHeiligers assigned afharo and unassigned TinaHeiligers Mar 7, 2022
@afharo afharo assigned TinaHeiligers and unassigned afharo and TinaHeiligers Mar 7, 2022
@afharo
Copy link
Member

afharo commented Mar 8, 2022

From #121956, we've identified 2 additional APIs that are deprecated but still used. Although TS wouldn't catch it for different reasons:

IHttpFetchError.res

Attempt to remove it: #127059
Not removed because it's actually used (refer to the PR from above for the list). However, TS doesn't realize because it's used in the error handling of a few try/catch, and TS treats the err object in the catch as any.

PluginManifest.extraPublicDirs

It's used by @kbn/optimizer. It was created as deprecated straight away because the intention is to replace it with something else in the future. However, at the moment, there are no short-term plans to replace it.

@afharo
Copy link
Member

afharo commented Mar 15, 2022

I created #127744 to:

  1. add the @removeBy tags to the deprecated but still used, and there's an alternative
  2. add the link to the issue that should be tackled to provide an alternative so we can set the @removeBy label
  3. Create issues for the unused APIs to track their removal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Legacy Removal Issues related to removing legacy Kibana impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:small Small Level of Effort Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc technical debt Improvement of the software architecture and operational architecture
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants