-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Remove data <--> expressions circular dependencies. #82685
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
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 was just copied from expressions. It's simple enough that doesn't feel worth exporting from there, especially as it is only a testing utility.
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.
Updated setup dependencies for consistency with the public search service, and also as we need registerType from the expressions contract now.
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 still called this ExecutionContextSearch, but at this point expressions only knows that it's something serializable. This means less type safety out of the box (unless you remember to pass the generic type param), however it helps us get rid of a circular type dependency and makes for clearer separation of concerns between the plugins.
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 was the only place in Kibana this type was used, and you can derive it from KibanaContext already -- so rather than keeping it in the data plugin contract, I removed it and updated accordingly.
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.
For plugins registering expression functions which rely on the search execution context and want to maintain the same level of type safety as we had previously, this is how they can go about achieving it.
For this PR I did not comb through every registered expression function to make this change; rather, I only looked for places where a specific ExecutionContext was already being included.
5dc0bf1 to
aa011ac
Compare
|
@elasticmachine merge upstream |
|
Pinging @elastic/kibana-app-arch (Team:AppArch) |
patrykkopycinski
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.
SIEM/Endpoint LGTM
crob611
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.
Presentation changes are good 👍
flash1293
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.
Kibana app changes LGTM, code review only.
lizozom
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.
LGTM in terms of moving things like AbortError, 'toPromiseand such. However I would appreciate someone more involved inexpressionsconfirming that it makes sense to move thekibanaandkibana_contextfunctions into thedata` plugin.
e53c369 to
2a0d358
Compare
@ppisljar and I discussed |
|
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]Module Count
Async chunks
Distributable file count
Page load bundle
History
To update your PR or re-run it, just comment with: |
* master: (39 commits) Fix ilm navigation (elastic#81664) [Lens] Distinct icons for XY and pie chart value labels toolbar (elastic#82927) [data.search.aggs] Throw an error when trying to create an agg type that doesn't exist. (elastic#81509) Index patterns api - load field list on server (elastic#82629) New events resolver (elastic#82170) [App Search] Misc naming tech debt (elastic#82770) load empty_kibana in test to have clean starting point (elastic#82772) Remove data <--> expressions circular dependencies. (elastic#82685) Update 8.0 breaking change template to gather information on how to programmatically detect it. (elastic#82905) Add alerting as codeowners to related documentation folder (elastic#82777) Add captions to user and space grid pages (elastic#82713) add alternate path for x-pack/Cloud test for Lens (elastic#82634) Uses asCurrentUser in getClusterUuid (elastic#82908) [Alerting][Connectors] Add new executor subaction to get 3rd party case fields (elastic#82519) Fix test import objects (elastic#82767) [ML] Add option for anomaly charts for metric detector should plot min, mean or max as appropriate (elastic#81662) Update alert type selection layout to rows instead of grid (elastic#73665) Prevent Kerberos and PKI providers from initiating a new session for unauthenticated XHR/API requests. (elastic#82817) Update grunt and related packages (elastic#79327) Allow the repository to search across all namespaces (elastic#82863) ...
Closes #80510
As part of the work to migrate to TS project references in preparation for the new build toolchain, we needed to remove some circular dependencies that exist between the
dataandexpressionsplugins.As explained in the original issue, there were a few areas that were causing problems:
This PR addresses these issues by doing the following:
toPromise,AbortError, andgetCombinedSignalfromdatatokibana_utils, as these were used in multiple plugins.abortSignalToPromiseandgetCombinedAbortSignalfor claritykibanaandkibana_contextexpression functions to thedataplugin, and registers them from there instead.kibana_contextexpression type todata.expressionplugin'sExecutionContextto take an additional generic type parameter forExecutionContextSearch, and defaults toSerializableState. Also updates a few places where this was used to pass in the correct param.expressionsthat usedExecutionContextSearchand replaced withSerializableState, as the search typings should really be determined bydataanyway.datafrom theexpressionsplugin'srequiredBundles.