notify
azure_bootstrap.notify
¶
Sender-facing throttling + two-tier notification builders.
Modules:
| Name | Description |
|---|---|
templates |
Two-tier (sender / dev) notification body builders. |
throttle |
Sliding-window per-sender notification throttle. |
Functions:
| Name | Description |
|---|---|
build_failure_alert_body |
Build an HTML body for a pipeline-failure notification. |
build_unprocessable_notification |
Returns |
build_validation_notice_body |
Soft-fail observation body. Report generated; these are advisory. |
reset_sender_notification_throttle |
Test-only. Refuses unless AZURE_BOOTSTRAP_ALLOW_RESET=1. |
should_notify_sender |
Return True when the sender is allowed another notification. |
build_failure_alert_body
¶
build_failure_alert_body(*, attachment_name: str, correlation_id: str, sender: str, error_summary: str, audience: str, product_name: str = '', sender_send_failed: bool = False, action_steps: tuple[str, ...] | None = None, **extra_context: Any) -> str
Build an HTML body for a pipeline-failure notification.
Sender audience: generic acknowledgement, no forensic leakage. Dev audience: full traceback / blob path / exception type rendered.
Source code in azure_bootstrap/notify/templates.py
build_unprocessable_notification
¶
build_unprocessable_notification(*, failure_reason: UnprocessableReason, sender: str, attachment_summary: list[dict[str, Any]], correlation_id: str, product_name: str = '', email_subject: str | None = None, email_id: str | None = None) -> tuple[str, str, str, str]
Returns (sender_subject, sender_body, dev_subject, dev_body).
Sender body is template-driven, no internal jargon, no correlation id. Dev body has the full forensic table.
Source code in azure_bootstrap/notify/templates.py
build_validation_notice_body
¶
build_validation_notice_body(*, attachment_name: str, correlation_id: str, sender: str, issues: list[Any], audience: str, product_name: str = '', sender_send_failed: bool = False, **extra_context: Any) -> str
Soft-fail observation body. Report generated; these are advisory.
Source code in azure_bootstrap/notify/templates.py
reset_sender_notification_throttle
¶
Test-only. Refuses unless AZURE_BOOTSTRAP_ALLOW_RESET=1.
Source code in azure_bootstrap/notify/throttle.py
should_notify_sender
¶
should_notify_sender(sender_email: str, *, max_per_hour: int = NOTIFY_SENDER_MAX_PER_HOUR_DEFAULT, window_seconds: float = NOTIFY_SENDER_WINDOW_SECONDS_DEFAULT, counter_namespace: str = 'sender') -> bool
Return True when the sender is allowed another notification.