Skip to content
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

[6.x] Move buildEsQuery to a package #26306

Merged
merged 10 commits into from
Dec 18, 2018

Conversation

lukasolson
Copy link
Member

@lukasolson lukasolson commented Nov 27, 2018

Backports #23345 to 6.x.

This wasn't quite a clean backport because #15640 wasn't backported to 6.x, so we had to fix a couple of things manually.

The files that had to be manually fixed are the following:

packages/kbn-es-query/src/es_query/build_es_query.js
packages/kbn-es-query/src/es_query/decorate_query.js
packages/kbn-es-query/src/es_query/from_lucene.js
packages/kbn-es-query/src/es_query/__tests__/from_filters.js
src/ui/public/agg_types/buckets/_terms_other_bucket_helper.js

Basically, fromFilters and fromLucene now import decorateQuery instead of being passed it as an argument, and instead accept config as an argument, which they pass down to decorateQuery.

Since buildOtherBucketAgg historically sent a noop as decorateQuery into fromFilters, it doesn't need to pass any config, so decorateQuery was updated to check if config is passed in, and only if it is, to decorate the query with the query string options from the config.

lukasolson and others added 2 commits November 27, 2018 15:31
* fix: move buildEsQuery to utils

* fix: tests that I broke

* fix: add back link to the docs

* fix: don't export from ui/ and link to utils

* fix: move to a package

* fix: move error to errors.js

* fix: paths for peg task

* fix: update reference to kuery

* fix: build step for transpilation

* fix: add typescript declaration file

* fix: test

* tmp: debug individual tests

* debug: add debug stuff for reporting tests

* try to debug test

* Testing splitting reporting jobs in two

* Testing splitting each job

* Fix ci yaml

* Skipping job to check failing test

* debug - adding a catch to jobResponseHandler on report

* Testing a different job and enabling verbose mode

* Testing verbose on phantom_api skipping other CI tests

* Fix script mode

* fix: try running tests in chromium

* fix: move out of devDependencies

* fix: remove commented test

* Revert "fix: try running tests in chromium"

This reverts commit 991d46f.

* Revert testing changes

* Fixing build for phantomjs

* Revert CI configuration to master. Remove verbose logging for tests
@lukasolson lukasolson added review backport Team:Visualizations Visualization editors, elastic-charts and infrastructure v6.6.0 labels Nov 27, 2018
@lukasolson lukasolson self-assigned this Nov 27, 2018
@lukasolson lukasolson requested review from markov00 and Bargs November 27, 2018 22:45
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@lukasolson lukasolson changed the title Backport https://github.com/elastic/kibana/pull/23345 [6.x] Move buildEsQuery to a package Nov 27, 2018
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@weltenwort
Copy link
Member

will this be merged any time soon or should I work around it?

@lukasolson
Copy link
Member Author

@weltenwort Just waiting on reviews. @Bargs @markov00 do either of you have time to give this a look? Or do you have time @weltenwort?

@weltenwort
Copy link
Member

I'm a bit swamped with stuff that has a deadline attached, sorry... I can use the old imports in my PR for now if you expect this to take a while

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@Bargs
Copy link
Contributor

Bargs commented Dec 10, 2018

Going to try to get to this in the next couple days

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Contributor

@Bargs Bargs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code that had to change for 6.x looks good. I also did a little smoke testing in Discover. KQL and lucene queries still work as do filters. I also verified that query_string filters get decorated with query:queryString:options. LGTM.

@elasticmachine
Copy link
Contributor

💔 Build Failed

@lukasolson
Copy link
Member Author

Retest

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@lukasolson
Copy link
Member Author

@weltenwort @sqren Did you want to check out this PR and ensure your usages are still working (in 6.x)?

@sorenlouv
Copy link
Member

@lukasolson Sorry for not getting back to you before. I'll check this out tomorrow (Tuesday)

Copy link
Member

@sorenlouv sorenlouv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@lukasolson lukasolson merged commit e23dc04 into elastic:6.x Dec 18, 2018
@lukasolson lukasolson deleted the backport/es-query-package branch December 2, 2019 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport review Team:Visualizations Visualization editors, elastic-charts and infrastructure v6.6.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants