-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
Add explicit plugin method for MappedActionFilter #108515
Add explicit plugin method for MappedActionFilter #108515
Conversation
In preparation for elastic#108210, this commit adds a separate method to gather MappedActionFilter instances. For now this remains compatible with the existing getActionFilters by allowing MappedActionFilter to exist in both places.
Pinging @elastic/es-core-infra (Team:Core/Infra) |
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.
LGTM
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.
One small nit/suggestion and one Q but LGTM
@@ -807,6 +807,7 @@ private static ActionFilters setupActionFilters(List<ActionPlugin> actionPlugins | |||
finalFilters.add(filter); | |||
} | |||
} | |||
mappedFilters.addAll(plugin.getMappedActionFilters()); |
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.
Nit: maybe add a TODO/comment to remove the instanceof above?
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.
(Never mind, I just saw #108210)
/** | ||
* Action filters applying to a single action added by this plugin. | ||
*/ | ||
default Collection<MappedActionFilter> getMappedActionFilters() { |
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.
A Q: plugins should migrate to this method to return a MappedActionFilter.
Would it be possible then to remove the ability to return a MappedActionFilter from getActionFilters()
? I think it will be OK for modules and for serverless, but what about 3rd party? We do not guarantee any bwc there, correct? (They work only with the ES version they were compiled with, to the patch?)
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.
Plugins have zero backcompat guarantees (at least these classic plugins). After converting serverless to use MappedActionFilter I will followup with making MappedActionFilter no longer inherit from ActionFilter, so it will not be possible to return via getActionFilters()
.
In preparation for #108210, this commit adds a separate method to gather MappedActionFilter instances. For now this remains compatible with the existing getActionFilters by allowing MappedActionFilter to exist in both places.