Pipeline: Design: Notifications

Created on 16 Sep 2018  Â·  8Comments  Â·  Source: tektoncd/pipeline

The work for this task is to design this feature and present one or more proposals (before implementing).

Expected Behavior

In a many modern pipelines, we want to be able to

Requirements:

  • Must support: slack updates, email updates, github PR commenting
  • Should be possible to perform different actions on failure of a task or a pipeline, or success
  • Must be possible to provide required credentials/auth info

Possibly a notification could be a top level directive in both a Pipeline and a Task, e.g.:

kind: Pipeline
...
spec:
    tasks:
        - name: unit-test-kritis
          taskRef:
              name: make
          inputSourceBindings:
              - inputName: workspace
                sourceKey: kritis
          params:
              - name: makeTarget
                value: test
          notifications:
               failure:
                   ....
               success:
                  .....

Actual Behavior

In the current design, a user would have to implement this as a Task that knows how to report these notifications.

Additional Info

There is some potential overlap with #27 which is about executing Tasks conditionally.

design help wanted

Most helpful comment

A small addition might be to add notification.always which will be trigger at the end irrespective of Task run exit code.
For example:

kind: Pipeline
...
spec:
    tasks:
        - name: unit-test-kritis
          taskRef:
              name: make
          inputSourceBindings:
              - inputName: workspace
                sourceKey: kritis
          params:
              - name: makeTarget
                value: test
          notifications:
               failure:
                   ....
               success:
                  .....
               always:
                  .....

Simple use case would updating PR/Slack with a message confirming a test run or an docker image upload.

All 8 comments

A small addition might be to add notification.always which will be trigger at the end irrespective of Task run exit code.
For example:

kind: Pipeline
...
spec:
    tasks:
        - name: unit-test-kritis
          taskRef:
              name: make
          inputSourceBindings:
              - inputName: workspace
                sourceKey: kritis
          params:
              - name: makeTarget
                value: test
          notifications:
               failure:
                   ....
               success:
                  .....
               always:
                  .....

Simple use case would updating PR/Slack with a message confirming a test run or an docker image upload.

/assign @pivotal-nader-ziada

It would also be nice if the pipeline itself could have a generic success/failure notification. Perhaps it could also be templated to accept the task that failed? Having to put notifications for each and every task can be tedious and lead to copy and paste mistakes. This is something that I find Concourse is lacking.

/assign @afrittoli

@bobcatfish if thing we got enough input on the design doc now to close this issue and start prototyping - so I would close this one.

Sound good to me @afrittoli !

plz feel free to make a follow-up Issue to do POC and/or implement - we can add it to our 0.8 milestone!

Was this page helpful?
0 / 5 - 0 ratings