Skip to content

Commit 5ad54ec

Browse files
committed
feat(ACI): Release rule stats and group history wfe endpoints
1 parent 4193a56 commit 5ad54ec

File tree

4 files changed

+13
-0
lines changed

4 files changed

+13
-0
lines changed

src/sentry/features/temporary.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,9 @@ def register_temporary_features(manager: FeatureManager) -> None:
434434
# Use workflow engine exclusively for OrganizationCombinedRuleIndexEndpoint.get results.
435435
# See src/sentry/workflow_engine/docs/legacy_backport.md for context.
436436
manager.add("organizations:workflow-engine-combinedruleindex-get", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=False)
437+
# Use workflow engine exclusively for ProjectRuleGroupHistoryIndexEndpoint.get and ProjectRuleStatsIndexEndpoint.get results.
438+
# See src/sentry/workflow_engine/docs/legacy_backport.md for context.
439+
manager.add("organizations:workflow-engine-projectrulegroupstats-get", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=False)
437440
# Enable metric detector limits by plan type
438441
manager.add("organizations:workflow-engine-metric-detector-limit", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True)
439442
# Enable EventUniqueUserFrequencyConditionWithConditions special alert condition

src/sentry/rules/history/endpoints/project_rule_group_history.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ def serialize(
5757
@extend_schema(tags=["issue_alerts"])
5858
@cell_silo_endpoint
5959
class ProjectRuleGroupHistoryIndexEndpoint(WorkflowEngineRuleEndpoint):
60+
workflow_engine_method_flags = {
61+
"GET": "organizations:workflow-engine-projectrulegroupstats-get",
62+
}
6063
publish_status = {
6164
"GET": ApiPublishStatus.EXPERIMENTAL,
6265
}

src/sentry/rules/history/endpoints/project_rule_stats.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ def serialize(
4040
@extend_schema(tags=["issue_alerts"])
4141
@cell_silo_endpoint
4242
class ProjectRuleStatsIndexEndpoint(WorkflowEngineRuleEndpoint):
43+
workflow_engine_method_flags = {
44+
"GET": "organizations:workflow-engine-projectrulegroupstats-get",
45+
}
4346
publish_status = {
4447
"GET": ApiPublishStatus.EXPERIMENTAL,
4548
}

tests/sentry/rules/history/backends/test_postgres.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ def test_event_id(self) -> None:
197197
)
198198

199199
@with_feature("organizations:workflow-engine-rule-serializers")
200+
@with_feature("organizations:workflow-engine-projectrulegroupstats-get")
200201
def test_single_written_workflow_history(self) -> None:
201202
"""Test using WorkflowFireHistory when feature flag is enabled"""
202203
workflow_triggers = self.create_data_condition_group()
@@ -276,6 +277,7 @@ def test_single_written_workflow_history(self) -> None:
276277
)
277278

278279
@with_feature("organizations:workflow-engine-rule-serializers")
280+
@with_feature("organizations:workflow-engine-projectrulegroupstats-get")
279281
def test_combined_rule_and_workflow_history(self) -> None:
280282
"""Test combining RuleFireHistory and WorkflowFireHistory when both exist"""
281283
rule = self.create_project_rule(project=self.event.project)
@@ -416,6 +418,7 @@ def test(self) -> None:
416418
assert [r.count for r in results[-5:]] == [0, 0, 1, 1, 0]
417419

418420
@with_feature("organizations:workflow-engine-rule-serializers")
421+
@with_feature("organizations:workflow-engine-projectrulegroupstats-get")
419422
def test_single_written_workflow_history(self) -> None:
420423
"""Test using WorkflowFireHistory when feature flag is enabled"""
421424
workflow_triggers = self.create_data_condition_group()
@@ -452,6 +455,7 @@ def test_single_written_workflow_history(self) -> None:
452455
assert [r.count for r in results[-5:]] == [0, 2, 0, 1, 0]
453456

454457
@with_feature("organizations:workflow-engine-rule-serializers")
458+
@with_feature("organizations:workflow-engine-projectrulegroupstats-get")
455459
def test_combined_rule_and_workflow_history(self) -> None:
456460
"""Test combining RuleFireHistory and WorkflowFireHistory when both exist"""
457461
rule = self.create_project_rule(project=self.event.project)

0 commit comments

Comments
 (0)