-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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(crons): Implement simple incident occurence dispatching #80773
base: master
Are you sure you want to change the base?
feat(crons): Implement simple incident occurence dispatching #80773
Conversation
ba25e24
to
4f02b73
Compare
Simply deserializes the IncidentOccurrence messages and dispatches the incident occurrence. Does not yet determine if the clock tick should cause the dispatch to be delayed.
4f02b73
to
cc1b540
Compare
Codecov ReportAttention: Patch coverage is ✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## master #80773 +/- ##
==========================================
- Coverage 78.39% 78.39% -0.01%
==========================================
Files 7206 7206
Lines 319438 319458 +20
Branches 43991 43992 +1
==========================================
+ Hits 250437 250449 +12
- Misses 62620 62626 +6
- Partials 6381 6383 +2 |
def has_all(checkins: list[MonitorCheckIn | None]) -> TypeGuard[list[MonitorCheckIn]]: | ||
return None not in checkins | ||
|
||
# Unlikeky, but if we can't find all the check-ins we can't produce an occurence |
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.
# Unlikeky, but if we can't find all the check-ins we can't produce an occurence | |
# Unlikely, but if we can't find all the check-ins we can't produce an occurence |
try: | ||
incident = MonitorIncident.objects.get(id=int(wrapper["incident_id"])) | ||
except MonitorIncident.DoesNotExist: | ||
return |
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.
worth adding a test case for this?
|
||
# Unlikeky, but if we can't find all the check-ins we can't produce an occurence | ||
if failed_checkin is None or not has_all(previous_checkins): | ||
logger.error("missing_check_ins") |
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.
worth adding a test case for this?
Simply deserializes the IncidentOccurrence messages and dispatches the
incident occurrence.
Does not yet determine if the clock tick should cause the dispatch to be
delayed.