From 6ce6fef2db4ff6d0e52185c9312b1bedd11b38a0 Mon Sep 17 00:00:00 2001 From: anthony sottile Date: Wed, 3 Jul 2024 16:08:22 -0400 Subject: [PATCH] ref: fix Activity nullability issues in sentry.rules.conditions --- .../rules/conditions/existing_high_priority_issue.py | 8 ++++++-- src/sentry/rules/conditions/new_high_priority_issue.py | 8 ++++++-- src/sentry/rules/conditions/reappeared_event.py | 8 ++++++-- src/sentry/rules/conditions/regression_event.py | 8 ++++++-- 4 files changed, 24 insertions(+), 8 deletions(-) diff --git a/src/sentry/rules/conditions/existing_high_priority_issue.py b/src/sentry/rules/conditions/existing_high_priority_issue.py index ae24439466e8a4..04f8bd73fa67f2 100644 --- a/src/sentry/rules/conditions/existing_high_priority_issue.py +++ b/src/sentry/rules/conditions/existing_high_priority_issue.py @@ -42,7 +42,11 @@ def get_activity( return [ ConditionActivity( - group_id=a[0], type=ConditionActivityType.REAPPEARED, timestamp=a[1], data=a[2] + group_id=group_id, + type=ConditionActivityType.REAPPEARED, + timestamp=timestamp, + data=data, ) - for a in activities + for group_id, timestamp, data in activities + if group_id is not None ] diff --git a/src/sentry/rules/conditions/new_high_priority_issue.py b/src/sentry/rules/conditions/new_high_priority_issue.py index af01bbf7a2538a..4034ca5cc0ff62 100644 --- a/src/sentry/rules/conditions/new_high_priority_issue.py +++ b/src/sentry/rules/conditions/new_high_priority_issue.py @@ -49,7 +49,11 @@ def get_activity( return [ ConditionActivity( - group_id=a[0], type=ConditionActivityType.REAPPEARED, timestamp=a[1], data=a[2] + group_id=group_id, + type=ConditionActivityType.REAPPEARED, + timestamp=timestamp, + data=data, ) - for a in activities + for group_id, timestamp, data in activities + if group_id is not None ] diff --git a/src/sentry/rules/conditions/reappeared_event.py b/src/sentry/rules/conditions/reappeared_event.py index 8120954c226f08..3b12b393798560 100644 --- a/src/sentry/rules/conditions/reappeared_event.py +++ b/src/sentry/rules/conditions/reappeared_event.py @@ -34,7 +34,11 @@ def get_activity( return [ ConditionActivity( - group_id=a[0], type=ConditionActivityType.REAPPEARED, timestamp=a[1], data=a[2] + group_id=group_id, + type=ConditionActivityType.REAPPEARED, + timestamp=timestamp, + data=data, ) - for a in activities + for group_id, timestamp, data in activities + if group_id is not None ] diff --git a/src/sentry/rules/conditions/regression_event.py b/src/sentry/rules/conditions/regression_event.py index 836840528c39cc..65abc9eeb34a63 100644 --- a/src/sentry/rules/conditions/regression_event.py +++ b/src/sentry/rules/conditions/regression_event.py @@ -32,7 +32,11 @@ def get_activity( return [ ConditionActivity( - group_id=a[0], type=ConditionActivityType.REGRESSION, timestamp=a[1], data=a[2] + group_id=group_id, + type=ConditionActivityType.REGRESSION, + timestamp=timestamp, + data=data, ) - for a in activities + for group_id, timestamp, data in activities + if group_id is not None ]