Skip to content

Commit aa488a8

Browse files
mifu67priscilawebdev
authored andcommitted
chore(aci milestone 3): remove processing feature flags (#102456)
Trying again now that subscription processor code has removed references to AlertRule. Flags removed: - `organizations:workflow-engine-process-metric-issue-workflows` - `organizations:workflow-engine-metric-alert-processing` - `organizations:workflow-engine-single-process-metric-issues`
1 parent e9829a8 commit aa488a8

36 files changed

+18
-4379
lines changed

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,6 @@ module = [
742742
"tests.sentry.flags.*",
743743
"tests.sentry.grouping.*",
744744
"tests.sentry.hybridcloud.*",
745-
"tests.sentry.incidents.action_handlers.*",
746745
"tests.sentry.incidents.handlers.*",
747746
"tests.sentry.incidents.serializers.*",
748747
"tests.sentry.insights.*",

src/sentry/features/temporary.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ def register_temporary_features(manager: FeatureManager) -> None:
527527
# Enable dual writing for issue alert issues (see: alerts create issues)
528528
manager.add("organizations:workflow-engine-issue-alert-dual-write", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=False)
529529
# Enable workflow processing for metric issues
530-
manager.add("organizations:workflow-engine-process-metric-issue-workflows", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=False)
530+
manager.add("organizations:workflow-engine-process-metric-issue-workflows", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=False, default=True)
531531
# Enable single processing through workflow engine for issue alerts
532532
manager.add("organizations:workflow-engine-single-process-workflows", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True)
533533
# Enable logging to debug workflow engine process workflows
@@ -537,7 +537,7 @@ def register_temporary_features(manager: FeatureManager) -> None:
537537
# Enable logs to debug metric alert dual processing
538538
manager.add("organizations:workflow-engine-metric-alert-dual-processing-logs", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=False)
539539
# Enable Processing for Metric Alerts in the workflow_engine
540-
manager.add("organizations:workflow-engine-metric-alert-processing", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=False)
540+
manager.add("organizations:workflow-engine-metric-alert-processing", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=False, default=True)
541541
# Enable Creation of Metric Alerts that use the `group_by` field in the workflow_engine
542542
manager.add("organizations:workflow-engine-metric-alert-group-by-creation", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=False)
543543
# Enable ingestion through trusted relays only
@@ -549,7 +549,7 @@ def register_temporary_features(manager: FeatureManager) -> None:
549549
# Use workflow engine serializers to return data for old rule / incident endpoints
550550
manager.add("organizations:workflow-engine-rule-serializers", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=False)
551551
# Enable single processing of metric issues
552-
manager.add("organizations:workflow-engine-single-process-metric-issues", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=False)
552+
manager.add("organizations:workflow-engine-single-process-metric-issues", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=False, default=True)
553553
# Enable metric detector limits by plan type
554554
manager.add("organizations:workflow-engine-metric-detector-limit", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True)
555555
# Enable EventUniqueUserFrequencyConditionWithConditions special alert condition

src/sentry/incidents/charts.py

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -139,17 +139,13 @@ def fetch_metric_issue_open_periods(
139139
) -> list[Any]:
140140
detector_id = open_period_identifier
141141
try:
142-
if features.has(
143-
"organizations:workflow-engine-single-process-metric-issues",
144-
organization, # Metric issue single processing
145-
):
146-
# temporarily fetch the alert rule ID from the detector ID
147-
alert_rule_detector = AlertRuleDetector.objects.filter(
148-
detector_id=open_period_identifier, alert_rule_id__isnull=False
149-
).first()
150-
if alert_rule_detector is not None:
151-
# open_period_identifier is a metric detector ID -> get the alert rule ID
152-
open_period_identifier = alert_rule_detector.alert_rule_id
142+
# temporarily fetch the alert rule ID from the detector ID
143+
alert_rule_detector = AlertRuleDetector.objects.filter(
144+
detector_id=open_period_identifier, alert_rule_id__isnull=False
145+
).first()
146+
if alert_rule_detector is not None:
147+
# open_period_identifier is a metric detector ID -> get the alert rule ID
148+
open_period_identifier = alert_rule_detector.alert_rule_id
153149

154150
if features.has(
155151
"organizations:new-metric-issue-charts",

src/sentry/issues/ingest.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from django.conf import settings
1111
from django.db import router, transaction
1212

13-
from sentry import eventstream, features
13+
from sentry import eventstream
1414
from sentry.constants import LOG_LEVELS_MAP, MAX_CULPRIT_LENGTH
1515
from sentry.event_manager import (
1616
GroupInfo,
@@ -74,9 +74,7 @@ def save_issue_occurrence(
7474
_get_or_create_group_release(environment, release, event, [group_info])
7575

7676
# Create IncidentGroupOpenPeriod relationship for metric issues
77-
if occurrence.type == MetricIssue and features.has(
78-
"organizations:workflow-engine-single-process-metric-issues", event.organization
79-
):
77+
if occurrence.type == MetricIssue:
8078
open_period = get_latest_open_period(group_info.group)
8179
if open_period:
8280
IncidentGroupOpenPeriod.create_from_occurrence(

src/sentry/notifications/notification_action/types.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -486,13 +486,6 @@ def invoke_legacy_registry(
486486
if isinstance(event, GroupEvent):
487487
evidence_data, priority = cls._extract_from_group_event(event)
488488
elif isinstance(event, Activity):
489-
# we only want to fire resolution activities if we are single processing
490-
if not features.has(
491-
"organizations:workflow-engine-single-process-metric-issues",
492-
event_data.group.organization,
493-
):
494-
return
495-
496489
evidence_data, priority = cls._extract_from_activity(event)
497490
else:
498491
raise ValueError(

src/sentry/notifications/notification_action/utils.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,7 @@ def should_fire_workflow_actions(org: Organization, type_id: int) -> bool:
2828
in rollout_type_ids # While we are rolling out these groups & we are single processing
2929
and features.has("organizations:workflow-engine-single-process-workflows", org)
3030
)
31-
or (
32-
type_id == MetricIssue.type_id
33-
and features.has(
34-
"organizations:workflow-engine-single-process-metric-issues",
35-
org, # Metric issue single processing
36-
)
37-
)
31+
or (type_id == MetricIssue.type_id)
3832
or features.has(
3933
"organizations:workflow-engine-trigger-actions",
4034
org, # Other action testing

src/sentry/tasks/post_process.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,13 +1046,6 @@ def process_workflow_engine_metric_issues(job: PostProcessJob) -> None:
10461046
if job["is_reprocessed"]:
10471047
return
10481048

1049-
org = job["event"].project.organization
1050-
if not (
1051-
features.has("organizations:workflow-engine-process-metric-issue-workflows", org)
1052-
or features.has("organizations:workflow-engine-single-process-metric-issues", org)
1053-
):
1054-
return
1055-
10561049
process_workflow_engine(job)
10571050

10581051

src/sentry/workflow_engine/handlers/workflow/workflow_status_update_handler.py

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import logging
22

3-
from sentry import features
43
from sentry.issues.status_change_consumer import group_status_update_registry
54
from sentry.issues.status_change_message import StatusChangeMessageData
65
from sentry.models.activity import Activity
@@ -43,26 +42,8 @@ def workflow_status_update_handler(
4342
metrics.incr("workflow_engine.tasks.error.no_detector_id")
4443
return
4544

46-
# We should only fire actions for activity updates if we should be firing actions
47-
# if dual proccessing or single proccessing is enabled
48-
if features.has( # Metric issue single processing
49-
"organizations:workflow-engine-single-process-metric-issues",
50-
group.organization,
51-
) or features.has( # Metric dual processing
52-
"organizations:workflow-engine-metric-alert-processing",
53-
group.organization,
54-
):
55-
process_workflow_activity.delay(
56-
activity_id=activity.id,
57-
group_id=group.id,
58-
detector_id=detector_id,
59-
)
60-
else:
61-
logger.info(
62-
"workflow_engine.tasks.process_workflows.activity_update.skipped",
63-
extra={
64-
"activity_id": activity.id,
65-
"group_id": group.id,
66-
"detector_id": detector_id,
67-
},
68-
)
45+
process_workflow_activity.delay(
46+
activity_id=activity.id,
47+
group_id=group.id,
48+
detector_id=detector_id,
49+
)

src/sentry/workflow_engine/models/incident_groupopenperiod.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from django.db import IntegrityError, models
44
from django.db.models import Q
55

6-
from sentry import features
76
from sentry.backup.scopes import RelocationScope
87
from sentry.db.models import (
98
BoundedBigIntegerField,
@@ -240,11 +239,6 @@ def update_incident_activity_based_on_group_activity(
240239
logger.warning("No open period found for group", extra={"group_id": group.id})
241240
return
242241

243-
if not features.has(
244-
"organizations:workflow-engine-single-process-metric-issues", group.project.organization
245-
):
246-
return
247-
248242
# get the incident for the open period
249243
try:
250244
incident_id = IncidentGroupOpenPeriod.objects.get(group_open_period=open_period).incident_id
@@ -293,11 +287,6 @@ def update_incident_based_on_open_period_status_change(
293287
logger.warning("No open period found for group", extra={"group_id": group.id})
294288
return
295289

296-
if not features.has(
297-
"organizations:workflow-engine-single-process-metric-issues", group.project.organization
298-
):
299-
return
300-
301290
# get the incident for the open period
302291
try:
303292
incident_id = IncidentGroupOpenPeriod.objects.get(group_open_period=open_period).incident_id

tests/sentry/incidents/action_handlers/__init__.py

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)