notifications Trait

Used to customise build result notifications (most prominently sending error mails upon errors).

Attributes

name

required?

default

type

explanation

default

no

on_error:
  email: true
  triggering_policy: only_first

NotificationCfgSet

the default notification cfg (more may be defined)

default (NotificationCfgSet) Attributes

name

required?

default

type

explanation

on_error

no

triggering_policy: only_first

NotificationCfg

configures triggering policy in case a step fails with an error

default.on_error (NotificationCfg) Attributes

name

required?

default

type

explanation

triggering_policy

no

only_first

NotificationTriggeringPolicy

when to issue the configured notifications. Possible values see below

email

no

True

bool

whether to send email notifications

inputs

no

- on_error_dir

List[str]

configures the inputs that are made available to the notification

recipients

no

committers

NotificationRecipients

whom to notify. Possible values see blow.

cfg_callback

no

- on_error_dir

List[str]

an optional callback (relative to main repository root). Called as subprocess with an environment variables:

  • REPO_ROOT: absolute path to main repository

  • NOTIFY_CFG_OUT: absolute path to write notify.cfg to

slack

no

None

NotificationSlack

send notification via Slack

default.on_error.triggering_policy Enumeration Values

value

explanation

only_first

notify on first error only

always

notify on every error

never

notify never in case of errors

default.on_error.recipients Enumeration Values

value

explanation

email_addresses

notifiy specific email addresses

Example:

recipients:
    - email_addresses:
        - foo.bar@mycloud.com
        - bar.buzz@mycloud.com

committers

notify committers of the last commit

component_diff_owners

notify the codeowners of a component. CODEOWNERS file must exist

codeowners

notify the codeowners of the repository. CODEOWNERS file must exist

default.on_error.slack Enumeration Values

value

explanation

channel_cfgs

the slack channel configurations to use

Example:

slack:
  channel_cfgs:
  - channel_names:
    - 'my_slack_channel'
    - 'my_other_slack_channel'
    slack_cfg_name: 'my_slack_cfg_name'

Dependencies

This trait has no dependencies

Example

traits:
    notifications:
        demo_breakers:
            on_error:
                triggering_policy: 'only_first'
                recipients:
                - email_addresses:
                    - foo.bar@mycloud.com
                    - bar.bazz@mycloud.com
                - committers
                - component_diff_owners
                - codeowners
                slack:
                    channel_cfgs:
                      - channel_names:
                        - 'my_slack_channel'
                        slack_cfg_name: 'my_slack_cfg_name'
                inputs:
                - component_descriptor_dir