Skip to content
This repository has been archived by the owner on May 10, 2018. It is now read-only.

Set up template_success and template_failure for notifications based on build result #368

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

BanzaiMan
Copy link
Contributor

Allows users to specify template_success and template_failure in certain notification providers (IRC, HipChat, Campfire, Slack, Sqwiggle), which will be used based on the build result. These recognize only passed and failed results, and not errored and canceled. We can probably wrap these into the template_failure category. (I feel that template_errored and template_canceled are overkill.)

This addresses travis-ci/travis-ci#486, travis-ci/travis-ci#1332 and travis-ci/travis-ci#2032.

@BanzaiMan
Copy link
Contributor Author

Template selection logic should be in one place.

@joshk
Copy link
Contributor

joshk commented Mar 22, 2014

We don't send notifications for canceled builds, but we do for errored builds. Might be good to add a template category for errored.

@joshk
Copy link
Contributor

joshk commented Mar 22, 2014

the template_for logic is repeated in several classes, can we wrap this up in a module and share it across the handlers?

@BanzaiMan
Copy link
Contributor Author

template_error is now supported.

@roidrage
Copy link
Contributor

Personally not sure how I feel about this change, as it adds a lot of more noise to the .travis.yml. I could imagine these working a lot better when we have a proper UI for notifications rather than increase complexity in the .travis.yml as it is.

@rkh
Copy link
Contributor

rkh commented Mar 23, 2014

@sarahhodne
Copy link
Contributor

I'm leaning towards what @roidrage said -- I think this might work better in the UI rather than here, although if we are going to move notification settings to the UI, this increase in complexity would be temporary, so all in all I don't have a strong opinion either way, I think.

@Callek
Copy link

Callek commented Mar 24, 2015

So this has been a year since a mostly-working (?) branch was submitted here, in favor of "Notifications in Web UI" -- and while I think the latter is a good solution that would benefit here, this is pretty important to me as in obviates one of my largest notfication pet peeves (#1332 is what drove me here, among others of that vein, e.g. colorizing IRC notifications based on pass/fail)

I'd love if this can be picked up and continued.

@BanzaiMan ?

@joshk
Copy link
Contributor

joshk commented Mar 25, 2015

So I am a little torn about this as we are not far off from adding this to the web ui, although that said, 'not far off' is still 3-6 months away.

@BanzaiMan how about you rebase this and change the logic to favour config like this:

notifications:
  slack:
    templates:
      passed: "......"
      failed: "....."
      errored: "....."

@o11c
Copy link

o11c commented Oct 25, 2015

template: errored: could default to the content of template: failed: ...

@shzhousz
Copy link

Is this feature achievable now?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants