-
Notifications
You must be signed in to change notification settings - Fork 99
Add support for non exhaustive variants #1662
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
Conversation
Following you can find the validation results for the APIs you have changed.
You can validate these APIs yourself by using the |
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.
This is super great, love what's been done with @open_enum
to make everything even more consistent!
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-7.17 7.17
# Navigate to the new working tree
cd .worktrees/backport-7.17
# Create a new branch
git switch --create backport-1662-to-7.17
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick --mainline 1 7c3d1ce0febc9d78d7e385bf5ec503fb5e3af1e1
# Push it to GitHub
git push --set-upstream origin backport-1662-to-7.17
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-7.17 Then, create a pull request where the |
Co-authored-by: Sylvain Wallez <[email protected]>
Elasticsearch plugins can add new implementations for a significant number of components, such as for example queries, aggregations and property types.
This PR adds an additional
@non_exhaustive
annotation (term borrowed from Rust's equivalent feature) that can be added to@variants
types and enums (see below) to capture the fact that variants or enum members not present in the spec can exist, and clients should allow that.This PR also adds the new
@non_exhaustive
annotation to the relevant types, found from the plugin interface definitions in the ES code base.Example:
The following pluggable components were left out from this PR as they require a bit more investigation in their specification: highlighters, score functions, significance heuristics.
enums: for consistency this PR also changes
@open_enum
for open enumerations to@non_exhaustive
. The enum metamodel isn't changed, and this annotation still sets theisOpen
property.Related: Java implementation of
@non_exhaustive
: elastic/elasticsearch-java#252