-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
fix(aci milestone 3): update the resolve datacondition when we update triggers #84202
base: master
Are you sure you want to change the base?
Conversation
if critical_data_condition is None: | ||
logger.error( | ||
"no data conditions exist for detector data condition group", | ||
"no critical or warning data conditions exist for detector data condition group", | ||
extra={"detector_data_condition_group": detector_triggers}, | ||
) | ||
return -1 |
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 I missed this in previous reviews, but why are we returning -1 instead of like none?
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.
Just an arbitrary integer value that is impossible as a valid threshold
❌ 1 Tests Failed:
View the top 1 failed tests by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
tests/sentry/incidents/endpoints/test_organization_alert_rule_details.py
Show resolved
Hide resolved
self.create_member( | ||
user=self.user, organization=self.organization, role="owner", teams=[self.team] | ||
) | ||
|
||
self.login_as(self.user) |
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.
can you put this into setup to avoid repeating it in each test?
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.
discussed offline that we'll implement the changes in a separate pr
If we update the a legacy alert rule's triggers, then we may have to update the resolution threshold on the resolve detector trigger (if no resolution threshold was specified on the alert rule). Create this update helper and add it to the serializer.
To facilitate this, I also updated the way we automatically get the resolution threshold. Now, instead of checking for the number of data conditions, we explicitly check for the critical and (optionally) warning data conditions, which we know have been previously dual written.