-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[Search] Cleanup SearchRequest and SearchResponse types #75471
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
[Search] Cleanup SearchRequest and SearchResponse types #75471
Conversation
|
Pinging @elastic/kibana-app-arch (Team:AppArch) |
lukeelmers
left a comment
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.
The more I think about this, it might be a good idea to keep SearchRequest around since there isn't currently a replacement for it.
If we switch everything to use Record, it will make it much harder to find usages of this type later if we want to change it again. Whereas if we keep SearchRequest around and simply update the typings for it, it'll be much easier to locate in the future.
lukasolson
left a comment
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.
I have to agree with @lukeelmers here... I think the changes to SearchResponse make a lot of sense, but I think we should make changes directly to the TS definition for SearchRequest rather than everywhere SearchRequest is used. In the future, if we keep SearchRequest, it will be much easier to refactor once we actually have a valid type.
src/plugins/input_control_vis/public/control/list_control_factory.ts
Outdated
Show resolved
Hide resolved
This reverts commit 9914ab5.
lukeelmers
left a comment
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.
Code changes LGTM. The fact that we are still stuck using any in a few places is a bummer, but this is still a worthwhile improvement to the status quo.
Hopefully if we get more detailed typings in the client in the future, we will be able to come back and tighten some of these up.
kertal
left a comment
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.
Code LGTM, KibanaApp CodeOwner review, checked out, tested input control and Discover context, works
lukasolson
left a comment
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.
Code LGTM
|
@elasticmachine merge upstream |
|
merge conflict between base and head |
💚 Build SucceededBuild metricsasync chunks size
page load bundle size
History
To update your PR or re-run it, just comment with: |
* improve test stability * Replace SearchRequest = any with Record<string, any> * Remove SearchResponse = any from data plugin * docs * logs * Revert "Replace SearchRequest = any with Record<string, any>" This reverts commit 9914ab5. * code review * list control * null check * null null null * Jest fix # Conflicts: # src/plugins/data/public/public.api.md
#75726) * [Search] Cleanup SearchRequest and SearchResponse types (#75471) * improve test stability * Replace SearchRequest = any with Record<string, any> * Remove SearchResponse = any from data plugin * docs * logs * Revert "Replace SearchRequest = any with Record<string, any>" This reverts commit 9914ab5. * code review * list control * null check * null null null * Jest fix # Conflicts: # src/plugins/data/public/public.api.md * merge
Summary
During the NP migration, we created a couple of internal types for
SearchRequestandSearchResponse, defining them to beany.This PR
SearchRequest, in the few places it was used, withRecord<string, any>(Being the result ofsearchSource.flatten())SearchResponsewith the type defined in the elasticsearch client library.I opened a couple of issues for gaps in the Elasticsearch Client types
And for the time being used casting to
anyto work around those issues.Checklist
Delete any items that are not applicable to this PR.
For maintainers