Allow specifying deprecation level for REST deprecation handler#80629
Conversation
This allows specifying an optional level to be used for the deprecation handler registering a route. Relates to elastic#80167
|
FWIW, Kibana originally used default |
pgomulka
left a comment
There was a problem hiding this comment.
LGTM
I left one comment
| public void handleRequest(RestRequest request, RestChannel channel, NodeClient client) throws Exception { | ||
| if (compatibleVersionWarning == false) { | ||
| deprecationLogger.warn(DeprecationCategory.API, deprecationKey, deprecationMessage); | ||
| if (deprecationLevel == null || deprecationLevel == Level.WARN) { |
There was a problem hiding this comment.
i was going to comment about this having a default value. But I see that a default level is different for compatible and different for "current version" deprecations.
might be worth a comment why deprecationLevel is nullable and why there is a different behaviour?
…tic#80629) This allows specifying an optional level to be used for the deprecation handler registering a route. The default remains if the level is unspecified. Relates to elastic#80167
💔 Backport failed
You can use sqren/backport to manually backport by running |
…tic#80629) This allows specifying an optional level to be used for the deprecation handler registering a route. The default remains if the level is unspecified. Relates to elastic#80167 # Conflicts: # server/src/main/java/org/elasticsearch/common/logging/DeprecationLogger.java # server/src/main/java/org/elasticsearch/rest/DeprecationRestHandler.java # server/src/main/java/org/elasticsearch/rest/RestController.java # server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestPutIndexTemplateAction.java # server/src/test/java/org/elasticsearch/rest/DeprecationRestHandlerTests.java # server/src/test/java/org/elasticsearch/rest/RestControllerTests.java
…) (#80779) This allows specifying an optional level to be used for the deprecation handler registering a route. The default remains if the level is unspecified. Relates to #80167 # Conflicts: # server/src/main/java/org/elasticsearch/common/logging/DeprecationLogger.java # server/src/main/java/org/elasticsearch/rest/DeprecationRestHandler.java # server/src/main/java/org/elasticsearch/rest/RestController.java # server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestPutIndexTemplateAction.java # server/src/test/java/org/elasticsearch/rest/DeprecationRestHandlerTests.java # server/src/test/java/org/elasticsearch/rest/RestControllerTests.java
This allows specifying an optional level to be used for the deprecation handler registering a route.
The default remains if the level is unspecified.
Relates to #80167