aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2023-08-03 19:42:47 +0200
committerAleksandr Nogikh <nogikh@google.com>2023-08-04 14:50:39 +0000
commitcdae481e33658b7c827516ae5c7f16007c505832 (patch)
tree2ec2481ac64451d06cb9a2791e11ad0018484ea0
parentf390e60878ac1f757d680dbbbcc6b6d4c579baad (diff)
dashboard: report fix candidate commits per email
Enable reporting of the results of cross-tree bisections. Adjust email reporting to differentiate between normal fix bisections and fix candidate reporting.
-rw-r--r--dashboard/app/jobs.go5
-rw-r--r--dashboard/app/mail_fix_candidate.txt22
-rw-r--r--dashboard/app/reporting_email.go11
-rw-r--r--dashboard/app/tree_test.go31
4 files changed, 60 insertions, 9 deletions
diff --git a/dashboard/app/jobs.go b/dashboard/app/jobs.go
index eb6d29b6e..87f6446c2 100644
--- a/dashboard/app/jobs.go
+++ b/dashboard/app/jobs.go
@@ -1198,11 +1198,6 @@ func pollCompletedJobs(c context.Context, typ string) ([]*dashapi.BugReport, err
if job.Type == JobBisectFix && len(job.Commits) != 1 {
continue
}
- // Don't report cross-tree bisection results for now as we need to first understand
- // how reliable their results are.
- if job.IsCrossTree() {
- continue
- }
// If the bug is already known to be fixed, invalid or duplicate, do not report the bisection results.
if job.Type == JobBisectCause || job.Type == JobBisectFix {
bug := new(Bug)
diff --git a/dashboard/app/mail_fix_candidate.txt b/dashboard/app/mail_fix_candidate.txt
new file mode 100644
index 000000000..af247af62
--- /dev/null
+++ b/dashboard/app/mail_fix_candidate.txt
@@ -0,0 +1,22 @@
+{{$bisect := .BisectFix}}syzbot suspects this issue could be fixed by backporting the following commit:
+
+commit {{$bisect.Commit.Hash}}
+git tree: {{.KernelRepoAlias}}
+Author: {{$bisect.Commit.AuthorName}} <{{$bisect.Commit.Author}}>
+Date: {{formatKernelTime $bisect.Commit.Date}}
+
+ {{$bisect.Commit.Title}}
+
+bisection log: {{$bisect.LogLink}}
+{{if $bisect.CrashReportLink}}final oops: {{$bisect.CrashReportLink}}
+{{end}}{{if $bisect.CrashLogLink}}console output: {{$bisect.CrashLogLink}}
+{{end}}{{if .KernelConfigLink}}kernel config: {{.KernelConfigLink}}
+{{end}}dashboard link: {{.Link}}
+{{if .UserSpaceArch}}userspace arch: {{.UserSpaceArch}}
+{{end}}{{if .ReproSyzLink}}syz repro: {{.ReproSyzLink}}
+{{end}}{{if .ReproCLink}}C reproducer: {{.ReproCLink}}
+{{end}}
+
+Please keep in mind that other backports might be required as well.
+
+For information about bisection process see: https://goo.gl/tpsmEJ#bisection
diff --git a/dashboard/app/reporting_email.go b/dashboard/app/reporting_email.go
index 26a3e57ef..a0639e098 100644
--- a/dashboard/app/reporting_email.go
+++ b/dashboard/app/reporting_email.go
@@ -343,8 +343,17 @@ func emailReport(c context.Context, rep *dashapi.BugReport) error {
case dashapi.ReportTestPatch:
templ = "mail_test_result.txt"
cfg.MailMaintainers = false
- case dashapi.ReportBisectCause, dashapi.ReportBisectFix:
+ case dashapi.ReportBisectCause:
templ = "mail_bisect_result.txt"
+ case dashapi.ReportBisectFix:
+ if rep.BisectFix.CrossTree {
+ templ = "mail_fix_candidate.txt"
+ if rep.BisectFix.Commit == nil {
+ return fmt.Errorf("reporting failed fix candidate bisection for %s", rep.ID)
+ }
+ } else {
+ templ = "mail_bisect_result.txt"
+ }
default:
return fmt.Errorf("unknown report type %v", rep.Type)
}
diff --git a/dashboard/app/tree_test.go b/dashboard/app/tree_test.go
index 8fef51865..edef2ac01 100644
--- a/dashboard/app/tree_test.go
+++ b/dashboard/app/tree_test.go
@@ -236,8 +236,11 @@ func TestTreeOriginLtsBisection(t *testing.T) {
CrashReport: []byte("bisect crash report"),
Commits: []dashapi.Commit{
{
- Hash: "deadf00d",
- Title: "kernel: fix a bug",
+ AuthorName: "Someone",
+ Author: "someone@somewhere.com",
+ Hash: "deadf00d",
+ Title: "kernel: fix a bug",
+ Date: time.Date(2000, 2, 9, 4, 5, 6, 7, time.UTC),
},
},
}
@@ -250,7 +253,29 @@ func TestTreeOriginLtsBisection(t *testing.T) {
job = ctx.client.pollSpecificJobs(ctx.manager, dashapi.ManagerJobs{BisectFix: true})
assert.Equal(t, job.ID, "")
- // No emails are to be sent (for now).
+ msg := ctx.emailWithoutURLs()
+ c.expectEQ(msg.Body, `syzbot suspects this issue could be fixed by backporting the following commit:
+
+commit deadf00d
+git tree: upstream
+Author: Someone <someone@somewhere.com>
+Date: Wed Feb 9 04:05:06 2000 +0000
+
+ kernel: fix a bug
+
+bisection log: %URL%
+final oops: %URL%
+console output: %URL%
+kernel config: %URL%
+dashboard link: %URL%
+syz repro: %URL%
+C reproducer: %URL%
+
+
+Please keep in mind that other backports might be required as well.
+
+For information about bisection process see: %URL%#bisection
+`)
ctx.ctx.expectNoEmail()
info := ctx.fullBugInfo()