From d608a2afc4289e56fe35af894ff9eb3f56f4fcb4 Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Thu, 25 May 2023 13:14:16 +0200 Subject: dashboard: include label message into bug reports --- dashboard/app/reporting.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'dashboard/app/reporting.go') diff --git a/dashboard/app/reporting.go b/dashboard/app/reporting.go index d0b61bbf1..f75b2d318 100644 --- a/dashboard/app/reporting.go +++ b/dashboard/app/reporting.go @@ -547,6 +547,16 @@ func crashBugReport(c context.Context, bug *Bug, crash *Crash, crashKey *db.Key, rep.Maintainers = append(rep.Maintainers, mgr.CC.BuildMaintainers...) } } + for _, label := range bug.Labels { + text, ok := reporting.Labels[label.String()] + if !ok { + continue + } + if rep.LabelMessages == nil { + rep.LabelMessages = map[string]string{} + } + rep.LabelMessages[label.String()] = text + } if err := fillBugReport(c, rep, bug, bugReporting, build); err != nil { return nil, err } @@ -1071,8 +1081,8 @@ func incomingCommandCmd(c context.Context, now time.Time, cmd *dashapi.BugUpdate if cmd.StatusReason != "" { bug.StatusReason = cmd.StatusReason } - if cmd.Label != "" { - bugReporting.AddLabel(cmd.Label) + for _, label := range cmd.Labels { + bugReporting.AddLabel(label) } return true, "", nil } -- cgit mrf-deployment