From 461291eaaff30cc4a481c301a20beb1370894e47 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Thu, 7 Nov 2019 14:27:46 +0100 Subject: dashboard/app: show what fix bisections we will mail Show [report pending] for fix bisections that we will send. Help to analyze what will happen when we enable mailing of fix bisections. Update #1271 --- dashboard/app/main.go | 14 +++++++++++--- dashboard/app/templates.html | 1 + 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/dashboard/app/main.go b/dashboard/app/main.go index f1c57cecd..685649c9c 100644 --- a/dashboard/app/main.go +++ b/dashboard/app/main.go @@ -443,7 +443,7 @@ func getUIJob(c context.Context, bug *Bug, jobType JobType) (*uiJob, error) { if err != nil { return nil, err } - return makeUIJob(job, jobKey, crash, build), nil + return makeUIJob(job, jobKey, bug, crash, build), nil } // handleText serves plain text blobs (crash logs, reports, reproducers, etc). @@ -1036,12 +1036,12 @@ func loadRecentJobs(c context.Context) ([]*uiJob, error) { } var results []*uiJob for i, job := range jobs { - results = append(results, makeUIJob(job, keys[i], nil, nil)) + results = append(results, makeUIJob(job, keys[i], nil, nil, nil)) } return results, nil } -func makeUIJob(job *Job, jobKey *db.Key, crash *Crash, build *Build) *uiJob { +func makeUIJob(job *Job, jobKey *db.Key, bug *Bug, crash *Crash, build *Build) *uiJob { ui := &uiJob{ Type: job.Type, Created: job.Created, @@ -1062,10 +1062,18 @@ func makeUIJob(job *Job, jobKey *db.Key, crash *Crash, build *Build) *uiJob { CrashReportLink: textLink(textCrashReport, job.CrashReport), LogLink: textLink(textLog, job.Log), ErrorLink: textLink(textError, job.Error), + Reported: job.Reported, } if !job.Finished.IsZero() { ui.Duration = job.Finished.Sub(job.Started) } + if job.Type == JobBisectCause || job.Type == JobBisectFix { + // We don't report these yet (or at all), see pollCompletedJobs. + if len(job.Commits) != 1 || + bug != nil && (len(bug.Commits) != 0 || bug.Status != BugStatusOpen) { + ui.Reported = true + } + } for _, com := range job.Commits { ui.Commits = append(ui.Commits, &uiCommit{ Hash: com.Hash, diff --git a/dashboard/app/templates.html b/dashboard/app/templates.html index 3f64ab2af..64a750be9 100644 --- a/dashboard/app/templates.html +++ b/dashboard/app/templates.html @@ -286,6 +286,7 @@ Use of this source code is governed by Apache 2 LICENSE that can be found in the {{optlink .Crash.ReproSyzLink "syz"}} {{optlink .Crash.KernelConfigLink ".config"}}
{{end}} + {{if not .Reported}}[report pending]
{{end}} {{end}} {{end}} -- cgit mrf-deployment