From 6b7e906bb1dbb3bd49f58b79b00ea928ade236ba Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Wed, 17 May 2023 18:18:03 +0200 Subject: 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. --- dashboard/app/reporting_email.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'dashboard/app/reporting_email.go') 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) -- cgit mrf-deployment