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

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

notify committers of the last commit

committers

notifiy specific email addresses

Example:

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

component_diff_owners

notify the codeowners of a component. CODEOWNERS file must exist

codeowners

notify the codeowners of the repository. CODEOWNERS file must exist

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
                inputs:
                - component_descriptor_dir