corvix.notifications.targets.slack ================================== .. py:module:: corvix.notifications.targets.slack .. autoapi-nested-parse:: Slack incoming-webhook notification target. This is the built-in reference :class:`~corvix.notifications.targets.base.NotificationTarget` implementation. It posts one Slack message per newly-arrived unread GitHub notification to a configured incoming-webhook URL. See ``docs/new_notification_target.md`` for how to add your own channel. Attributes ---------- .. autoapisummary:: corvix.notifications.targets.slack.logger corvix.notifications.targets.slack._DEFAULT_TIMEOUT_SECONDS Classes ------- .. autoapisummary:: corvix.notifications.targets.slack.SlackTarget Functions --------- .. autoapisummary:: corvix.notifications.targets.slack._format_message Module Contents --------------- .. py:data:: logger .. py:data:: _DEFAULT_TIMEOUT_SECONDS :value: 5.0 .. py:class:: SlackTarget Posts a Slack message for each new GitHub notification. Parameters ---------- webhook_url: Slack incoming-webhook URL. Resolved from an env var by the CLI so the secret never lives in ``corvix.yaml``. enabled: When ``False`` the target is a no-op (delivers nothing). The CLI already skips disabled targets, but this keeps the target safe to construct directly. timeout_seconds: Per-request HTTP timeout. .. py:attribute:: webhook_url :type: str .. py:attribute:: enabled :type: bool :value: True .. py:attribute:: timeout_seconds :type: float :value: 5.0 .. py:property:: name :type: str .. py:method:: deliver(events: list[corvix.notifications.models.NotificationEvent]) -> corvix.notifications.models.DeliveryResult Post one message per event; never raise (errors go in the result). .. py:method:: _post(text: str) -> None .. py:function:: _format_message(event: corvix.notifications.models.NotificationEvent) -> str Render a Slack message body for a single notification event.