From a77e6539d9a657d582fa3167b8bc049feb2bd1fb Mon Sep 17 00:00:00 2001 From: Zubin Mithra Date: Mon, 4 Nov 2019 12:28:13 -0800 Subject: syz-ci: send build info for failed bisections * When fix bisections fails due to a crash on HEAD, the dashboard needs to keep track of which commit the crash occured at. In order to do this, send correct commit information to the dashboard. * Modify mail_bisect_result.txt to be clearer on what BisectResult.KernelCommit represents. Modify test in bisect_test.go to accommodate the changes in templates. --- dashboard/app/bisect_test.go | 2 +- dashboard/app/mail_bisect_result.txt | 2 +- syz-ci/jobs.go | 8 +++++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/dashboard/app/bisect_test.go b/dashboard/app/bisect_test.go index 2c401c6e4..0512ab9fc 100644 --- a/dashboard/app/bisect_test.go +++ b/dashboard/app/bisect_test.go @@ -586,7 +586,7 @@ func TestBisectCauseAncient(t *testing.T) { c.expectEQ(msg.Body, fmt.Sprintf(`Bisection is inconclusive: the bug happens on the oldest tested release. bisection log: %[2]v -start commit: 11111111 kernel_commit_title1 +oldest commit: 11111111 kernel_commit_title1 git tree: repo1 branch1 final crash: %[3]v console output: %[4]v diff --git a/dashboard/app/mail_bisect_result.txt b/dashboard/app/mail_bisect_result.txt index 8c893440f..aa60b0848 100644 --- a/dashboard/app/mail_bisect_result.txt +++ b/dashboard/app/mail_bisect_result.txt @@ -12,7 +12,7 @@ Date: {{formatKernelTime $bisect.Commit.Date}} {{else}}Bisection is inconclusive: the bug happens on the {{if $bisect.Fix}}latest{{else}}oldest{{end}} tested release. {{end}} bisection log: {{$bisect.LogLink}} -start commit: {{formatShortHash $br.KernelCommit}} {{formatCommitTableTitle $br.KernelCommitTitle}} +{{if $bisect.Commit}}start commit: {{else if $bisect.Commits}}start commit: {{else}}{{if $bisect.Fix}}latest commit: {{else}}oldest commit: {{end}}{{end}}{{formatShortHash $br.KernelCommit}} {{formatCommitTableTitle $br.KernelCommitTitle}} git tree: {{$br.KernelRepoAlias}} {{if $bisect.CrashReportLink}}final crash: {{$bisect.CrashReportLink}} {{end}}{{if $bisect.CrashLogLink}}console output: {{$bisect.CrashLogLink}} diff --git a/syz-ci/jobs.go b/syz-ci/jobs.go index 42647be48..b6fb28a07 100644 --- a/syz-ci/jobs.go +++ b/syz-ci/jobs.go @@ -397,7 +397,7 @@ func (jp *JobProcessor) bisect(job *Job, mgrcfg *mgrconfig.Config) error { Manager: *mgrcfg, } - commits, rep, _, err := bisect.Run(cfg) + commits, rep, com, err := bisect.Run(cfg) resp.Log = trace.Bytes() if err != nil { return err @@ -418,6 +418,12 @@ func (jp *JobProcessor) bisect(job *Job, mgrcfg *mgrconfig.Config) error { resp.CrashLog = rep.Output if len(resp.Commits) != 0 { resp.Commits[0].CC = append(resp.Commits[0].CC, rep.Maintainers...) + } else { + // If there is a report ahd there is no commit, it means a crash + // occurred on HEAD(for BisectFix) and oldest tested release(for BisectCause). + resp.Build.KernelCommit = com.Hash + resp.Build.KernelCommitDate = com.Date + resp.Build.KernelCommitTitle = com.Title } } return nil -- cgit mrf-deployment