From cc02a134319f69bfc3b59704f88660986d62d57b Mon Sep 17 00:00:00 2001 From: Rudra Patel Date: Thu, 20 Aug 2026 15:15:31 -0700 Subject: [PATCH] ref(incidents): Ungate the incident read endpoints Remove the organizations:incidents check from IncidentEndpoint.convert_args, OrganizationIncidentDetailsEndpoint.convert_args, and the incident index GET handler, along with the test that asserted the resulting 404. --- src/sentry/api/bases/incident.py | 4 ---- .../endpoints/organization_incident_details.py | 4 ---- .../incidents/endpoints/organization_incident_index.py | 4 ---- .../endpoints/test_organization_incident_details.py | 10 +--------- .../endpoints/test_organization_incident_index.py | 2 +- 5 files changed, 2 insertions(+), 22 deletions(-) diff --git a/src/sentry/api/bases/incident.py b/src/sentry/api/bases/incident.py index a798940f395e..1fe1230194e7 100644 --- a/src/sentry/api/bases/incident.py +++ b/src/sentry/api/bases/incident.py @@ -3,7 +3,6 @@ from rest_framework.exceptions import PermissionDenied from rest_framework.request import Request -from sentry import features from sentry.api.bases.organization import OrganizationEndpoint, OrganizationPermission from sentry.api.exceptions import ResourceDoesNotExist from sentry.api.utils import to_valid_int_id @@ -37,9 +36,6 @@ def convert_args( args, kwargs = super().convert_args(request, *args, **kwargs) organization = kwargs["organization"] - if not features.has("organizations:incidents", organization, actor=request.user): - raise ResourceDoesNotExist - validated_incident_identifier = to_valid_int_id( "incident_identifier", incident_identifier, raise_404=True ) diff --git a/src/sentry/incidents/endpoints/organization_incident_details.py b/src/sentry/incidents/endpoints/organization_incident_details.py index 51cf21603183..2d073bd50838 100644 --- a/src/sentry/incidents/endpoints/organization_incident_details.py +++ b/src/sentry/incidents/endpoints/organization_incident_details.py @@ -5,7 +5,6 @@ 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 @@ -69,9 +68,6 @@ def convert_args( args, kwargs = OrganizationEndpoint.convert_args(self, request, *args, **kwargs) organization = kwargs["organization"] - if not features.has("organizations:incidents", organization, actor=request.user): - raise ResourceDoesNotExist - if request.method == "GET": gop: GroupOpenPeriod | None = None diff --git a/src/sentry/incidents/endpoints/organization_incident_index.py b/src/sentry/incidents/endpoints/organization_incident_index.py index 2d419badcfcf..07bfc21646da 100644 --- a/src/sentry/incidents/endpoints/organization_incident_index.py +++ b/src/sentry/incidents/endpoints/organization_incident_index.py @@ -15,7 +15,6 @@ from sentry.api.base import cell_silo_endpoint from sentry.api.bases.incident import IncidentPermission from sentry.api.bases.organization import OrganizationEndpoint -from sentry.api.exceptions import ResourceDoesNotExist from sentry.api.helpers.deprecation import deprecated from sentry.api.paginator import OffsetPaginator from sentry.api.serializers import serialize @@ -63,9 +62,6 @@ def get(self, request: Request, organization: Organization) -> Response: :auth: required """ - if not features.has("organizations:incidents", organization, actor=request.user): - raise ResourceDoesNotExist - # Parse query parameters (shared between both implementations) projects = self.get_projects(request, organization) envs = self.get_environments(request, organization) diff --git a/tests/sentry/incidents/endpoints/test_organization_incident_details.py b/tests/sentry/incidents/endpoints/test_organization_incident_details.py index c48358bb5a82..eeb686d2d387 100644 --- a/tests/sentry/incidents/endpoints/test_organization_incident_details.py +++ b/tests/sentry/incidents/endpoints/test_organization_incident_details.py @@ -6,7 +6,6 @@ from sentry.models.groupopenperiod import GroupOpenPeriod from sentry.testutils.abstract import Abstract from sentry.testutils.cases import APITestCase -from sentry.testutils.helpers.features import with_feature from sentry.types.group import PriorityLevel from sentry.workflow_engine.migration_helpers.alert_rule import migrate_alert_rule from sentry.workflow_engine.models import IncidentGroupOpenPeriod @@ -36,17 +35,10 @@ def user(self): def test_no_perms(self) -> None: incident = self.create_incident() self.login_as(self.create_user()) - with self.feature("organizations:incidents"): - resp = self.get_response(incident.organization.slug, incident.id) - assert resp.status_code == 403 - - def test_no_feature(self) -> None: - incident = self.create_incident() resp = self.get_response(incident.organization.slug, incident.id) - assert resp.status_code == 404 + assert resp.status_code == 403 -@with_feature(["organizations:incidents"]) class WorkflowEngineIncidentDetailsTest(APITestCase): endpoint = "sentry-api-0-organization-incident-details" diff --git a/tests/sentry/incidents/endpoints/test_organization_incident_index.py b/tests/sentry/incidents/endpoints/test_organization_incident_index.py index c3e9942eb161..7033d4e58435 100644 --- a/tests/sentry/incidents/endpoints/test_organization_incident_index.py +++ b/tests/sentry/incidents/endpoints/test_organization_incident_index.py @@ -25,7 +25,7 @@ from sentry.workflow_engine.types import DetectorPriorityLevel -@with_feature(["organizations:incidents", "organizations:performance-view"]) +@with_feature("organizations:performance-view") class WorkflowEngineIncidentListTest(APITestCase): endpoint = "sentry-api-0-organization-incident-index"