aboutsummaryrefslogtreecommitdiffstats
path: root/dashboard/dashapi/dashapi.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2019-03-12 13:57:52 +0100
committerDmitry Vyukov <dvyukov@google.com>2019-03-17 18:06:44 +0100
commit5900c53a4da4bf81f6f7f22170e52c34f029f7d5 (patch)
tree6e8b26bfbdbb748ff978f479101a45e0f84f7a1b /dashboard/dashapi/dashapi.go
parentded8ff151d66a79c087cd3853365d913d35c623a (diff)
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
Diffstat (limited to 'dashboard/dashapi/dashapi.go')
-rw-r--r--dashboard/dashapi/dashapi.go23
1 files changed, 17 insertions, 6 deletions
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)