-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
fix: add alert report timeout limits #12926
fix: add alert report timeout limits #12926
Conversation
Codecov Report
@@ Coverage Diff @@
## master #12926 +/- ##
===========================================
+ Coverage 53.06% 66.78% +13.72%
===========================================
Files 489 493 +4
Lines 17314 29084 +11770
Branches 4482 0 -4482
===========================================
+ Hits 9187 19425 +10238
- Misses 8127 9659 +1532
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it makes sense to add a validation on the backend also:
https://github.com/apache/superset/blob/master/superset/reports/schemas.py#L162
fields.Integer(validate=[Range(min=1, error="Value must be greater than 0")])
Let's also add a test for this change. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
Do we enforce this on the BE as well?
3dbdf83
to
9c7a1d2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One comment on the python. Let's add some tests for the back-end validations as well.
description=grace_period_description, | ||
example=60 * 60 * 4, | ||
default=60 * 60 * 4, | ||
validate=[Range(min=1, error=_("Value must be greater than 0"))], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if this is correct, as reports do not require a grace period.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I may be mistaken, but I'm pretty sure we use this schema for both alerts and reports.
SUMMARY
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TEST PLAN
Manual Test:
ADDITIONAL INFORMATION