From 5900c53a4da4bf81f6f7f22170e52c34f029f7d5 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Tue, 12 Mar 2019 13:57:52 +0100 Subject: dashboard/app: make dashapi.BugReport more self-contained Extend BugReport with few fields that are needed by all reportings anyway. This allows to not create and fill an almost identical object to pass to template. Update #501 --- dashboard/dashapi/dashapi.go | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'dashboard/dashapi/dashapi.go') diff --git a/dashboard/dashapi/dashapi.go b/dashboard/dashapi/dashapi.go index ed95d0f38..ffc72d79a 100644 --- a/dashboard/dashapi/dashapi.go +++ b/dashboard/dashapi/dashapi.go @@ -256,19 +256,23 @@ func (dash *Dashboard) LogError(name, msg string, args ...interface{}) { // BugReport describes a single bug. // Used by dashboard external reporting. type BugReport struct { + Type ReportType Namespace string Config []byte ID string JobID string ExtID string // arbitrary reporting ID forwarded from BugUpdate.ExtID - First bool // Set for first report for this bug. + First bool // Set for first report for this bug (Type == ReportNew). Moderation bool Title string + Link string // link to the bug on dashboard + CreditEmail string // email for the Reported-by tag Maintainers []string CC []string // additional CC emails OS string Arch string VMArch string + UserSpaceArch string // user-space arch as kernel developers know it (rather than Go names) CompilerID string KernelRepo string KernelRepoAlias string @@ -290,11 +294,11 @@ type BugReport struct { NumCrashes int64 HappenedOn []string // list of kernel repo aliases - CrashTitle string // job execution crash title - Error []byte // job execution error - ErrorLink string - Patch []byte // testing job patch - PatchLink string + CrashTitle string // job execution crash title + Error []byte // job execution error + ErrorLink string + ErrorTruncated bool // full Error text is too large and was truncated + PatchLink string } type BugUpdate struct { @@ -425,6 +429,7 @@ type ( BugStatus int BugNotif int ReproLevel int + ReportType int ) const ( @@ -452,6 +457,12 @@ const ( ReproLevelC ) +const ( + ReportNew ReportType = iota // First report for this bug in the reporting stage. + ReportRepro // Found repro for an already reported bug. + ReportTestPatch // Patch testing result. +) + func (dash *Dashboard) Query(method string, req, reply interface{}) error { if dash.logger != nil { dash.logger("API(%v): %#v", method, req) -- cgit mrf-deployment