Skip to content

Commit b0ab7ad

Browse files
committed
ref(seer): Split lightweight RCA clustering into separate read/write flags
- Write: organizations:supergroups-lightweight-rca-clustering-write (controls post_process task dispatch for generating embeddings) - Read: organizations:supergroups-lightweight-rca-clustering-read (controls which rca_source supergroup query endpoints use) Allows enabling write ahead of read to accumulate embeddings before switching what users see.
1 parent 7b309e4 commit b0ab7ad

File tree

7 files changed

+17
-9
lines changed

7 files changed

+17
-9
lines changed

src/sentry/features/temporary.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -571,8 +571,10 @@ def register_temporary_features(manager: FeatureManager) -> None:
571571
manager.add("projects:supergroup-embeddings-explorer", ProjectFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=False)
572572
# Enable lightweight Explorer RCA runs for supergroup quality evaluation
573573
manager.add("projects:supergroup-lightweight-rca", ProjectFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=False)
574-
# Use lightweight RCA source for supergroup clustering and queries
575-
manager.add("organizations:supergroups-lightweight-rca-clustering", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=False)
574+
# Enable lightweight RCA clustering write path (generate embeddings on new issues)
575+
manager.add("organizations:supergroups-lightweight-rca-clustering-write", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=False)
576+
# Enable lightweight RCA clustering read path (query lightweight embeddings in supergroup APIs)
577+
manager.add("organizations:supergroups-lightweight-rca-clustering-read", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=False)
576578

577579
manager.add("projects:workflow-engine-performance-detectors", ProjectFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=False)
578580

src/sentry/seer/supergroups/endpoints/organization_supergroup_details.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ def get(self, request: Request, organization: Organization, supergroup_id: int)
3737

3838
rca_source = (
3939
RCASource.LIGHTWEIGHT
40-
if features.has("organizations:supergroups-lightweight-rca-clustering", organization)
40+
if features.has(
41+
"organizations:supergroups-lightweight-rca-clustering-read", organization
42+
)
4143
else RCASource.EXPLORER
4244
)
4345

src/sentry/seer/supergroups/endpoints/organization_supergroups_by_group.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ def get(self, request: Request, organization: Organization) -> Response:
8080

8181
rca_source = (
8282
RCASource.LIGHTWEIGHT
83-
if features.has("organizations:supergroups-lightweight-rca-clustering", organization)
83+
if features.has(
84+
"organizations:supergroups-lightweight-rca-clustering-read", organization
85+
)
8486
else RCASource.EXPLORER
8587
)
8688

src/sentry/tasks/post_process.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1593,7 +1593,9 @@ def kick_off_lightweight_rca_cluster(job: PostProcessJob) -> None:
15931593
event = job["event"]
15941594
group = event.group
15951595

1596-
if not features.has("organizations:supergroups-lightweight-rca-clustering", group.organization):
1596+
if not features.has(
1597+
"organizations:supergroups-lightweight-rca-clustering-write", group.organization
1598+
):
15971599
return
15981600

15991601
trigger_lightweight_rca_cluster_task.delay(group.id)

tests/sentry/seer/supergroups/endpoints/test_organization_supergroup_details.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def test_rca_source_lightweight_when_flag_enabled(self, mock_seer):
5858
with self.feature(
5959
{
6060
"organizations:top-issues-ui": True,
61-
"organizations:supergroups-lightweight-rca-clustering": True,
61+
"organizations:supergroups-lightweight-rca-clustering-read": True,
6262
}
6363
):
6464
self.get_success_response(self.organization.slug, "1")

tests/sentry/seer/supergroups/endpoints/test_organization_supergroups_by_group.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def test_rca_source_lightweight_when_flag_enabled(self, mock_seer):
9999
with self.feature(
100100
{
101101
"organizations:top-issues-ui": True,
102-
"organizations:supergroups-lightweight-rca-clustering": True,
102+
"organizations:supergroups-lightweight-rca-clustering-read": True,
103103
}
104104
):
105105
self.get_success_response(

tests/sentry/tasks/test_post_process.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3078,7 +3078,7 @@ def test_kick_off_lightweight_rca_cluster_when_enabled(self, mock_task):
30783078
project_id=self.project.id,
30793079
)
30803080

3081-
with self.feature("organizations:supergroups-lightweight-rca-clustering"):
3081+
with self.feature("organizations:supergroups-lightweight-rca-clustering-write"):
30823082
self.call_post_process_group(
30833083
is_new=True,
30843084
is_regression=False,
@@ -3111,7 +3111,7 @@ def test_kick_off_lightweight_rca_cluster_skips_when_not_new(self, mock_task):
31113111
project_id=self.project.id,
31123112
)
31133113

3114-
with self.feature("organizations:supergroups-lightweight-rca-clustering"):
3114+
with self.feature("organizations:supergroups-lightweight-rca-clustering-write"):
31153115
self.call_post_process_group(
31163116
is_new=False,
31173117
is_regression=False,

0 commit comments

Comments
 (0)