Skip to content
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

ref(rules): Don't fire delayed rules if they're snoozed #70203

Merged
merged 2 commits into from
May 7, 2024

Conversation

ceorourke
Copy link
Member

Follow up to #69830 (comment) to check the RuleSnooze table before firing a delayed rule, on the off chance it got muted in the < 1 minute it took to process.

Closes https://github.com/getsentry/team-core-product-foundations/issues/307

@ceorourke ceorourke requested a review from a team May 2, 2024 23:59
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label May 2, 2024
parsed_rulegroup_to_event_data = parse_rulegroup_to_event_data(rulegroup_to_event_data)

snoozed_rules = RuleSnooze.objects.filter(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thoughts on moving this condition to step 3? I was thinking it if we filter the snoozed alert rules there (around line 272) it would mean we don't have to process the alerts in the other steps as well.

Comment on lines +273 to +275
snoozed_rules = RuleSnooze.objects.filter(rule__in=alert_rules, user_id=None).values_list(
"rule", flat=True
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Let's convert this to a set?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm about to do follow ups in this file so I'll change it there!

@ceorourke ceorourke merged commit 0c25ab6 into master May 7, 2024
47 checks passed
@ceorourke ceorourke deleted the ceorourke/check-rulesnooze-before-fire branch May 7, 2024 18:26
@github-actions github-actions bot locked and limited conversation to collaborators May 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Scope: Backend Automatically applied to PRs that change backend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants