-
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
[core.http] Support Warning
headers for deprecated http routes
#105692
Comments
Pinging @elastic/kibana-core (Team:Core) |
To clarify in the functional requirements:
Should it be integrated with Upgrade Assistant? Telemetry?
Should the message be i18n?
In addition to the depreciation, we should document the URL versioning policy. Kibana used to rely on URL versioning ( |
A long-time ago, the decision was made that we shouldn't be versioning our HTTP APIs using URLs, and they should be versioned along with the Stack version. I'm all for reopening this discussion, as this approach is rather cumbersome in some situations, especially when we only want to change the HTTP response format. However, I think we need to have this discussion separately and include the Elasticsearch team, so we have consistency. |
Yes, I could see a possible integration with upgrade assistant and/or telemetry. It would be cool to surface warnings in upgrade assistant if we've detected any external (non-Elastic) uses of deprecated routes. And for internal usage of deprecated routes, perhaps we could log a warning to the browser console while in dev mode or automate warnings to the server logs (though it could get a bit chatty)
IMHO I would treat this the same way as we treat our server logs and not handle i18n. If apps want to take the error and display it to users, they could still handle the i18n on the client.
Yeah agreed - I intentionally left versioning out of this as I think it's a different (albeit related) issue. |
I created #117241 to track the need for UA to surface Kibana deprecation logs to support this type of functionality. |
Looks like the @elastic/es-core-infra Does ES plan to continue using |
Such a shame the header's not an option anymore. We really need to come up with a standard way to warn about deprecated HTTP routes. |
Here's a little more info about the deprecation:
Sorry we missed the ping. We were not aware of this deprecation, nor do we have any current plans regarding it. |
With respect to how this is ultimately represented in the generated openAPI specification, we'd want to use the |
deprecations to be handled under the #179467 |
Things have evolved quite a bit since that issue was opened, especially given the work we've been performing on OAS generation. We may want to add a header surfacing this information later, but it will be in a different form, and when we'll want it, this should naturallu resurface in our discussions, so I'll go ahead and close this one. |
To future proof this we might want to adopt the draft deprecation header https://datatracker.ietf.org/doc/html/draft-ietf-httpapi-deprecation-header While we typically deprecate a whole API path, it's possible that a single resource in an API is deprecated. E.g. the feature privileges API might not be deprecated, but it's possible to access a deprecated feature id (resource). This remains a lower priority item. At this time we believe deprecation notices in upgrade assistant are more likely to be picked up and fixed by users than headers returned to clients. But if possible it would be nice to release this in 8.last |
As discussed offline, Core will support two response headers for deprecated http routes: warning and sunsetting. These will be introduced during the 9.x series as part of Maturing our HTTP API layer. (issue to be created) We'll also be adding headers to http stability #179170 |
Tasks:
Potentially add a request/response lifecycle hook to add the header (TBD) |
Currently there isn't a great way for clients to understand that an http route has been deprecated:
Elasticsearch solves this problem with a
Warning
header that includes a299
miscellaneous warn code and follows the RFC7234 spec for warning headers.Example:
Warning: 299 Elasticsearch-8.0.0-###"Your license will expire in [N] days. Contact your administrator or update your license for continued use of features"
It would be useful if Kibana's http routes could be registered with some text that gets interpolated into a warning header, or perhaps a simple
isDeprecated
flag that would automatically produce a warning header. While deprecations is the obvious use case that comes to mind, there may be others as well.As for the structure, I'd propose that we match the header structure to the same spec that Elasticsearch is using.
(cc @kobelb)
The text was updated successfully, but these errors were encountered: