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

[Alerting] Adds lazy loading to AlertType and Flyout components #65678

Merged
merged 30 commits into from
May 12, 2020

Conversation

gmmorris
Copy link
Contributor

@gmmorris gmmorris commented May 7, 2020

Summary

Followup from #65060 and closes #64315

This PR:

  1. Adds support for lazy loading AlertType components and migrates the built-in IndexThreshold components to lazy load.
  2. Adds lazy loading of the components contained in the flyout so that only the wrapper component is imported by other plugins and the internal components are loaded when needed.

This does not migrate other AlertTypes to lazy load and once this is merged issues will be submitted to the solution teams to change their alerts to lazy load wherever possible.

Checklist

Delete any items that are not applicable to this PR.

For maintainers

gmmorris added 18 commits May 4, 2020 12:03
* master: (133 commits)
  Cleanup Typescript index pattern field editor / Expression functions for bucket agg (elastic#65254)
  Removes legacy infra plugin and moves saved objects registration to NP (elastic#64848)
  Added support for docLinks plugin in Connectors forms and missing save capabilities for modal dialog (elastic#64986)
  [SIEM] Removes prebuilt rules number dependency (elastic#65128)
  [Maps] add categorical palettes with 20 and 30 categories (elastic#64701)
  [CI] Slack alerts - Elasticsearch snapshot failures (elastic#64724)
  [Uptime] Console errors in case index missing (elastic#65115)
  [SIEM][CASE] Dynamic fields mapping based on connector (elastic#64412)
  [test/functional] Tsfy page objects (elastic#64887)
  [Maps] [Telemetry] Track geo_point and geo_shape index patterns separately (elastic#65195)
  [Maps] Add global fit to data (elastic#64702)
  Visualize: Reload on ui state change and fix ui state for tsvb (elastic#63699)
  [SIEM] [Cases] External service selection per case (elastic#64775)
  [Uptime] Set ML anomaly look-back to 2w (from 24h) / Add spinner (elastic#65055)
  [Metrics UI] Remove APM Hard Dependency (elastic#64952)
  [Ingest] Datastream list: add icons and dashboard links (elastic#65048)
  disable plugins. they could access ES via SO repository (elastic#65242)
  Feature fleet enrollment instructions (elastic#65176)
  [SIEM] Adds 'Configure connector' Cypress test (elastic#64807)
  [TSVB] Fix std deviation band mode (elastic#64413)
  ...
* master: (72 commits)
  add tsvb tests to Firefox suite (elastic#65425)
  Fix flaky ServerMetricsCollector integration test (elastic#65420)
  [APM] Custom links section inside the Actions menu is showing outside of the menu (elastic#65428)
  [ML] Adds docs_per_second to transform edit form. (elastic#65365)
  update apm index pattern (elastic#65424)
  add direct build command (elastic#65431)
  [ML] Adding daily_model_snapshot_retention_after_days to types and schemas (elastic#65417)
  [chore] Improve request cancelation handling in vis embeddable (elastic#65057)
  [Alerting] migrates acceptance and functional test fixtures to KP (elastic#64888)
  [ML] Fixes reordering in view by selection when overall cell selected (elastic#65290)
  Additional branding updates (elastic#64712)
  Remove redundant formatting of percentage column (elastic#64948)
  [SIEM][CASE] Configuration pages UI redesign (elastic#65355)
  New nav (elastic#64018)
  [Ingest pipelines] Address copy feedback (elastic#65175)
  bug fixing (elastic#65387)
  skip whole suite blocking snapshots (elastic#65377)
  add related event generation to ancestor nodes (fixes a bug) (elastic#64950)
  [Canvas] move files from legacy/plugins to plugins (elastic#65283)
  [SIEM] template timeline UI (elastic#64439)
  ...
* master: (42 commits)
  fix SavedObjectMigrationMap type (elastic#65569)
  [Uptime] Improve cert flaky test (elastic#65458)
  [Uptime] Fix monitor list result runtime type, ip can be null (elastic#65532)
  [APM] Agent configuration: Bug makes it possible to create invalid configurations (elastic#65508)
  [APM] Remove link from active page in the breadcrumb (elastic#65473)
  [SIEM] Fixes test flakiness (elastic#65510)
  [ESLint] update @kbn/eslint/no-restricted-paths rule to allow imports mocks from folder (elastic#65471)
  Migrate test plugins ⇒ NP (kbn_tp_run_pipeline) (elastic#64780)
  move core provier to NP. allows to run tests on every page (elastic#64929)
  Extended alerting documentation with information about using Kibana keystore and action types for preconfigured connectors (elastic#65201)
  [functional tests] add some missing awaits (elastic#65566)
  Fixed create new connector from alert flyout form throw an error messages in external plugins. (elastic#65539)
  [SIEM] [Cases] External services not getting all comments bug fix (elastic#65307)
  Migrate Coordinate Maps to NP (elastic#64668)
  Updating Canvas location in nav (elastic#65519)
  [SIEM][Lists] Fixes up contracts to work outside of requests
  [Lens] Remove "inside only" option for treemap labels (elastic#65363)
  [Uptime] Add TLS alert functional test (elastic#65303)
  Fix z-index of kbnLoadingIndicator (elastic#65521)
  Fixed indice assertion to loop through expected keys (elastic#64684)
  ...
@gmmorris gmmorris added Feature:Alerting Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v7.9.0 v8.0.0 labels May 7, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-alerting-services (Team:Alerting Services)

* master:
  [ML] Transforms: Fix API error message display for edit flyout. (elastic#65494)
  [SIEM][Detection Engine] Fixes import bug with non existent signals index (elastic#65595)
  [Lens] Use rules of hooks with linting (elastic#65593)
  [ML] Migrate server side Mocha tests to Jest. (elastic#65651)
  Fixes the client to setup SSL with the CA certificates for testing (elastic#65598)
  reduce uptime plugin initial bundle size (elastic#65257)
  [ML] Consolidating shared types and util functions (elastic#65247)
  [Drilldowns] Preserve state when selecting different action factory (elastic#65074)
  Migrate test plugins ⇒ NP (kbn_tp_embeddable_explorer) (elastic#64756)
  Move remaining home assets to the new platform (elastic#65053)
  Change the copy and the id from blacklist to block list for consistency (elastic#65419)
  [ML] Hide selector helper in Anomaly Explorer swimlane (elastic#65522)
  [ML] Fix the limit control on the Anomaly explorer page (elastic#65459)
  [Mappings editor] Add component integration tests (elastic#63853)
  [Logs + Metrics UI] Prevent component errors from breaking the whole UI (elastic#65456)
  [Logs UI] Disable search bar when live stream is on. (elastic#65491)
…ponents

* alerting/lazy-load-actions:
  align and style loading indicator
  [ML] Transforms: Fix API error message display for edit flyout. (elastic#65494)
  [SIEM][Detection Engine] Fixes import bug with non existent signals index (elastic#65595)
  [Lens] Use rules of hooks with linting (elastic#65593)
  [ML] Migrate server side Mocha tests to Jest. (elastic#65651)
  Fixes the client to setup SSL with the CA certificates for testing (elastic#65598)
  reduce uptime plugin initial bundle size (elastic#65257)
  [ML] Consolidating shared types and util functions (elastic#65247)
  [Drilldowns] Preserve state when selecting different action factory (elastic#65074)
  Migrate test plugins ⇒ NP (kbn_tp_embeddable_explorer) (elastic#64756)
  Move remaining home assets to the new platform (elastic#65053)
  Change the copy and the id from blacklist to block list for consistency (elastic#65419)
  [ML] Hide selector helper in Anomaly Explorer swimlane (elastic#65522)
  [ML] Fix the limit control on the Anomaly explorer page (elastic#65459)
  [Mappings editor] Add component integration tests (elastic#63853)
  [Logs + Metrics UI] Prevent component errors from breaking the whole UI (elastic#65456)
  [Logs UI] Disable search bar when live stream is on. (elastic#65491)
* master: (58 commits)
  [Drilldowns][chore] import dashboard url generator from plugin contract (elastic#64628)
  fix double flyouts in add panel flow (elastic#65861)
  Point 7.x to 7.9.0 in .backportrc.json
  Mount ui/new_platform applications in same div structure as Core (elastic#63930)
  [Uptime] Settings threshold validation (elastic#65454)
  Fix edit alert flyout to update initialAlert after edit (elastic#65359)
  Fix anomalies display on focused APM service map (elastic#65882)
  [SIEM][Detection Engine] Increases the template limit for ECS mappings
  [SIEM][CASE] Moves functional tests from "legacyEs" to "Es" (elastic#65851)
  [Metrics UI] Fix p95/p99 charts and alerting error (elastic#65579)
  [ML] Add job timing stats to anomaly jobs (elastic#65696)
  restore index pattern management data-test-subj's (elastic#64697)
  [Discover] Prevent whitespace wrapping of doc table header (elastic#52861)
  [SIEM] Fixes a CSS issue with Timeline field truncation (elastic#65789)
  Skipping failing tests. elastic#65867 elastic#65866 elastic#65865
  [Discover] Deangularize the hits counter and create a react component (elastic#65631)
  Tsvb less update (elastic#65467)
  [TSVB] Remove remaining lodash.set usage (elastic#65846)
  [Uptime] Add `a11y` tests (elastic#65514)
  [Uptime] Enable loading on monitor list (elastic#65670)
  ...
@botelastic botelastic bot added the Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability label May 11, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/uptime (Team:uptime)

* master: (46 commits)
  [Drilldowns][chore] Remove some any's from components. Remove `PlaceContext` from components (elastic#65854)
  [functional/services] import By/until from module (elastic#66015)
  [Drilldowns][IE] fix welcome bar layout in IE (elastic#65676)
  Inspect action shows on dashboard for every chart (elastic#65998)
  Fix heigt calc in calc issue for ie11 (elastic#66010)
  [Flights] Delay Bucket - Error notification on opening sample visualization (elastic#66028)
  [SIEM] [Security] unified code structure phase 0 (elastic#65965)
  [Maps] Organize layers into subfolders (elastic#65513)
  skip flaky suite (elastic#59849)
  Cleanup prefill and edit flow. (elastic#66105)
  Fix major severity service map ring colors (elastic#66124)
  [DOCS] Improves formatting in action types (elastic#65932)
  [DOCS] APM Agent config: Setting values must be string (elastic#65875)
  Change default cert age limit value. (elastic#65918)
  [DOCS] Removed saved object options (elastic#66072)
  [SIEM] [Cases] Case API tests (elastic#65777)
  Add example of of local plugin installation (elastic#65986)
  skip flaky suite (elastic#65741)
  [SIEM][Detections] Restrict ML rule modification to ML Admins (elastic#65583)
  [Reporting/Test] Add Functional test for download CSV (elastic#65401)
  ...
Comment on lines +66 to +68
alertParamsExpression: (params: any) => (
<AlertMonitorStatus {...params} autocomplete={autocomplete} />
),
Copy link
Contributor Author

@gmmorris gmmorris May 12, 2020

Choose a reason for hiding this comment

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

Changing the signature in alertParamsExpression has caused this to complain that params is implicitly any rather than explicitly.

I'm not sure why that has caused Typescript to complain about something that was already deemed to be any but it is what it is. 🤷

I'll submit an issue to Uptime to migrate to lazy loading when possible, which will likely be the right time to address the lack of typing too. :)

Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@gmmorris gmmorris changed the title Alerting/lazy load components [Alerting] Adds lazy loading to AlertType and Flyout components May 12, 2020
@gmmorris gmmorris closed this May 12, 2020
@gmmorris gmmorris reopened this May 12, 2020
@gmmorris
Copy link
Contributor Author

@elasticmachine merge upstream

* master:
  [Uptime] Enable deselection of stale filters (elastic#65523)
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Member

@pmuellr pmuellr left a comment

Choose a reason for hiding this comment

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

not familiar with react lazy loading, but code LGTM

AlertAction,
Alert,
AlertTypeModel,
AlertTypeParamsExpressionProps,
Copy link
Member

Choose a reason for hiding this comment

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

AlertTypeParamsExpressionProps doesn't seem to be referenced in this module. I assume you would have gotten a lint error on this

Copy link
Contributor Author

@gmmorris gmmorris May 12, 2020

Choose a reason for hiding this comment

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

It's an export not an import ;)
I've made the same mistake before :p

Copy link
Contributor

@justinkambic justinkambic left a comment

Choose a reason for hiding this comment

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

No problems from the Uptime side (I only reviewed the change to x-pack/plugins/uptime/public/lib/alert_types/monitor_status.tsx).

LGTM

Comment on lines +66 to +68
alertParamsExpression: (params: any) => (
<AlertMonitorStatus {...params} autocomplete={autocomplete} />
),
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

Copy link
Contributor

@YulNaumenko YulNaumenko left a comment

Choose a reason for hiding this comment

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

LGTM

@gmmorris gmmorris merged commit eef9ece into elastic:master May 12, 2020
gmmorris added a commit to gmmorris/kibana that referenced this pull request May 12, 2020
…tic#65678)

This PR:
1. Adds support for lazy loading AlertType components and migrates the built-in IndexThreshold components to lazy load.
2. Adds lazy loading of the components contained in the flyout so that only the wrapper component is imported by other plugins and the internal components are loaded when needed.
gmmorris added a commit that referenced this pull request May 13, 2020
…) (#66255)

This PR:
1. Adds support for lazy loading AlertType components and migrates the built-in IndexThreshold components to lazy load.
2. Adds lazy loading of the components contained in the flyout so that only the wrapper component is imported by other plugins and the internal components are loaded when needed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Alerting release_note:fix Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability v7.9.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add code splitting to the client bundles in triggers_actions_ui plugin
6 participants