Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions src/sentry/notifications/notification_action/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from abc import ABC, abstractmethod
from collections.abc import Callable, Collection, Sequence
from dataclasses import asdict
from typing import Any, ClassVar, NotRequired, Protocol, TypedDict
from typing import Any, ClassVar, Protocol, TypedDict

from django.core.exceptions import ValidationError
from taskbroker_client.retry import RetryTaskError
Expand Down Expand Up @@ -61,7 +61,6 @@

class RuleData(TypedDict):
actions: list[dict[str, Any]]
legacy_rule_id: NotRequired[int]


class LegacyRegistryHandler(ABC):
Expand Down Expand Up @@ -230,14 +229,6 @@ def build_rule_data_from_action(
) -> RuleData:
action_blob = cls.build_rule_action_blob(action, detector.linked_project.organization.id)

if origin.is_test_notification():
action_blob["legacy_rule_id"] = TEST_NOTIFICATION_ID
else:
assert origin.workflow_id is not None
action_blob["workflow_id"] = origin.workflow_id
if origin.legacy_rule_id is not None:
action_blob["legacy_rule_id"] = origin.legacy_rule_id

if origin.is_test_notification() and action.type == Action.Type.EMAIL:
action_blob["skipDigests"] = True

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,6 @@ def test_create_action_context(self) -> None:
"server": "1234567890",
"channel_id": "channel456",
"tags": "environment,user,my_tag",
"legacy_rule_id": self.rule.id,
"workflow_id": self.workflow.id,
}
],
}
Expand Down Expand Up @@ -181,7 +179,6 @@ def test_create_action_context_with_workflow_only(self) -> None:
"server": "1234567890",
"channel_id": "channel456",
"tags": "environment,user,my_tag",
"workflow_id": self.workflow.id,
}
]
}
Expand All @@ -202,7 +199,6 @@ def test_create_action_context_deleted_workflow_falls_back_to_detector_name(
"server": "1234567890",
"channel_id": "channel456",
"tags": "environment,user,my_tag",
"workflow_id": workflow_id,
}
]
}
Expand All @@ -227,7 +223,6 @@ def test_create_action_context_with_test_notification_id(self) -> None:
"server": "1234567890",
"channel_id": "channel456",
"tags": "environment,user,my_tag",
"legacy_rule_id": TEST_NOTIFICATION_ID,
}
],
}
Expand All @@ -248,8 +243,6 @@ def test_create_action_context_no_environment(self) -> None:
"server": "1234567890",
"channel_id": "channel456",
"tags": "environment,user,my_tag",
"legacy_rule_id": self.rule.id,
"workflow_id": self.workflow.id,
}
],
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ def test_from_action_invocation(self) -> None:
assert result.notes == "test note"
assert len(result.rule.data["actions"]) == 1
action_blob = result.rule.data["actions"][0]
assert action_blob["workflow_id"] == invocation.workflow_id
assert (
action_blob["id"] == "sentry.integrations.slack.notify_action.SlackNotifyServiceAction"
)
Expand All @@ -154,7 +153,6 @@ def test_from_action_invocation_empty_tags(self) -> None:
assert result.tags is None
assert len(result.rule.data["actions"]) == 1
action_blob = result.rule.data["actions"][0]
assert action_blob["workflow_id"] == invocation.workflow_id
assert (
action_blob["id"] == "sentry.integrations.slack.notify_action.SlackNotifyServiceAction"
)
Expand Down
Loading