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
14 changes: 0 additions & 14 deletions src/sentry/notifications/platform/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@ def __init__(self, *, data: T):
@staticmethod
def has_access(organization: Organization | RpcOrganization, source: str) -> bool:
if not features.has("organizations:notification-platform", organization):
logger.info(
"notification.platform.has_access.feature_flag_disabled",
extra={"organization_id": organization.id, "source": source},
)
return False

option_key = f"notifications.platform-rate.{source}"
Expand All @@ -63,16 +59,6 @@ def has_access(organization: Organization | RpcOrganization, source: str) -> boo
return False

modulo_result = sample_modulo(option_key, organization.id)
logger.info(
"notification.platform.has_access.sample_modulo",
extra={
"organization_id": organization.id,
"source": source,
"option_key": option_key,
"modulo_result": modulo_result,
"sample_rate": options.get(option_key),
},
)
return modulo_result

def notify_target(self, *, target: NotificationTarget) -> None:
Expand Down
4 changes: 2 additions & 2 deletions src/sentry/notifications/platform/templates/custom_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ def format_datetime(dt: datetime) -> str:
return dt.strftime("%Y-%m-%d %H:%M:%S")


@dataclass(frozen=True)
@dataclass
class CustomRuleSamplesFulfilled(NotificationData):
source = "custom-rule-samples-fulfilled"
query: str | None
num_samples: int
start_date: datetime
end_date: datetime
discover_link: str
source: str = "custom-rule-samples-fulfilled"


@template_registry.register(CustomRuleSamplesFulfilled.source)
Expand Down
8 changes: 4 additions & 4 deletions src/sentry/notifications/platform/templates/data_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ def format_date(date: datetime) -> str:
return date.strftime("%I:%M %p on %B %d, %Y (%Z)")


@dataclass(frozen=True)
@dataclass
class DataExportSuccess(NotificationData):
source = "data-export-success"
export_url: str
expiration_date: datetime
source: str = "data-export-success"


@template_registry.register(DataExportSuccess.source)
Expand Down Expand Up @@ -55,12 +55,12 @@ def render(self, data: DataExportSuccess) -> NotificationRenderedTemplate:
)


@dataclass(frozen=True)
@dataclass
class DataExportFailure(NotificationData):
source = "data-export-failure"
error_message: str
error_payload: dict[str, Any]
creation_date: datetime
source: str = "data-export-failure"


@template_registry.register(DataExportFailure.source)
Expand Down
4 changes: 2 additions & 2 deletions src/sentry/notifications/platform/templates/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
)


@dataclass(frozen=True)
@dataclass
class UnableToDeleteRepository(NotificationData):
source = "unable-to-delete-repository"
repository_name: str
provider_name: str
error_message: str
source: str = "unable-to-delete-repository"


@template_registry.register(UnableToDeleteRepository.source)
Expand Down
20 changes: 10 additions & 10 deletions src/sentry/notifications/platform/templates/sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@
)


@dataclass(frozen=True)
@dataclass
class ErrorAlertData(NotificationData):
source = "error-alert-service"
error_type: str
error_message: str
project_name: str
Expand All @@ -32,6 +31,7 @@ class ErrorAlertData(NotificationData):
chart_url: str
issue_url: str
assign_url: str
source: str = "error-alert-service"


@template_registry.register(ErrorAlertData.source)
Expand Down Expand Up @@ -114,9 +114,8 @@ def render(self, data: ErrorAlertData) -> NotificationRenderedTemplate:
)


@dataclass(frozen=True)
@dataclass
class DeploymentData(NotificationData):
source = "deployment-service"
project_name: str
version: str
environment: str
Expand All @@ -125,6 +124,7 @@ class DeploymentData(NotificationData):
commit_message: str
deployment_url: str
rollback_url: str
source: str = "deployment-service"


@template_registry.register(DeploymentData.source)
Expand Down Expand Up @@ -184,9 +184,8 @@ def render(self, data: DeploymentData) -> NotificationRenderedTemplate:
)


@dataclass(frozen=True)
@dataclass
class SlowLoadMetricAlertData(NotificationData):
source = "slow-load-metric-alert"
alert_type: str
severity: str
project_name: str
Expand All @@ -197,6 +196,7 @@ class SlowLoadMetricAlertData(NotificationData):
threshold: str
start_time: str
chart_url: str
source: str = "slow-load-metric-alert"


@template_registry.register(SlowLoadMetricAlertData.source)
Expand Down Expand Up @@ -243,15 +243,15 @@ def render(self, data: SlowLoadMetricAlertData) -> NotificationRenderedTemplate:
)


@dataclass(frozen=True)
@dataclass
class PerformanceAlertData(NotificationData):
source = "performance-monitoring"
metric_name: str
threshold: str
current_value: str
project_name: str
chart_url: str
investigation_url: str
source: str = "performance-monitoring"


@template_registry.register(PerformanceAlertData.source)
Expand Down Expand Up @@ -310,14 +310,14 @@ def render(self, data: PerformanceAlertData) -> NotificationRenderedTemplate:
)


@dataclass(frozen=True)
@dataclass
class TeamUpdateData(NotificationData):
source = "team-communication"
team_name: str
update_type: str
message: str
author: str
timestamp: str
source: str = "team-communication"


@template_registry.register(TeamUpdateData.source)
Expand Down
Loading