diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2022-12-14 16:45:18 +0100 |
|---|---|---|
| committer | Aleksandr Nogikh <wp32pw@gmail.com> | 2022-12-16 10:22:43 +0100 |
| commit | d3b8f2b35aaeb30c192d2325b63b8f5b942d4ff8 (patch) | |
| tree | d16f4b8234e740024ce085f2f4b83edd14b3a504 | |
| parent | 6f9c033e1ad3dcf5e6f25916177ec7174359ad0f (diff) | |
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.
| -rw-r--r-- | dashboard/app/entities.go | 13 | ||||
| -rw-r--r-- | dashboard/app/reporting.go | 3 | ||||
| -rw-r--r-- | dashboard/dashapi/dashapi.go | 5 |
3 files changed, 21 insertions, 0 deletions
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 { |
