Hi Magnus,

Go server looks at the status of the previous run of the stage to decide on 
the subject line for the notification email. It uses the rules that you 
linked to 
ie. https://docs.gocd.io/current/configuration/dev_notifications.html#events 
to make the decision. 

The behavior that you see though, i.e..  *Subject lines like "Stage 
[xxx/16/build/1] failed" in my notification email, even though xxx/15 
passed* would happen when an instance of that specific stage was rerun. 

For example:
StageFoo/15 passes, StageFoo/16 fails. The subject line of the email that 
goes out would be "... is broken".
However, if the sequence is StageFoo/15 passes, rerun StageFoo/11 and it 
fails, trigger StageFoo/16, the email that comes out would have subject 
line "... failed".
It always compares with the previous run of the stage, not really the 
previous counter, in this case the previous run would be counter 2 of 
StageFoo/11. Does that help clarify the behavior that you see?

Now, coming to the thing that you are trying to implement which is sending 
the notifications to the team. Subscriptions through preferences are the 
old way of getting notifications. You should be able to make use of the 
email notifier plugin for this, you may checkout other notification plugins 
on the website <https://www.gocd.io/plugins/>. If none of them suit your 
needs, you could write one for yourself using the notifications plugin 
endpoint 
<https://plugin-api.gocd.io/current/notifications/#notification-plugins>.

Hope that helps. 

Cheers,
Jyoti


On Friday, 12 May 2017 21:21:25 UTC+5:30, Magnus Lyckå wrote:
>
> I'm running go-server 17.2.0. For some pipelines, I get subject lines like 
> "Stage [xxx/16/build/1] failed" in my notification email, even though 
> xxx/15 passed. For other pipelines, I get "is broken" as expected on a red 
> build after a green.
>
> Since the teams want to get notifications for all the pipelines in their 
> pipeline group etc without subscribing to notifications for each of them, I 
> have a little mail server which subscribes to all events and then look at 
> the email subject line and go/api/config/pipeline_groups to figure out who 
> should get what. (See https://github.com/magnus-lycka/mail2alert ) This 
> means that I don't know whether or not the go-server respects the rules in 
> https://docs.gocd.io/17.5.0/configuration/dev_notifications.html#events 
> wrt to sending email or not, I just know that the subject line on broken 
> jobs for some piplines contains "failed" instead of "is broken"!, whether 
> or not the previous run passed, while for other pipelines, this seems to 
> work as expected.
>
> Any ideas?
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"go-cd" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to