hammurabi.notifications package

Submodules

hammurabi.notifications.base module

Notifications are responsible for letting the end users/owners that a change happened on a git repository. Notifications describes where to send the notification but not responsible for delivering it. For example, you can use an email notification method, but the notification method is not responsible for handling emails and delivering the message.

class hammurabi.notifications.base.Notification(recipients: Iterable[str], message_template: str)[source]

Bases: abc.ABC

A git push notification which serves as a base for different kind of notifications like Slack or E-mail notification.

abstract notify(message: str, changes_link: Optional[str]) → None[source]

Handle sending the desired message to the recipients.

Parameters
  • message (str) – Message to send

  • changes_link (Optional[str]) – Link to the list of changes

Raise

NotificationSendError if the notification cannot be delivered

send(changes_link: Optional[str]) → None[source]

Notify the users/owners about a change on the git repository. In case change link is provided, the user will be able to go directly checking the changes.

Parameters

changes_link (Optional[str]) – Link to the list of changes

hammurabi.notifications.slack module

Module contents