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

[Uptime] Edit uptime alerts #68005

Merged
merged 53 commits into from
Jun 8, 2020

Conversation

justinkambic
Copy link
Contributor

@justinkambic justinkambic commented Jun 2, 2020

Summary

Resolves elastic/uptime#179

Allows users to edit alerts they've previously created in the Uptime UI.

Something to note, old alerts will still work after this change, even though the underlying params have changed. I've added this callout to indicate to a user why some of their parameters aren't showing up:

image

Testing

There are a number of cases this PR seeks to cover, and the code is re-used in several different contexts, so it's important to thoroughly smoke test each case.

Creating an alert in Uptime

  • Create an alert from the Uptime UI with no filters or search pre-selected
  • Create an alert from Uptime with filters/search pre-selected. The values you were using in the app should auto-populate. The app won't stay in sync with the filters in the background today.

Creating an alert in the Management view

  • Create an alert and ensure filter values are populated.

Editing an alert in the Management view

  • Edit the alert, ensure that filters populate and that when you save the alert and re-edit, the values continue to appear.

Editing old alerts

  • Checkout 884704d or earlier and create an alert, then load this patch. Ensure that the alert you created can be edited, and continues to work properly after you save it.
  • You should see an "old alert" call out notifying you that some fields will not auto-populate.
  • Check that the "old alert" call out no longer appears if you open the alert after saving.

In all cases, add and remove filter values and searches to validate that these components behave as desired.

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@justinkambic justinkambic added bug Fixes for quality problems that affect the customer experience v8.0.0 release_note:skip Skip the PR/issue when compiling release notes v7.8.0 v7.9.0 labels Jun 2, 2020
@justinkambic justinkambic self-assigned this Jun 2, 2020
@botelastic botelastic bot added the Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability label Jun 2, 2020
@justinkambic justinkambic marked this pull request as ready for review June 3, 2020 13:55
@justinkambic justinkambic requested a review from a team as a code owner June 3, 2020 13:55
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 in testing alerts !!

@justinkambic
Copy link
Contributor Author

@shahzad31 sorry to put you through another review, but I discovered another case where this wasn't behaving the way we want. I've committed significant code since your approval so we should verify that as well.

@justinkambic justinkambic requested a review from shahzad31 June 5, 2020 22:48
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

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 !!

@justinkambic justinkambic merged commit 858523e into elastic:master Jun 8, 2020
justinkambic added a commit to justinkambic/kibana that referenced this pull request Jun 8, 2020
* Extract store creation to plugin start, add redux providers to alert registration.

* Update unit test.

* Move alert registration to `setup` function.

* Allow external editing of uptime client alert types.

* Move alert initialization back to `start`.

* Clean up interfaces for alert types.

* Add code that will work for settings link even outside uptime app.

* Create new atomic params type for status alerts.

* Update executor params typing to support both alert params types.

* Update snapshot for alert factory function.

* Fix broken types and refresh snapshots.

* Allow edits of filters for monitor alerts.

* Support default parameter value for numTimes.

* Support default parameter values for timerange.

* Modify kuery bar to work for alert edits, fix some filter issues.

* Clean up tests and fix types.

* Fix types and add a test.

* Add callout and validation handling for old alerts while editing.

* Add a test for updated validation function.

* Define window for overview filters fetch action.

* Revert store initialization.

* Make monitor counter function while editing alerts.

* Refresh snapshot.

* Move snapshot count in monitor status alert to callout.

* Add new state for selected filters.

* Add basic functional tests for uptime alert flyouts.

* Fix broken types.

* Update unit tests with mock provider.

* Remove unneeded params from hook.

* Add more unit tests.

* Reducing functional test flakiness.

* Alert flyout controls update url only within Uptime app.

* Extract context interaction to container component, update snapshots.

* Add missing parameter to test file.

* Remove flaky functional test.

Co-authored-by: Elastic Machine <[email protected]>
Co-authored-by: Shahzad <[email protected]>
justinkambic added a commit to justinkambic/kibana that referenced this pull request Jun 8, 2020
* Extract store creation to plugin start, add redux providers to alert registration.

* Update unit test.

* Move alert registration to `setup` function.

* Allow external editing of uptime client alert types.

* Move alert initialization back to `start`.

* Clean up interfaces for alert types.

* Add code that will work for settings link even outside uptime app.

* Create new atomic params type for status alerts.

* Update executor params typing to support both alert params types.

* Update snapshot for alert factory function.

* Fix broken types and refresh snapshots.

* Allow edits of filters for monitor alerts.

* Support default parameter value for numTimes.

* Support default parameter values for timerange.

* Modify kuery bar to work for alert edits, fix some filter issues.

* Clean up tests and fix types.

* Fix types and add a test.

* Add callout and validation handling for old alerts while editing.

* Add a test for updated validation function.

* Define window for overview filters fetch action.

* Revert store initialization.

* Make monitor counter function while editing alerts.

* Refresh snapshot.

* Move snapshot count in monitor status alert to callout.

* Add new state for selected filters.

* Add basic functional tests for uptime alert flyouts.

* Fix broken types.

* Update unit tests with mock provider.

* Remove unneeded params from hook.

* Add more unit tests.

* Reducing functional test flakiness.

* Alert flyout controls update url only within Uptime app.

* Extract context interaction to container component, update snapshots.

* Add missing parameter to test file.

* Remove flaky functional test.

Co-authored-by: Elastic Machine <[email protected]>
Co-authored-by: Shahzad <[email protected]>
# Conflicts:
#	x-pack/plugins/uptime/public/lib/alert_types/monitor_status.tsx
justinkambic added a commit that referenced this pull request Jun 9, 2020
* Extract store creation to plugin start, add redux providers to alert registration.

* Update unit test.

* Move alert registration to `setup` function.

* Allow external editing of uptime client alert types.

* Move alert initialization back to `start`.

* Clean up interfaces for alert types.

* Add code that will work for settings link even outside uptime app.

* Create new atomic params type for status alerts.

* Update executor params typing to support both alert params types.

* Update snapshot for alert factory function.

* Fix broken types and refresh snapshots.

* Allow edits of filters for monitor alerts.

* Support default parameter value for numTimes.

* Support default parameter values for timerange.

* Modify kuery bar to work for alert edits, fix some filter issues.

* Clean up tests and fix types.

* Fix types and add a test.

* Add callout and validation handling for old alerts while editing.

* Add a test for updated validation function.

* Define window for overview filters fetch action.

* Revert store initialization.

* Make monitor counter function while editing alerts.

* Refresh snapshot.

* Move snapshot count in monitor status alert to callout.

* Add new state for selected filters.

* Add basic functional tests for uptime alert flyouts.

* Fix broken types.

* Update unit tests with mock provider.

* Remove unneeded params from hook.

* Add more unit tests.

* Reducing functional test flakiness.

* Alert flyout controls update url only within Uptime app.

* Extract context interaction to container component, update snapshots.

* Add missing parameter to test file.

* Remove flaky functional test.

Co-authored-by: Elastic Machine <[email protected]>
Co-authored-by: Shahzad <[email protected]>
# Conflicts:
#	x-pack/plugins/uptime/public/lib/alert_types/monitor_status.tsx

Co-authored-by: Elastic Machine <[email protected]>
@justinkambic
Copy link
Contributor Author

justinkambic commented Jun 9, 2020

justinkambic added a commit that referenced this pull request Jun 9, 2020
* Extract store creation to plugin start, add redux providers to alert registration.

* Update unit test.

* Move alert registration to `setup` function.

* Allow external editing of uptime client alert types.

* Move alert initialization back to `start`.

* Clean up interfaces for alert types.

* Add code that will work for settings link even outside uptime app.

* Create new atomic params type for status alerts.

* Update executor params typing to support both alert params types.

* Update snapshot for alert factory function.

* Fix broken types and refresh snapshots.

* Allow edits of filters for monitor alerts.

* Support default parameter value for numTimes.

* Support default parameter values for timerange.

* Modify kuery bar to work for alert edits, fix some filter issues.

* Clean up tests and fix types.

* Fix types and add a test.

* Add callout and validation handling for old alerts while editing.

* Add a test for updated validation function.

* Define window for overview filters fetch action.

* Revert store initialization.

* Make monitor counter function while editing alerts.

* Refresh snapshot.

* Move snapshot count in monitor status alert to callout.

* Add new state for selected filters.

* Add basic functional tests for uptime alert flyouts.

* Fix broken types.

* Update unit tests with mock provider.

* Remove unneeded params from hook.

* Add more unit tests.

* Reducing functional test flakiness.

* Alert flyout controls update url only within Uptime app.

* Extract context interaction to container component, update snapshots.

* Add missing parameter to test file.

* Remove flaky functional test.

Co-authored-by: Elastic Machine <[email protected]>
Co-authored-by: Shahzad <[email protected]>

Co-authored-by: Elastic Machine <[email protected]>
Co-authored-by: Shahzad <[email protected]>
@justinkambic justinkambic deleted the uptime_edit-alerts-ahead branch June 9, 2020 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience release_note:skip Skip the PR/issue when compiling release notes Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability v7.8.0 v7.9.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Uptime alerts aren't editable in Alerting Management UI
4 participants