Notify on run end only for runs marked Notify me
Auto runs no longer alert on failure or success; only notify_mode on does, unless the run_finished setting (now 'Notify when any run ends', default off) opts into every run end. Waiting still notifies auto and on runs. The setting is stored under a new key so a value saved under the old meaning is ignored.
This commit is contained in:
@@ -334,12 +334,20 @@ func (r *runner) notifyRun(id int64, name, status string, sequence int, currentS
|
||||
return
|
||||
}
|
||||
event := runAttentionEvent(status)
|
||||
if status == "succeeded" && r.notifyMode(id) == "on" {
|
||||
if status == "succeeded" {
|
||||
event = "succeeded"
|
||||
}
|
||||
if event == "" {
|
||||
return
|
||||
}
|
||||
// A run's end notifies only runs marked "on", unless the operator opted
|
||||
// into every run end (run_finished); waiting notifies any non-off run.
|
||||
if event != protocol.NotifyWaiting && r.notifyMode(id) != "on" {
|
||||
settings, err := r.store.NotificationSettings(r.ctx)
|
||||
if err != nil || !settings.RunFinished {
|
||||
return
|
||||
}
|
||||
}
|
||||
if r.attentionAlready(id, sequence, event) {
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user