-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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
Validate compatible handlers have correct version #58304
Validate compatible handlers have correct version #58304
Conversation
Validating if registered compatible rest handlers are overriding compatibleWith method and specify the right compatible version
Pinging @elastic/es-core-infra (:Core/Infra/REST API) |
@@ -51,7 +51,7 @@ | |||
Supplier<DiscoveryNodes> nodesInCluster | |||
) { | |||
if (Version.CURRENT.major == 8) { | |||
return List.of( | |||
return validatedList(7, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 to adding validation... I would have a minor preference to have a static validateCompatibleHandlers(Collection handlers) that is located in a more central location and that assumes Version.CURRENT.major - 1 to help make this more generic.
Also, I think normal IllegalStateException or the like may be preferable to the assert here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree - IllegalStateException fits better here.
Also agree that this could be moved to some more generic place once we have more compat rest handlers in other modules. For the time being I would prefer to keep this in that class (as I don't know the right place since there are no more compat handlers in other modules yet)
Validating if registered compatible rest handlers are overriding
compatibleWith method and specify the right compatible version
("197 błędów / +197")