Skip to content

Commit 2407603

Browse files
authored
🔧 chore: don't raise if integration is missing for pagerduty netric alert notifications (#97185)
1 parent c96792d commit 2407603

File tree

2 files changed

+1
-13
lines changed

2 files changed

+1
-13
lines changed

src/sentry/integrations/pagerduty/utils.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
from typing import Any, TypedDict
55

66
from django.db import router, transaction
7-
from django.http import Http404
87

98
from sentry.incidents.models.incident import IncidentStatus
109
from sentry.incidents.typings.metric_detector import (
@@ -178,7 +177,7 @@ def send_incident_alert_notification(
178177
"organization_id": organization_id,
179178
},
180179
)
181-
raise Http404
180+
return False
182181

183182
org_integration_id: int | None = None
184183
if org_integration:

tests/sentry/incidents/action_handlers/test_pagerduty.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
from unittest.mock import MagicMock, patch
33

44
import orjson
5-
import pytest
65
import responses
7-
from django.http import Http404
86
from urllib3.response import HTTPResponse
97

108
from sentry.analytics.events.alert_sent import AlertSentEvent
@@ -206,15 +204,6 @@ def run_test(self, incident, method):
206204
def test_fire_metric_alert(self) -> None:
207205
self.run_fire_test()
208206

209-
def test_fire_metric_alert_no_org_integration(self) -> None:
210-
# We've had orgs in prod that have alerts referencing
211-
# pagerduty integrations that no longer attached to the org.
212-
with assume_test_silo_mode(SiloMode.CONTROL):
213-
self.integration.organizationintegration_set.first().delete()
214-
215-
with pytest.raises(Http404):
216-
self.run_fire_test()
217-
218207
def test_fire_metric_alert_multiple_services(self) -> None:
219208
service = [
220209
{

0 commit comments

Comments
 (0)