Skip to content

feat(ACI): Enable/disable detectors #93782

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

ceorourke
Copy link
Member

@ceorourke ceorourke commented Jun 18, 2025

Follow up to #93673 and precursor to https://github.com/getsentry/getsentry/pull/17739 to enable and disable detectors and the related query subscriptions.

@ceorourke ceorourke requested a review from a team as a code owner June 18, 2025 00:47
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Jun 18, 2025
Copy link

codecov bot commented Jun 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #93782      +/-   ##
==========================================
+ Coverage   81.66%   88.04%   +6.38%     
==========================================
  Files       10330    10339       +9     
  Lines      596288   596901     +613     
  Branches    23163    23163              
==========================================
+ Hits       486957   525563   +38606     
+ Misses     108875    70882   -37993     
  Partials      456      456              

@ceorourke ceorourke marked this pull request as ready for review June 18, 2025 16:51
@ceorourke ceorourke requested a review from a team June 18, 2025 19:56
@@ -1003,7 +1003,7 @@ def update_alert_rule(
return alert_rule


def update_detector(alert_rule: AlertRule, enabled: bool) -> None:
def update_dual_written_detector(alert_rule: AlertRule, enabled: bool) -> None:
Copy link
Contributor

Choose a reason for hiding this comment

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

should this method also be setting the enabled property on the detector since that's the field currently being used to filter detectors? (at least until we figure out all the status stuff)

I wasn't sure if this was being invoked after that was set or what not.

Copy link
Member Author

Choose a reason for hiding this comment

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

So https://github.com/getsentry/sentry/pull/93673/files was done incorrectly? Should I just change this all to enabled and not touch status?

Copy link
Contributor

Choose a reason for hiding this comment

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

the field the platform uses is enabled -- from office hours yesterday it sounds like that might change (thread discussing it as well).

I think for now, it's safest to set both -- until we can sort it all out.

)

detector.refresh_from_db()
assert detector.status == detector_status
Copy link
Contributor

Choose a reason for hiding this comment

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

should this also assert detector.enabled is True?

Copy link
Contributor

@saponifi3d saponifi3d left a comment

Choose a reason for hiding this comment

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

:shipit:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Backend Automatically applied to PRs that change backend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants