Skip to content

[Uptime] refactor Synthetics Integration package UI#102080

Merged
dominiqueclarke merged 10 commits intoelastic:masterfrom
dominiqueclarke:feature/276-refactor-synthetics-package-ui
Jun 16, 2021
Merged

[Uptime] refactor Synthetics Integration package UI#102080
dominiqueclarke merged 10 commits intoelastic:masterfrom
dominiqueclarke:feature/276-refactor-synthetics-package-ui

Conversation

@dominiqueclarke
Copy link
Contributor

@dominiqueclarke dominiqueclarke commented Jun 14, 2021

Relates to elastic/uptime#276

Summary

This PR refactors implementation details in the Synthetics integration package UI, ahead of adding the browser monitor type.

This change is focused at the way policy details state is managed for http, tcp, and icmp monitors.

Previously, policy detail state was stored in a flat manner, with http, tcp, and icmp monitors sharing one main policy state object. This method took advantage of how many of the policy configurations are the same, but became difficult to reason about and maintain, leading to unexpected bugs like this one

This changes creates state silos for each monitor type, defining their individual policy configuration, each with it's own context to manage state. For monitors that have advanced configuration, context is divided between simple and advanced fields.

When the monitor type is changed, the config that is handed down to fleet is updated to only pull from the specific monitor config.

Testing
Much of this feature has functional test coverage, leading to increased confidence that functionality is not impacted by this refactor. However, the edit flow is not covered by functional tests. Please smoke test both the create and edit flow

@dominiqueclarke dominiqueclarke added enhancement New value added to drive a business result Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability release_note:skip Skip the PR/issue when compiling release notes labels Jun 14, 2021
@dominiqueclarke dominiqueclarke requested a review from a team as a code owner June 14, 2021 15:13
@elasticmachine
Copy link
Contributor

Pinging @elastic/uptime (Team:uptime)

@dominiqueclarke dominiqueclarke marked this pull request as draft June 14, 2021 15:13
@dominiqueclarke dominiqueclarke marked this pull request as ready for review June 14, 2021 15:21
@dominiqueclarke dominiqueclarke marked this pull request as draft June 14, 2021 15:22
@dominiqueclarke dominiqueclarke added the auto-backport Deprecated - use backport:version if exact versions are needed label Jun 15, 2021
@dominiqueclarke dominiqueclarke marked this pull request as ready for review June 15, 2021 12:41
@shahzad31
Copy link
Contributor

@elasticmachine merge upstream

Copy link
Contributor

@shahzad31 shahzad31 left a comment

Choose a reason for hiding this comment

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

smoke test looks good

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
uptime 553 561 +8

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
uptime 1.1MB 1.1MB +18.6KB

History

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

Copy link
Contributor

@shahzad31 shahzad31 left a comment

Choose a reason for hiding this comment

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

LGTM !!

Copy link
Contributor Author

@dominiqueclarke dominiqueclarke left a comment

Choose a reason for hiding this comment

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

I did some additional manual testing, checking for visual performance degradation as we discussed. Performance due to rerenders on context changes does not appear to be a noticeable issue, since each context only impacts a small part of the UI.

@dominiqueclarke dominiqueclarke merged commit 1cf82cb into elastic:master Jun 16, 2021
@dominiqueclarke dominiqueclarke deleted the feature/276-refactor-synthetics-package-ui branch June 16, 2021 19:29
kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Jun 16, 2021
* refactor contexts

* add http, tcp, and icmp folders

* adjust types

* adjust useUpdatePolicy hook

* adjust synthetics policy create and edit wrappers

* adjust validation

* fix typo and types

* remove typo

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
@kibanamachine
Copy link
Contributor

💚 Backport successful

Status Branch Result
7.x

This backport PR will be merged automatically after passing CI.

kibanamachine added a commit that referenced this pull request Jun 16, 2021
* refactor contexts

* add http, tcp, and icmp folders

* adjust types

* adjust useUpdatePolicy hook

* adjust synthetics policy create and edit wrappers

* adjust validation

* fix typo and types

* remove typo

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Dominique Clarke <doclarke71@gmail.com>
jloleysens added a commit to jloleysens/kibana that referenced this pull request Jun 17, 2021
…egrations-to-global-search

* 'master' of github.com:elastic/kibana: (46 commits)
  [Lens] Add some more documentation for dynamic coloring (elastic#101369)
  hide not searchable results when no term (elastic#102401)
  [Lens] Fix Formula functional test with multiple suggestions (elastic#102378)
  Fix trusted apps modified by field displayed as a date field (elastic#102377)
  [Lens] Docs for time shift (elastic#102048)
  update readme of logs-metrics-ui (elastic#101968)
  Refactor observability plugin breadcrumbs (elastic#102290)
  [Index Patterns] Move rollup config to index pattern management v2 (elastic#102285)
  [Security Solution][Endpoint] Isolate Action should only be available to Platinum+ licenses (elastic#102374)
  [build] Updates Ironbank templates (elastic#102407)
  Update security best practices document (elastic#100814)
  [Enterprise Search] Set up initial KibanaPageTemplate  (elastic#102170)
  [Reporting/Docs] Add section to troubleshooting guide to explain the StatusCodeError logs (elastic#102278)
  [DOCS] Updating Elastic Security Overview topic  (elastic#101922)
  [Uptime] refactor Synthetics Integration package UI (elastic#102080)
  [Task Manager] Log at different levels based on the state (elastic#101751)
  [APM] Fixing time comparison types (elastic#101423)
  [RAC] Update alert documents in lifecycle rule type helper (elastic#101598)
  [ML] Functional tests - fix and re-activate alerting flyout test (elastic#102368)
  [Reporting] remove unused reference to path.data config (elastic#102267)
  ...

# Conflicts:
#	x-pack/plugins/fleet/kibana.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Deprecated - use backport:version if exact versions are needed enhancement New value added to drive a business result release_note:skip Skip the PR/issue when compiling release notes Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability v7.14.0 v8.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants