-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[core.savedObjects] Update esKuery imports to pull from new package instead of data plugin #55485
Comments
Exposing a generic ES filter API for Saved Objects find comes with some complications. Currently, we've tried to hide from consumers of the SavedObjectsClient the way in which these saved-objects are persisted in documents in Elasticsearch. For example, the following saved-object
is mapped to the following ES document
Consumes of We could theoretically only support a subset of the ES DSL predicates which we can rewrite. However, this would end up solving a very similar problem to the one that KQL is trying to solve. |
This issue just came up in discussion on #78348, and @kobelb mentioned:
The only issue with re-creating the So we'd need to sort out how to deal with this if we decide to move back to a package:
|
I don't know the functional of the es_query package in detail, but why is the package relying on types such as
An alternative would be to have an additional package, such as |
We can also take advantage of TypeScript's structural subtyping so there are two definitions of the interface, the one that |
This is basically how it was handled before (option 1), where
@lukasolson would probably have more history on this, but in general Right now it seems the least-worst options are reverting to how we used to do things (option 1 above, where types are re-defined in a separate package), or perhaps the additional |
One other thing I just thought of: If we were to make a separate package for |
what's the minimum set of es-query that core requires ? does that specific parts have dependencies on types from data plugin ? if not, could we extract only that part into a package (so we don't bring any dependency on data plugin over) ? could be that we just need to split the query plugin into multi parts ? |
I have no idea to be honest. As we are allowing consumers to pass a |
The new plan is for @elastic/kibana-app-services to move I will update the original issue description here, but the new scope for Core in this issue will be pretty straightforward -- basically updating our imports once the new package is ready. |
find
@lukeelmers @ppisljar Will there really be any work for Core to do here? I suspect for CI to pass, we'll need to update the imports in the same PR as the work in #51659. Seems like we could close this? |
@joshdover We wouldn't need to update imports at the same time if the package contents were still re-exported by the data plugin (so that downstream users don't need to know about its existence unless they have a reason to). But that's a small enough thing to change that maybe app services would be willing to do it all at once? 😉 |
@ppisljar any update here on moving esKuery? |
I believe @lizozom is working on this currently, splitting the work into a couple PRs. Not sure how much work is remaining, though. |
Blocked by #51659
Edit: The scope of this issue has been reduced -- right now the plan is to wait for the app services team to address #51659, which will move
esKuery
into a dedicated package again. Once that's complete, all we will need to do in Core is update our imports to use the new package instead.In #42012 it was decided that we would move the@kbn/es-query
package into thedata
plugin, which was merged in #51014.In #41136, functionality was added to Saved Objects Client which allowed filtering using a KQL string. Internally, core was using the former@kbn/es-query
package to parse the KQL.Since es-query is no longer a standalone package, this means a dependency has been created between core (which owns saved objects), and data (which owns KQL). Having core depend on any other plugins runs counter to the overall design of the Kibana platform, so we need to go back and remove this dependency.The plan discussed with @rudolf, @joshdover, and @Bargs is as follows:- [ ] 1. @elastic/kibana-platform - Expose a generic ES filter api for Saved Objects find- [ ] 2. @elastic/kibana-app-arch - #51659 After (1) is complete, create a server API in the Data Query Service that can take Saved Object Client & a KQL query and validate/compile the KQL to an ES Filter which is passed to the SO client. We should be able to reuse a lot of the existing code that does this from/src/core/server/saved_objects/service/lib/filter_utils.ts
for this.This particular issue is here to track (1) above, which blocks us from starting on (2 / #51659).The text was updated successfully, but these errors were encountered: