-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
chore(aci milestone 3): migrate remaining anomaly detection alerts #93574
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
base: master
Are you sure you want to change the base?
chore(aci milestone 3): migrate remaining anomaly detection alerts #93574
Conversation
alert_rules = AlertRule.objects_with_snapshots.filter( | ||
status__in=[ | ||
AlertRuleStatus.PENDING.value, | ||
AlertRuleStatus.NOT_ENOUGH_DATA.value, | ||
], | ||
detection_type="dynamic", | ||
).filter(~Exists(AlertRuleDetector.objects.filter(alert_rule_id=OuterRef("id")))) |
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.
Main change is here—fetching the anomaly detection alerts that were not migrated.
AlertRuleTriggerActionType.SLACK.value: "Slack", | ||
AlertRuleTriggerActionType.MSTEAMS.value: "Microsoft Teams", | ||
AlertRuleTriggerActionType.OPSGENIE.value: "Opsgenie", | ||
AlertRuleTriggerActionType.DISCORD.value: "Discord", |
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.
Added this.
This PR has a migration; here is the generated SQL for for --
-- Raw Python operation
--
-- THIS OPERATION CANNOT BE WRITTEN AS SQL |
else: | ||
return "Email [removed]" |
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.
Added this.
Codecov ReportAttention: Patch coverage is ✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## master #93574 +/- ##
===========================================
+ Coverage 46.30% 88.00% +41.69%
===========================================
Files 10306 10324 +18
Lines 594236 595501 +1265
Branches 23141 23141
===========================================
+ Hits 275175 524079 +248904
+ Misses 318568 70929 -247639
Partials 493 493 |
condition_result=DetectorPriorityLevel.OK, | ||
).exists() | ||
|
||
def test_simple_trigger_action(self): |
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.
Is there a test case that replicates the situation the remaining alerts are in?
Migrate the alerts that didn't get correctly migrated the first run (due to errors with discord actions or the migration stalling).