From b51b629000e139758883f8c9ae532b0f6130a70f Mon Sep 17 00:00:00 2001 From: Rudra Patel Date: Thu, 20 Aug 2026 15:16:02 -0700 Subject: [PATCH] ref(incidents): Ungate the alert rule available actions endpoint The endpoint only enumerates the action types a metric alert can fire, so it exposes no alert-rule data. Removes the gate and the test asserting the resulting 404. --- ...ation_alert_rule_available_action_index.py | 4 --- ...ation_alert_rule_available_action_index.py | 27 ++++++------------- 2 files changed, 8 insertions(+), 23 deletions(-) diff --git a/src/sentry/incidents/endpoints/organization_alert_rule_available_action_index.py b/src/sentry/incidents/endpoints/organization_alert_rule_available_action_index.py index 5350960145bf..2cf5e2f1f757 100644 --- a/src/sentry/incidents/endpoints/organization_alert_rule_available_action_index.py +++ b/src/sentry/incidents/endpoints/organization_alert_rule_available_action_index.py @@ -8,12 +8,10 @@ from rest_framework.request import Request from rest_framework.response import Response -from sentry import features from sentry.api.api_owners import ApiOwner from sentry.api.api_publish_status import ApiPublishStatus from sentry.api.base import cell_silo_endpoint from sentry.api.bases.organization import OrganizationEndpoint -from sentry.api.exceptions import ResourceDoesNotExist from sentry.api.helpers.deprecation import deprecated from sentry.constants import ALERTS_API_DEPRECATION_DATE, ALERTS_API_DEPRECATION_KEY from sentry.incidents.logic import ( @@ -100,8 +98,6 @@ def get(self, request: Request, organization: Organization) -> Response: """ Fetches actions that an alert rule can perform for an organization """ - if not features.has("organizations:incidents", organization, actor=request.user): - raise ResourceDoesNotExist actions = [] diff --git a/tests/sentry/incidents/endpoints/test_organization_alert_rule_available_action_index.py b/tests/sentry/incidents/endpoints/test_organization_alert_rule_available_action_index.py index 423b93d7b162..bebeed7fd807 100644 --- a/tests/sentry/incidents/endpoints/test_organization_alert_rule_available_action_index.py +++ b/tests/sentry/incidents/endpoints/test_organization_alert_rule_available_action_index.py @@ -148,8 +148,7 @@ def test_build_action_response_sentry_app_with_component(self) -> None: assert data["settings"] == test_settings def test_no_integrations(self) -> None: - with self.feature("organizations:incidents"): - response = self.get_success_response(self.organization.slug) + response = self.get_success_response(self.organization.slug) assert response.data == [build_action_response(self.email)] @@ -158,8 +157,7 @@ def test_simple(self) -> None: integration = self.create_provider_integration(external_id="1", provider="slack") integration.add_organization(self.organization) - with self.feature("organizations:incidents"): - response = self.get_success_response(self.organization.slug) + response = self.get_success_response(self.organization.slug) assert len(response.data) == 2 assert build_action_response(self.email) in response.data @@ -183,8 +181,7 @@ def test_duplicate_integrations(self) -> None: ) other_integration.add_organization(self.organization) - with self.feature("organizations:incidents"): - response = self.get_success_response(self.organization.slug) + response = self.get_success_response(self.organization.slug) assert len(response.data) == 3 assert build_action_response(self.email) in response.data @@ -205,15 +202,10 @@ def test_duplicate_integrations(self) -> None: in response.data ) - def test_no_feature(self) -> None: - self.create_team(organization=self.organization, members=[self.user]) - self.get_error_response(self.organization.slug, status_code=404) - def test_sentry_apps(self) -> None: installation = self.install_new_sentry_app("foo") - with self.feature("organizations:incidents"): - response = self.get_success_response(self.organization.slug) + response = self.get_success_response(self.organization.slug) assert len(response.data) == 2 assert build_action_response(self.email) in response.data @@ -229,8 +221,7 @@ def test_published_sentry_apps(self) -> None: # Should show up in available actions. installation = self.install_new_sentry_app("published", published=True) - with self.feature("organizations:incidents"): - response = self.get_success_response(self.organization.slug) + response = self.get_success_response(self.organization.slug) assert len(response.data) == 2 assert ( @@ -246,7 +237,7 @@ def test_no_ticket_actions(self) -> None: integration = self.create_provider_integration(external_id="1", provider="jira") integration.add_organization(self.organization) - with self.feature(["organizations:incidents", "organizations:integrations-ticket-rules"]): + with self.feature("organizations:integrations-ticket-rules"): response = self.get_success_response(self.organization.slug) # There should be no ticket actions for Metric Alerts. @@ -260,8 +251,7 @@ def test_integration_disabled(self) -> None: ) integration.add_organization(self.organization) - with self.feature("organizations:incidents"): - response = self.get_success_response(self.organization.slug) + response = self.get_success_response(self.organization.slug) assert len(response.data) == 1 assert build_action_response(self.email) in response.data @@ -273,8 +263,7 @@ def test_org_integration_disabled(self) -> None: with assume_test_silo_mode(SiloMode.CONTROL): org_integration.update(status=ObjectStatus.DISABLED) - with self.feature("organizations:incidents"): - response = self.get_success_response(self.organization.slug) + response = self.get_success_response(self.organization.slug) assert len(response.data) == 1 assert build_action_response(self.email) in response.data