-
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
Implement a generic solution to execution context propagation inside Kibana #132629
Comments
Pinging @elastic/security-solution (Team: SecuritySolution) |
@xcrzx wanted to check in about the status of this :-) |
As per @xcrzx working on this issue was postponed. |
Yes, that's correct. Once all apps are migrated to the shared router, we can close this issue. |
Do we have anywhere we are tracking which apps still need to migrate? I'm happy to help chase people down if it helps push things forward :) |
I don't know of any ticket besides this where the progress is tracked. I believe only the security solution has migrated to the Probably the easiest way to see what plugins need to be migrated is by making this ESLint rule global (currently, it is enabled only for security solution plugins) and collecting all errors: The migration itself should be pretty straightforward. Plugins need to replace @lukeelmers Please let me know how I could help move this effort forward. |
We could start by adding this eslint rule to a PR and see what blows up? |
Created a draft PR: #145863. |
I'm seeing ~15 plugins that are calling The reason I'm interested is because we have some large-scale users who have been asking for Kibana-wide execution context propagation, and this is the last thing preventing us from being able to say that it is officially supported everywhere. |
@elastic/kibana-global-experience Just wanted to bump this for y'all to consider when prioritizing upcoming work. Seems like it could be a relatively easy win and a big benefit for some of our largest deployments. |
## Summary This PR removes all imports of Route from react-router-dom and '@kbn/kibana-react-plugin/public' and instead imports Route from @kbn/shared-ux-router. ### Context Based on #132629 (comment) This PR executes steps 2 - 4: > 2. To make the transition easier, we want to re-export other react-router-dom exports alongside the modified' Route'. > 3. Solutions should start using that Route component in place of the one from react-router-dom. I.e. replace all occurrences of import { ... } from 'react-router-dom' with import { ... } from '@kbn/shared-ux-router'. > 4. All manual calls to useExecutionContext are not needed anymore and should be removed. ### Future PR Looks like this might be getting worked on in: #145863 (thanks!) > Introduce an ESlint rule that ensures that react-router-dom is not used directly in Kibana and that imports go through the new @kbn/shared-ux-router package. This is tangentially accomplished through #150340 but only addresses using Route through @kbn/kibana-react-plugin/public' ### Checklist Delete any items that are not applicable to this PR. - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios --------- Co-authored-by: kibanamachine <[email protected]> Co-authored-by: Tiago Costa <[email protected]>
## Summary This PR removes all imports of Route from react-router-dom and '@kbn/kibana-react-plugin/public' and instead imports Route from @kbn/shared-ux-router. ### Context Based on elastic#132629 (comment) This PR executes steps 2 - 4: > 2. To make the transition easier, we want to re-export other react-router-dom exports alongside the modified' Route'. > 3. Solutions should start using that Route component in place of the one from react-router-dom. I.e. replace all occurrences of import { ... } from 'react-router-dom' with import { ... } from '@kbn/shared-ux-router'. > 4. All manual calls to useExecutionContext are not needed anymore and should be removed. ### Future PR Looks like this might be getting worked on in: elastic#145863 (thanks!) > Introduce an ESlint rule that ensures that react-router-dom is not used directly in Kibana and that imports go through the new @kbn/shared-ux-router package. This is tangentially accomplished through elastic#150340 but only addresses using Route through @kbn/kibana-react-plugin/public' ### Checklist Delete any items that are not applicable to this PR. - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios --------- Co-authored-by: kibanamachine <[email protected]> Co-authored-by: Tiago Costa <[email protected]>
@vadimkibana My understanding is that the scope of this work is relatively small. But there is enormous value in having richer execution context across the whole UI. This would allow both us and users to better attribute where load on Kibana/Elasticsearch is originating from which is a highly requested feature. Is there a reason this work has been cancelled? |
I was under the impression that #150357 addressed the full scope of this issue, but I may be mistaken. |
This ticket was fully addressed in #150357, so closing it as completed |
Summary
In #131805 we introduced a wrapper around the
Route
component fromreact-router-dom
(seesrc/plugins/kibana_react/public/router/router.tsx
). This wrapper is intended to be used in Kibana across all solutions for automatic propagation of execution context when a user changes route. To do that:@kbn/kibana-react-plugin
package to a separate single-purpose package, something like@kbn/shared-ux-router
. This is yet to be discussed with @majagrubic and @clintandrewhallreact-router-dom
exports alongside the modified' Route'.Route
component in place of the one fromreact-router-dom
. I.e. replace all occurrences ofimport { ... } from 'react-router-dom'
withimport { ... } from '@kbn/shared-ux-router'
.useExecutionContext
are not needed anymore and should be removed.react-router-dom
is not used directly in Kibana and that imports go through the new@kbn/shared-ux-router
package.For more context see this discussion: #131805 (comment)
The text was updated successfully, but these errors were encountered: