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:
2026-10-31 16:52:04 +00:00
parent 4235cd858f
commit b109ab3e06
14 changed files with 188 additions and 98 deletions
+9 -1
View File
@@ -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
}