[Data - Query Service] Move es-query back into a dedicated package #51659
Labels
blocker
chore
Feature:KQL
KQL
impact:critical
This issue should be addressed immediately due to a critical level of impact on the product.
loe:large
Large Level of Effort
NeededFor:Core
v8.0.0
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 and blocks the upcoming migration to Bazel, so we need to go back and remove this dependency.
For the reasons discussed in #55485, core & app services agreed we should revert back to the previous approach of having es-query live as a standalone package of some type.
Edit The revised plan:
fromKueryExpression
,toElasticsearchQuery
, andnodeTypes.function.buildNode
, so at a minimum those functions are what need to be movedes-query
relies on from data (they will need to be moved into a package as well, otherwise they must be duplicated).IIndexPattern
is the biggest potential issue here, but if we also movedQuery
,Filter
,TimeRange
, it would help with circular dependency issues we've hit elsewhere.es-query
package, or perhaps a separatedata-types
package as suggested in [core.savedObjects] Update esKuery imports to pull from new package instead of data plugin #55485 (comment)src/plugins/expressions/server/index.ts
fromtsconfig.types.json
scripts/check_unpublished_api_changes
compile errors which occurred as a result of core's dependency on data.The plan discussed with @rudolf, @joshdover, and @Bargs is as follows:- [ ] 1. @elastic/kibana-platform - #55485 Expose a generic ES filter api for Saved Objects find- [ ] 2. @elastic/kibana-app-arch - 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.- [ ] Removesrc/plugins/expressions/server/index.ts
fromtsconfig.types.json
- This was added in #64395 to preventscripts/check_unpublished_api_changes
compile errors which occurred as a result of core's dependency on data.The text was updated successfully, but these errors were encountered: