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

feat(alert-rules): Add validation for schema fields attached to alert rules #29226

Merged
merged 11 commits into from
Oct 12, 2021

Conversation

leeandher
Copy link
Member

@leeandher leeandher commented Oct 8, 2021

See API-2168

This PR adds some validation to the forms coming in to create alert rules with UI components. Since the payload is directly sent to the third party, and we have a schema of what to expect, this will eliminate some obviously malformed request instead of ignoring errors or forcing a network request to identify them.

TODO

  • Add tests
  • Write PR description
  • Take screenshots for proof

Full API Demo

Here you can see all the errors that are being tested for being surfaced. These errors would show up as toasts above the alert rule's action nodes, but it would involve bypassing the frontend validation which is a lot of tedious work to image all the errors showing up, so instead I just recorded some Postman proof. Here's an example of the error being surfaced.

image

And here are all the possible errors that can be surfaced:

Dynamic.Form.Validation.API.mov

@leeandher leeandher assigned ceorourke and mgaeta and unassigned leeandher Oct 12, 2021
@leeandher leeandher merged commit f26d50a into master Oct 12, 2021
@leeandher leeandher deleted the schema-validation/API-2168 branch October 12, 2021 23:41
@github-actions github-actions bot locked and limited conversation to collaborators Oct 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants