-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Infra UI] Avoid eager async imports in metric alert registrations #123285
[Infra UI] Avoid eager async imports in metric alert registrations #123285
Conversation
Pinging @elastic/infra-monitoring-ui (Team:Infra Monitoring UI) |
looks like an unrelated failure of the CI infrastructure |
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
Page load bundle
Unknown metric groupsasync chunk count
ESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: cc @weltenwort |
To put the bundle size changes into perspective, here are the changes from the original PR that caused the unfortunate loading behavior: Async chunks
Page load bundle
|
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.
💔 All backports failed
How to fixRe-run the backport manually:
Questions ?Please refer to the Backport tool documentation |
These manual backports will take a while because many of the prior code changes have not been backported cleanly and/or were partially reverted. |
…lastic#123285) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> (cherry picked from commit 629c602) # Conflicts: # x-pack/plugins/infra/public/alerting/inventory/components/expression.tsx # x-pack/plugins/infra/public/alerting/inventory/components/metric.tsx # x-pack/plugins/infra/public/alerting/metric_anomaly/components/expression.tsx # x-pack/plugins/infra/public/alerting/metric_threshold/components/expression.tsx # x-pack/plugins/infra/public/alerting/metric_threshold/components/expression_row.tsx # x-pack/plugins/infra/server/lib/alerting/inventory_metric_threshold/evaluate_condition.ts # x-pack/plugins/infra/server/lib/alerting/inventory_metric_threshold/lib/calculate_from_based_on_metric.ts # x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/evaluate_rule.ts # x-pack/plugins/infra/server/lib/alerting/metric_threshold/register_metric_threshold_rule_type.ts # x-pack/test/api_integration/apis/metrics_ui/inventory_threshold_alert.ts
…123285) (#123868) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> (cherry picked from commit 629c602) # Conflicts: # x-pack/plugins/infra/public/alerting/inventory/components/expression.tsx # x-pack/plugins/infra/public/alerting/inventory/components/metric.tsx # x-pack/plugins/infra/public/alerting/metric_anomaly/components/expression.tsx # x-pack/plugins/infra/public/alerting/metric_threshold/components/expression.tsx # x-pack/plugins/infra/public/alerting/metric_threshold/components/expression_row.tsx # x-pack/plugins/infra/server/lib/alerting/inventory_metric_threshold/evaluate_condition.ts # x-pack/plugins/infra/server/lib/alerting/inventory_metric_threshold/lib/calculate_from_based_on_metric.ts # x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/evaluate_rule.ts # x-pack/plugins/infra/server/lib/alerting/metric_threshold/register_metric_threshold_rule_type.ts # x-pack/test/api_integration/apis/metrics_ui/inventory_threshold_alert.ts
…lastic#123285) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> (cherry picked from commit 629c602) # Conflicts: # x-pack/plugins/infra/public/alerting/inventory/components/expression.tsx # x-pack/plugins/infra/public/alerting/inventory/components/expression_chart.tsx # x-pack/plugins/infra/public/alerting/inventory/components/metric.tsx # x-pack/plugins/infra/public/alerting/inventory/index.ts # x-pack/plugins/infra/public/alerting/metric_anomaly/components/expression.tsx # x-pack/plugins/infra/public/alerting/metric_threshold/components/expression.tsx # x-pack/plugins/infra/public/alerting/metric_threshold/components/expression_row.tsx # x-pack/plugins/infra/public/alerting/metric_threshold/index.ts # x-pack/plugins/infra/public/plugin.ts # x-pack/plugins/infra/server/features.ts # x-pack/plugins/infra/server/lib/alerting/inventory_metric_threshold/evaluate_condition.ts # x-pack/plugins/infra/server/lib/alerting/inventory_metric_threshold/inventory_metric_threshold_executor.ts # x-pack/plugins/infra/server/lib/alerting/inventory_metric_threshold/lib/calculate_from_based_on_metric.ts # x-pack/plugins/infra/server/lib/alerting/metric_anomaly/metric_anomaly_executor.ts # x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/evaluate_alert.ts # x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/metric_query.ts # x-pack/plugins/infra/server/lib/alerting/metric_threshold/metric_threshold_executor.test.ts # x-pack/plugins/infra/server/lib/alerting/metric_threshold/metric_threshold_executor.ts # x-pack/plugins/infra/server/lib/alerting/metric_threshold/register_metric_threshold_alert_type.ts # x-pack/test/api_integration/apis/metrics_ui/inventory_threshold_alert.ts # x-pack/test/api_integration/apis/metrics_ui/metric_threshold_alert.ts
…lastic#123285) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
…lastic#123285) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> # Conflicts: # x-pack/plugins/infra/public/alerting/inventory/components/expression.tsx # x-pack/plugins/infra/public/alerting/inventory/components/expression_chart.tsx # x-pack/plugins/infra/public/alerting/inventory/components/metric.tsx # x-pack/plugins/infra/public/alerting/inventory/index.ts # x-pack/plugins/infra/public/alerting/metric_anomaly/components/expression.tsx # x-pack/plugins/infra/public/alerting/metric_threshold/components/expression.tsx # x-pack/plugins/infra/public/alerting/metric_threshold/components/expression_row.tsx # x-pack/plugins/infra/public/alerting/metric_threshold/index.ts # x-pack/plugins/infra/public/plugin.ts # x-pack/plugins/infra/server/features.ts # x-pack/plugins/infra/server/lib/alerting/inventory_metric_threshold/evaluate_condition.ts # x-pack/plugins/infra/server/lib/alerting/inventory_metric_threshold/inventory_metric_threshold_executor.ts # x-pack/plugins/infra/server/lib/alerting/inventory_metric_threshold/lib/calculate_from_based_on_metric.ts # x-pack/plugins/infra/server/lib/alerting/metric_anomaly/metric_anomaly_executor.ts # x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/evaluate_alert.ts # x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/metric_query.ts # x-pack/plugins/infra/server/lib/alerting/metric_threshold/metric_threshold_executor.test.ts # x-pack/plugins/infra/server/lib/alerting/metric_threshold/metric_threshold_executor.ts # x-pack/plugins/infra/server/lib/alerting/metric_threshold/register_metric_threshold_alert_type.ts # x-pack/test/api_integration/apis/metrics_ui/inventory_threshold_alert.ts # x-pack/test/api_integration/apis/metrics_ui/metric_threshold_alert.ts
…123285) (#124177) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> # Conflicts: # x-pack/plugins/infra/public/alerting/inventory/components/expression.tsx # x-pack/plugins/infra/public/alerting/inventory/components/expression_chart.tsx # x-pack/plugins/infra/public/alerting/inventory/components/metric.tsx # x-pack/plugins/infra/public/alerting/inventory/index.ts # x-pack/plugins/infra/public/alerting/metric_anomaly/components/expression.tsx # x-pack/plugins/infra/public/alerting/metric_threshold/components/expression.tsx # x-pack/plugins/infra/public/alerting/metric_threshold/components/expression_row.tsx # x-pack/plugins/infra/public/alerting/metric_threshold/index.ts # x-pack/plugins/infra/public/plugin.ts # x-pack/plugins/infra/server/features.ts # x-pack/plugins/infra/server/lib/alerting/inventory_metric_threshold/evaluate_condition.ts # x-pack/plugins/infra/server/lib/alerting/inventory_metric_threshold/inventory_metric_threshold_executor.ts # x-pack/plugins/infra/server/lib/alerting/inventory_metric_threshold/lib/calculate_from_based_on_metric.ts # x-pack/plugins/infra/server/lib/alerting/metric_anomaly/metric_anomaly_executor.ts # x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/evaluate_alert.ts # x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/metric_query.ts # x-pack/plugins/infra/server/lib/alerting/metric_threshold/metric_threshold_executor.test.ts # x-pack/plugins/infra/server/lib/alerting/metric_threshold/metric_threshold_executor.ts # x-pack/plugins/infra/server/lib/alerting/metric_threshold/register_metric_threshold_alert_type.ts # x-pack/test/api_integration/apis/metrics_ui/inventory_threshold_alert.ts # x-pack/test/api_integration/apis/metrics_ui/metric_threshold_alert.ts
📝 Summary
This reverts the eager async imports introduced in #119557 to make sure most chunks are loaded on-demand. In doing so it untangles a web of forbidden imports across the
public
andserver
directories which were flagged as linter exceptions.closes #122941
🕵️♀️ Review notes
server
andcommon
, so most forbidden imports could be removed by importing fromcommon
instead. Where the type didn't yet exist incommon
, this moves it there.infra.chunk.N.js
bundles are loaded on the login screen, but keep the rule creation fly-outs working.