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

[Synthetics] Add error handling for private locations #137115

Conversation

dominiqueclarke
Copy link
Contributor

@dominiqueclarke dominiqueclarke commented Jul 25, 2022

Summary

Related to elastic/uptime#475

Adds better error handling for synthetics private locations.

When adding a monitor

Ensures that when downstream actions related to private locations fail, the monitor saved object does not save

When editing a monitor

Ensures that when downstream actions related to private locations fail, the monitor is not updated

When deleting a monitor

Ensures that when downstream actions related to private locations fail, the monitor is not deleted

Testing

I tested this PR by adding deliberate errors, such as reference issues, to the synthetics_private_location file, including the deleteMonitor, createMonitor, and editMonitor code paths.

  1. Add errors to the createMonitor code
  2. Navigate to the Uptime, create a private location, then attempt to create a monitor with a private location
  3. An error toast should appear
  4. Navigate to the Uptime monitor list. Ensure the monitor was not saved.
  5. Add errors to the editMonitor code
  6. Navigate to the Uptime, create a monitor without a private location. It should work successfully.
  7. Update that monitor by adding a new private location.
  8. An error toast should appear
  9. Navigate to the Uptime monitor list. Ensure the monitor was not updated and the new location does not appear to be saved
  10. Remove the error from createMonitor code
  11. Create a monitor with a private location. It should go through successfly.
  12. Add an error to the deleteMonitor code.
  13. Attempt to delete the monitor with the private location.
  14. An error toast should appear.
  15. Ensure the monitor is not deleted

Checklist

Delete any items that are not applicable to this PR.

@dominiqueclarke dominiqueclarke changed the title add error handling for private locations [Synthetics] Add error handling for private locations Jul 26, 2022
@dominiqueclarke dominiqueclarke added Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability enhancement New value added to drive a business result release_note:skip Skip the PR/issue when compiling release notes backport:skip This commit does not require backporting labels Jul 26, 2022
@dominiqueclarke dominiqueclarke marked this pull request as ready for review July 26, 2022 13:22
@dominiqueclarke dominiqueclarke requested a review from a team as a code owner July 26, 2022 13:22
@elasticmachine
Copy link
Contributor

Pinging @elastic/uptime (Team:uptime)

@dominiqueclarke
Copy link
Contributor Author

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

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

@dominiqueclarke dominiqueclarke merged commit 0fbfa50 into elastic:main Jul 26, 2022
@dominiqueclarke dominiqueclarke deleted the feature/synthetics-private-node-error-handling branch July 26, 2022 20:34
@lucasfcosta
Copy link
Contributor

Post-FF testing LGTM!

I did receive an error when trying to save the monitor after adding errors to its code.

priv-loc-save

Once I removed the error and saved it, editing with errors caused the monitor not to be edited, as expected.

edit-priv

Finally, deleting also didn't delete the saved object once I added errors to it.

delete-fails

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting 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 v8.4.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants