Skip to content

Commit 2b84529

Browse files
committed
ref(seer): Remove duplicate org check from trigger_lightweight_rca_cluster
The org eligibility check is already done in the pipeline step before scheduling the task, so there's no need to check again in the function itself.
1 parent c984fcf commit 2b84529

File tree

2 files changed

+4
-19
lines changed

2 files changed

+4
-19
lines changed

src/sentry/seer/supergroups/lightweight_rca_cluster.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import logging
44

5-
from sentry import options
65
from sentry.api.serializers import EventSerializer, serialize
76
from sentry.eventstore import backend as eventstore
87
from sentry.models.group import Group
@@ -23,10 +22,6 @@ def trigger_lightweight_rca_cluster(group: Group) -> None:
2322
Sends issue event data to Seer, which generates a lightweight root cause analysis
2423
and clusters the issue into supergroups based on embedding similarity.
2524
"""
26-
enabled_orgs: list[int] = options.get("supergroups.lightweight-enabled-orgs")
27-
if group.organization.id not in enabled_orgs:
28-
return
29-
3025
event = group.get_recommended_event_for_environments()
3126
if not event:
3227
event = group.get_latest_event()

tests/sentry/seer/supergroups/test_lightweight_rca_cluster.py

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ def setUp(self):
1919
def test_calls_seer_with_correct_payload(self, mock_request):
2020
mock_request.return_value.status = 200
2121

22-
with self.options({"supergroups.lightweight-enabled-orgs": [self.group.organization.id]}):
23-
trigger_lightweight_rca_cluster(self.group)
22+
trigger_lightweight_rca_cluster(self.group)
2423

2524
mock_request.assert_called_once()
2625
body = mock_request.call_args.args[0]
@@ -33,27 +32,18 @@ def test_calls_seer_with_correct_payload(self, mock_request):
3332
assert "events" in body["issue"]
3433
assert len(body["issue"]["events"]) == 1
3534

36-
@patch("sentry.seer.supergroups.lightweight_rca_cluster.make_lightweight_rca_cluster_request")
37-
def test_skips_when_org_not_enabled(self, mock_request):
38-
with self.options({"supergroups.lightweight-enabled-orgs": []}):
39-
trigger_lightweight_rca_cluster(self.group)
40-
41-
mock_request.assert_not_called()
42-
4335
@patch("sentry.seer.supergroups.lightweight_rca_cluster.make_lightweight_rca_cluster_request")
4436
def test_raises_on_seer_error(self, mock_request):
4537
mock_request.return_value.status = 500
4638

47-
with self.options({"supergroups.lightweight-enabled-orgs": [self.group.organization.id]}):
48-
with pytest.raises(Exception):
49-
trigger_lightweight_rca_cluster(self.group)
39+
with pytest.raises(Exception):
40+
trigger_lightweight_rca_cluster(self.group)
5041

5142
@patch("sentry.seer.supergroups.lightweight_rca_cluster.make_lightweight_rca_cluster_request")
5243
def test_passes_viewer_context(self, mock_request):
5344
mock_request.return_value.status = 200
5445

55-
with self.options({"supergroups.lightweight-enabled-orgs": [self.group.organization.id]}):
56-
trigger_lightweight_rca_cluster(self.group)
46+
trigger_lightweight_rca_cluster(self.group)
5747

5848
call_kwargs = mock_request.call_args.kwargs
5949
assert call_kwargs["viewer_context"]["organization_id"] == self.group.organization.id

0 commit comments

Comments
 (0)