-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
fix(crons): Serialize the config type correctly #85211
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 tasks
Codecov ReportAll modified and coverable lines are covered by tests ✅ ✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## master #85211 +/- ##
===========================================
+ Coverage 33.19% 87.97% +54.78%
===========================================
Files 8150 9627 +1477
Lines 452435 543922 +91487
Branches 21089 21089
===========================================
+ Hits 150202 478539 +328337
+ Misses 301930 65080 -236850
Partials 303 303 |
Comment on lines
+334
to
+338
config = obj.monitor_config.copy() if obj.monitor_config else {} | ||
if "schedule_type" in config: | ||
# XXX: We don't use monitor.get_schedule_type_display() in case it differs from the | ||
# config saved on the check-in | ||
config["schedule_type"] = ScheduleType.get_name(config["schedule_type"]) |
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.
Feels like what we probably really should be doing is having some type of sub-serializer for the config object, but this is fine for now I think
evanpurkhiser
approved these changes
Feb 14, 2025
leeandher
added a commit
that referenced
this pull request
Feb 14, 2025
Adds an all monitor checks page for cron issues with some custom cells. There is one thing that should be addressed though but it requires a backend fix, the schedule from the API currently returns the enum integer for the schedule (e.g. `1` instead of `crontab`). I will put up a PR to fix this serialization, since without it, the number appears in the tool tip, along with 'Unknown Schedule'. <img width="1197" alt="image" src="https://github.com/user-attachments/assets/4f93ed4d-6740-4f30-adee-e1b715655aa7" /> **todo** - [x] Add tests - [x] Put up the PR to change the serialization - #85211 --------- Co-authored-by: Evan Purkhiser <[email protected]>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Applies the serialization to the config that the frontend has been typed to expect. Specifically the schedule type being served as an integer, but expected as a string.