-
-
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(severity): Use new escalation logic for archived issues <1 day old #61396
Conversation
@@ -1367,7 +1378,10 @@ def detect_new_escalation(job: PostProcessJob): | |||
): | |||
return | |||
group_age_hours = (datetime.now() - group.first_seen).total_seconds() / 3600 | |||
if group_age_hours >= MAX_NEW_ESCALATION_AGE_HOURS or group.substatus != GroupSubStatus.NEW: | |||
has_valid_status = group.substatus == GroupSubStatus.NEW or ( | |||
group.status == GroupStatus.IGNORED and group.substatus == GroupSubStatus.UNTIL_ESCALATING |
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.
rn there aren't cases where we'd have GroupSubStatus.UNTIL_ESCALATING
without GroupStatus.IGNORED
but i thought it was worth checking for status any way in case we decided to use the substatus for other things
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #61396 +/- ##
=======================================
Coverage 81.12% 81.12%
=======================================
Files 5191 5191
Lines 227915 227919 +4
Branches 38225 38225
=======================================
+ Hits 184889 184896 +7
+ Misses 37411 37410 -1
+ Partials 5615 5613 -2
|
@@ -1366,8 +1374,11 @@ def detect_new_escalation(job: PostProcessJob): | |||
"projects:first-event-severity-new-escalation", job["event"].project | |||
): | |||
return | |||
group_age_hours = (datetime.now() - group.first_seen).total_seconds() / 3600 | |||
if group_age_hours >= MAX_NEW_ESCALATION_AGE_HOURS or group.substatus != GroupSubStatus.NEW: | |||
group_age_hours = (timezone.now() - group.first_seen).total_seconds() / 3600 |
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 datetime.now()
originally worked because our test data had first_seen
set with a datetime
, but based on the table schema it seems like we save groups with timezone info?
This PR updates archived -> escalating issues so that if they are less than a day old, they use the new escalation logic, otherwise they use the existing logic.
This PR also changes the new escalation logic tests to use
timezone
instead ofdatetime
sincefirst_seen
onGroup
is timezone-aware.Resolves #60418