From d3b8f2b35aaeb30c192d2325b63b8f5b942d4ff8 Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Wed, 14 Dec 2022 16:45:18 +0100 Subject: dashboard/app: add subsystem tags to the Bug entity They will be used properly at some later time, for now we'll just keep shortened guilty paths there. Once we have the full subsystem support, all these values will just get overridden by normal names. Return subsystems in BugReports. --- dashboard/app/entities.go | 13 +++++++++++++ dashboard/app/reporting.go | 3 +++ dashboard/dashapi/dashapi.go | 5 +++++ 3 files changed, 21 insertions(+) diff --git a/dashboard/app/entities.go b/dashboard/app/entities.go index 96f179223..86c45a2d9 100644 --- a/dashboard/app/entities.go +++ b/dashboard/app/entities.go @@ -114,6 +114,19 @@ type Bug struct { // bit 1 - don't want to publish it (syzkaller build/test errors) KcidbStatus int64 DailyStats []BugDailyStats + Tags BugTags +} + +type BugTags struct { + Subsystems []BugSubsystem +} + +type BugSubsystem struct { + // For now, let's keep the bare minimum number of fields. + // The subsystem names we use now are not stable and should not be relied upon. + // Once the subsystem management functionality is fully implemented, we'll + // override everything stored here. + Name string } func (bug *Bug) Load(ps []db.Property) error { diff --git a/dashboard/app/reporting.go b/dashboard/app/reporting.go index befae2c62..aa615f47c 100644 --- a/dashboard/app/reporting.go +++ b/dashboard/app/reporting.go @@ -595,6 +595,9 @@ func fillBugReport(c context.Context, rep *dashapi.BugReport, bug *Bug, bugRepor rep.CC = email.RemoveFromEmailList(rep.CC, addr) rep.Maintainers = email.RemoveFromEmailList(rep.Maintainers, addr) } + for _, item := range bug.Tags.Subsystems { + rep.Subsystems = append(rep.Subsystems, dashapi.BugSubsystem{Name: item.Name}) + } return nil } diff --git a/dashboard/dashapi/dashapi.go b/dashboard/dashapi/dashapi.go index c90243cb7..89a4dac77 100644 --- a/dashboard/dashapi/dashapi.go +++ b/dashboard/dashapi/dashapi.go @@ -400,6 +400,11 @@ type BugReport struct { BisectCause *BisectResult BisectFix *BisectResult Assets []Asset + Subsystems []BugSubsystem +} + +type BugSubsystem struct { + Name string } type Asset struct { -- cgit mrf-deployment