[Infra] Fix hosts view crashing on load#257893
Conversation
⏳ Build in-progress, with failures
Failed CI Steps |
|
/ci |
|
Pinging @elastic/obs-presentation-team (Team:obs-presentation) |
cauemarcondes
left a comment
There was a problem hiding this comment.
Obs UI changes LGTM
rmyz
left a comment
There was a problem hiding this comment.
LGTM, tested and works fine, thanks for the fix!
sbelastic
left a comment
There was a problem hiding this comment.
@AlejandroFrndz I would just ask you to check if the skipped tests are now working with these fixes and un-skipped them if that's the case.
Besides that LGTM.
Unfortunately, 4 tests in the suite are still failing even after the fix. Nevertheless I did confirm tests do fail without the fix as expected because the page is crashed. I'm not sure why these didn't flag the issues in the CI for #254079 before it was merged. We should maybe include tasks in any upcoming maintenance to look at these tests and migrate them to scout so they're more reliable |
## Summary Closes #257867 This PR introduces a fix to prevent the infra plugin hosts view page from crashing on load. Both parts of the problem are addressed ### Control type value miss match 1. Changes in `x-pack/solutions/observability/plugins/infra/public/pages/metrics/hosts/components/search_bar/control_panels_config.ts` ensure urls are built with correct values and future proofs the page by replacing hardcoded strings with imported constants 2. Changes in `x-pack/solutions/observability/plugins/observability_shared/public/hooks/use_control_panels_url_state.ts` ensure any existing URL using old values for types can be handled and converted to the new model. This is to prevent users that might still be using old urls after upgrading (i.e. bookmars) from seeing broken filter controls ### Embeddables error leading to a page crash Changes in `x-pack/solutions/observability/plugins/infra/public/pages/metrics/hosts/components/search_bar/controls_content.tsx` ensure the hosts view page doesn't crash entirely if filter control embeddables run into critical issues. If a situation like this were to happen in the future, the page will render error UI in place of the filter controls. Page functionality will be degraded but we avoid a full page crash and maintain other page functions not directly related to embeddables ### Tests Updated/new tests for this plugin will be created in a follow up PR to ensure issues like this are caught by CI in the future before reaching production environments --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
## Summary Closes elastic#257867 This PR introduces a fix to prevent the infra plugin hosts view page from crashing on load. Both parts of the problem are addressed ### Control type value miss match 1. Changes in `x-pack/solutions/observability/plugins/infra/public/pages/metrics/hosts/components/search_bar/control_panels_config.ts` ensure urls are built with correct values and future proofs the page by replacing hardcoded strings with imported constants 2. Changes in `x-pack/solutions/observability/plugins/observability_shared/public/hooks/use_control_panels_url_state.ts` ensure any existing URL using old values for types can be handled and converted to the new model. This is to prevent users that might still be using old urls after upgrading (i.e. bookmars) from seeing broken filter controls ### Embeddables error leading to a page crash Changes in `x-pack/solutions/observability/plugins/infra/public/pages/metrics/hosts/components/search_bar/controls_content.tsx` ensure the hosts view page doesn't crash entirely if filter control embeddables run into critical issues. If a situation like this were to happen in the future, the page will render error UI in place of the filter controls. Page functionality will be degraded but we avoid a full page crash and maintain other page functions not directly related to embeddables ### Tests Updated/new tests for this plugin will be created in a follow up PR to ensure issues like this are caught by CI in the future before reaching production environments --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
## Summary Closes elastic#257867 This PR introduces a fix to prevent the infra plugin hosts view page from crashing on load. Both parts of the problem are addressed ### Control type value miss match 1. Changes in `x-pack/solutions/observability/plugins/infra/public/pages/metrics/hosts/components/search_bar/control_panels_config.ts` ensure urls are built with correct values and future proofs the page by replacing hardcoded strings with imported constants 2. Changes in `x-pack/solutions/observability/plugins/observability_shared/public/hooks/use_control_panels_url_state.ts` ensure any existing URL using old values for types can be handled and converted to the new model. This is to prevent users that might still be using old urls after upgrading (i.e. bookmars) from seeing broken filter controls ### Embeddables error leading to a page crash Changes in `x-pack/solutions/observability/plugins/infra/public/pages/metrics/hosts/components/search_bar/controls_content.tsx` ensure the hosts view page doesn't crash entirely if filter control embeddables run into critical issues. If a situation like this were to happen in the future, the page will render error UI in place of the filter controls. Page functionality will be degraded but we avoid a full page crash and maintain other page functions not directly related to embeddables ### Tests Updated/new tests for this plugin will be created in a follow up PR to ensure issues like this are caught by CI in the future before reaching production environments --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Summary
Closes #257867
This PR introduces a fix to prevent the infra plugin hosts view page from crashing on load. Both parts of the problem are addressed
Control type value miss match
x-pack/solutions/observability/plugins/infra/public/pages/metrics/hosts/components/search_bar/control_panels_config.tsensure urls are built with correct values and future proofs the page by replacing hardcoded strings with imported constantsx-pack/solutions/observability/plugins/observability_shared/public/hooks/use_control_panels_url_state.tsensure any existing URL using old values for types can be handled and converted to the new model. This is to prevent users that might still be using old urls after upgrading (i.e. bookmars) from seeing broken filter controlsEmbeddables error leading to a page crash
Changes in
x-pack/solutions/observability/plugins/infra/public/pages/metrics/hosts/components/search_bar/controls_content.tsxensure the hosts view page doesn't crash entirely if filter control embeddables run into critical issues. If a situation like this were to happen in the future, the page will render error UI in place of the filter controls. Page functionality will be degraded but we avoid a full page crash and maintain other page functions not directly related to embeddablesTests
Updated/new tests for this plugin will be created in a follow up PR to ensure issues like this are caught by CI in the future before reaching production environments