-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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 fallback and validation for report and cron timezones #17338
Conversation
Codecov Report
@@ Coverage Diff @@
## master #17338 +/- ##
==========================================
- Coverage 77.01% 76.96% -0.05%
==========================================
Files 1040 1041 +1
Lines 56074 56070 -4
Branches 7735 7735
==========================================
- Hits 43188 43157 -31
- Misses 12628 12655 +27
Partials 258 258
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
a185067
to
b208ded
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.
This is great!
timezone = fields.String( | ||
description=timezone_description, | ||
default="UTC", | ||
validate=validate.OneOf(choices=tuple(all_timezones)), |
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.
Nice!
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.
LGTM!
df6f550
to
6c58a3b
Compare
6c58a3b
to
07e11fd
Compare
* add fallback and validation for report and cron timezones * add logging to exception catch * Run black Co-authored-by: Beto Dealmeida <roberto@dealmeida.net> (cherry picked from commit f10bc6d)
* add fallback and validation for report and cron timezones * add logging to exception catch * Run black Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>
SUMMARY
It was possible for short period of time to save an invalid timezone value (GMT Standard Time) in the reports schedule, which was causing errors and failures when running the cron job. With this change, I am catching any cron errors with regard to the timezone function and defaulting to UTC. I also added timezone validation when creating a report.
TESTING INSTRUCTIONS
unit and integration tests have been updated. To manually test, you should be able to create and run a report with a timezone. You should not be able to create a report with a bad timezone.
ADDITIONAL INFORMATION