From 5232cf0254feea67f22bebab12e4302bb37f74f6 Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Tue, 28 Mar 2023 17:01:21 +0200 Subject: dashboard: share repro level and report link in SimilarBugInfo This will make FullBugInfo's contents much more useful. --- dashboard/app/reporting.go | 12 +++++++----- dashboard/app/reporting_test.go | 29 +++++++++++++++++++++++++---- dashboard/dashapi/dashapi.go | 12 +++++++----- 3 files changed, 39 insertions(+), 14 deletions(-) (limited to 'dashboard') diff --git a/dashboard/app/reporting.go b/dashboard/app/reporting.go index 6d6abc17a..216bcca0e 100644 --- a/dashboard/app/reporting.go +++ b/dashboard/app/reporting.go @@ -1324,11 +1324,13 @@ func loadFullBugInfo(c context.Context, bug *Bug, bugKey *db.Key, return nil, err } ret.SimilarBugs = append(ret.SimilarBugs, &dashapi.SimilarBugInfo{ - Title: similarBug.displayTitle(), - Status: status, - Namespace: similarBug.Namespace, - Link: fmt.Sprintf("%v/bug?extid=%v", appURL(c), bugReporting.ID), - Closed: similarBug.Closed, + Title: similarBug.displayTitle(), + Status: status, + Namespace: similarBug.Namespace, + ReproLevel: similarBug.ReproLevel, + Link: fmt.Sprintf("%v/bug?extid=%v", appURL(c), bugReporting.ID), + ReportLink: bugReporting.Link, + Closed: similarBug.Closed, }) } // Query crashes. diff --git a/dashboard/app/reporting_test.go b/dashboard/app/reporting_test.go index 589df3d45..6d1040472 100644 --- a/dashboard/app/reporting_test.go +++ b/dashboard/app/reporting_test.go @@ -988,8 +988,27 @@ func TestFullBugInfo(t *testing.T) { otherCrash := testCrash(otherBuild, 1) otherCrash.Title = crashTitle + otherCrash.ReproOpts = []byte("repro opts") + otherCrash.ReproSyz = []byte("repro syz") c.client2.ReportCrash(otherCrash) otherPollMsg := c.client2.pollEmailBug() + + _, err := c.POST("/_ah/mail/", fmt.Sprintf(`Sender: syzkaller@googlegroups.com +Date: Tue, 15 Aug 2017 14:59:00 -0700 +Message-ID: <1234> +Subject: crash1 +From: %v +To: foo@bar.com +Content-Type: text/plain + +This email is only needed to capture the link +-- +To post to this group, send email to syzkaller@googlegroups.com. +To view this discussion on the web visit https://groups.google.com/d/msgid/syzkaller/1234@google.com. +For more options, visit https://groups.google.com/d/optout. +`, otherPollMsg.Sender)) + c.expectOK(err) + _, otherExtBugID, _ := email.RemoveAddrContext(otherPollMsg.Sender) // Query the full bug info. @@ -1002,10 +1021,12 @@ func TestFullBugInfo(t *testing.T) { t.Fatalf("info.BisectCause.BisectCause is empty") } c.expectEQ(info.SimilarBugs, []*dashapi.SimilarBugInfo{{ - Title: crashTitle, - Namespace: "test2", - Status: dashapi.BugStatusOpen, - Link: "https://testapp.appspot.com/bug?extid=" + otherExtBugID, + Title: crashTitle, + Namespace: "test2", + Status: dashapi.BugStatusOpen, + ReproLevel: dashapi.ReproLevelSyz, + Link: "https://testapp.appspot.com/bug?extid=" + otherExtBugID, + ReportLink: "https://groups.google.com/d/msgid/syzkaller/1234@google.com", }}) // There must be 3 crashes. diff --git a/dashboard/dashapi/dashapi.go b/dashboard/dashapi/dashapi.go index eb6557e41..669629d65 100644 --- a/dashboard/dashapi/dashapi.go +++ b/dashboard/dashapi/dashapi.go @@ -716,11 +716,13 @@ type FullBugInfo struct { } type SimilarBugInfo struct { - Title string - Status BugStatus - Namespace string - Link string - Closed time.Time + Title string + Status BugStatus + Namespace string + Link string + ReportLink string + Closed time.Time + ReproLevel ReproLevel } func (dash *Dashboard) LoadFullBug(req *LoadFullBugReq) (*FullBugInfo, error) { -- cgit mrf-deployment