aboutsummaryrefslogtreecommitdiffstats
path: root/dashboard/app/api.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2018-01-17 19:43:04 +0100
committerDmitry Vyukov <dvyukov@google.com>2018-01-17 19:52:30 +0100
commitd7bc58204ea84ccb2ed541dd26a6b6d8bc326f5d (patch)
tree99402fe448f9d0c4de429903a9a55cb2f4b01334 /dashboard/app/api.go
parent02a2ba2966613de55c837fe709ee34f1ff5be606 (diff)
dashboard/app: collect more info for better reports
Collect kernel build commit title/date. Add support for kernel repo aliases (to be able to say linux-next instead of full git repo address). Collect on what managers a bug happened. Reuse Crash.ReportLen as generic crash reporting priority. Make it possible to prioritize reporting of particular kernel repos and arches. Fixes #473
Diffstat (limited to 'dashboard/app/api.go')
-rw-r--r--dashboard/app/api.go54
1 files changed, 30 insertions, 24 deletions
diff --git a/dashboard/app/api.go b/dashboard/app/api.go
index 5a0d3823d..c12fd62b0 100644
--- a/dashboard/app/api.go
+++ b/dashboard/app/api.go
@@ -269,20 +269,22 @@ func uploadBuild(c context.Context, ns string, req *dashapi.Build, typ BuildType
return false, err
}
build := &Build{
- Namespace: ns,
- Manager: req.Manager,
- ID: req.ID,
- Type: typ,
- Time: timeNow(c),
- OS: req.OS,
- Arch: req.Arch,
- VMArch: req.VMArch,
- SyzkallerCommit: req.SyzkallerCommit,
- CompilerID: req.CompilerID,
- KernelRepo: req.KernelRepo,
- KernelBranch: req.KernelBranch,
- KernelCommit: req.KernelCommit,
- KernelConfig: configID,
+ Namespace: ns,
+ Manager: req.Manager,
+ ID: req.ID,
+ Type: typ,
+ Time: timeNow(c),
+ OS: req.OS,
+ Arch: req.Arch,
+ VMArch: req.VMArch,
+ SyzkallerCommit: req.SyzkallerCommit,
+ CompilerID: req.CompilerID,
+ KernelRepo: req.KernelRepo,
+ KernelBranch: req.KernelBranch,
+ KernelCommit: req.KernelCommit,
+ KernelCommitTitle: req.KernelCommitTitle,
+ KernelCommitDate: req.KernelCommitDate,
+ KernelConfig: configID,
}
if _, err := datastore.Put(c, buildKey(c, ns, req.ID), build); err != nil {
return false, err
@@ -470,6 +472,10 @@ func reportCrash(c context.Context, ns string, req *dashapi.Crash) (*Bug, error)
return nil, err
}
}
+ build, err := loadBuild(c, ns, req.BuildID)
+ if err != nil {
+ return nil, err
+ }
now := timeNow(c)
reproLevel := ReproLevelNone
@@ -482,24 +488,21 @@ func reportCrash(c context.Context, ns string, req *dashapi.Crash) (*Bug, error)
now.Sub(bug.LastTime) > time.Hour ||
reproLevel != ReproLevelNone
if saveCrash {
- build, err := loadBuild(c, ns, req.BuildID)
- if err != nil {
- return nil, err
+ // Reporting priority of this crash.
+ // Currently it is computed only from repository ReportingPriority and Arch,
+ // but can be extended to account for other factors as well.
+ prio := kernelRepoInfo(build).ReportingPriority * 1e6
+ if build.Arch == "amd64" {
+ prio += 1e3
}
-
crash := &Crash{
Manager: build.Manager,
BuildID: req.BuildID,
Time: now,
Maintainers: req.Maintainers,
ReproOpts: req.ReproOpts,
- // We used to report crash with the longest report len to work around
- // corrupted reports. Now that we explicitly detect corrupted reports,
- // disable this sorting. When all old bugs are closed, we need to remove
- // sorting by ReportLen from queryCrashesForBug.
- ReportLen: 1e9,
+ ReportLen: prio,
}
-
if crash.Log, err = putText(c, ns, "CrashLog", req.Log, false); err != nil {
return nil, err
}
@@ -537,6 +540,9 @@ func reportCrash(c context.Context, ns string, req *dashapi.Crash) (*Bug, error)
if len(req.Report) != 0 {
bug.HasReport = true
}
+ if !stringInList(bug.HappenedOn, build.Manager) {
+ bug.HappenedOn = append(bug.HappenedOn, build.Manager)
+ }
if _, err = datastore.Put(c, bugKey, bug); err != nil {
return fmt.Errorf("failed to put bug: %v", err)
}