aboutsummaryrefslogtreecommitdiffstats
path: root/dashboard/app/reporting_email.go
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2023-05-17 18:18:03 +0200
committerAleksandr Nogikh <wp32pw@gmail.com>2023-05-25 14:59:38 +0200
commit6b7e906bb1dbb3bd49f58b79b00ea928ade236ba (patch)
treec67d1af43b9c80aa5ace62c040f8165fff843da4 /dashboard/app/reporting_email.go
parented3c42cc79baba7bc8e90ff1f7d56103509d4d9d (diff)
dashboard: send per-label notifications
If the label is not user-set and the config specifies a message for it, send a bug notification. If the label is related to bug origin testing, attach the list of tested trees.
Diffstat (limited to 'dashboard/app/reporting_email.go')
-rw-r--r--dashboard/app/reporting_email.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/dashboard/app/reporting_email.go b/dashboard/app/reporting_email.go
index 11688174b..8e6337e78 100644
--- a/dashboard/app/reporting_email.go
+++ b/dashboard/app/reporting_email.go
@@ -224,7 +224,12 @@ func emailSendBugNotif(c context.Context, notif *dashapi.BugNotification) error
body += "Crashes did not happen for a while, no reproducer and no activity."
}
status = dashapi.BugStatusInvalid
-
+ case dashapi.BugNotifLabel:
+ bodyBuf := new(bytes.Buffer)
+ if err := mailTemplates.ExecuteTemplate(bodyBuf, "mail_label_notif.txt", notif); err != nil {
+ return fmt.Errorf("failed to execute mail_label_notif.txt: %v", err)
+ }
+ body = bodyBuf.String()
default:
return fmt.Errorf("bad notification type %v", notif.Type)
}
@@ -248,6 +253,7 @@ func emailSendBugNotif(c context.Context, notif *dashapi.BugNotification) error
ID: notif.ID,
Status: status,
StatusReason: statusReason,
+ Label: notif.Label,
Notification: true,
}
ok, reason, err := incomingCommand(c, cmd)