diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2023-04-25 12:00:45 +0200 |
|---|---|---|
| committer | Aleksandr Nogikh <wp32pw@gmail.com> | 2023-04-27 11:42:09 +0200 |
| commit | 6629581912466a5fbaa4c0f9d74040aed2f786f8 (patch) | |
| tree | 8c5f334e37e76beea1c135c6fbe599fa58e5a65f | |
| parent | 703f643f91e8becd2495f1f102346a0b7fa63867 (diff) | |
dashboard: let users exclude bugs from monthly reporting
If the "no-reminders" label is assigned to the bug, it will not appear
in monthly reports.
| -rw-r--r-- | dashboard/app/reporting_lists.go | 4 | ||||
| -rw-r--r-- | dashboard/app/subsystem_test.go | 146 |
2 files changed, 150 insertions, 0 deletions
diff --git a/dashboard/app/reporting_lists.go b/dashboard/app/reporting_lists.go index eb5f2b835..4b624fd19 100644 --- a/dashboard/app/reporting_lists.go +++ b/dashboard/app/reporting_lists.go @@ -271,6 +271,10 @@ func querySubsystemReport(c context.Context, subsystem *Subsystem, reporting *Re // As we don't keep exactly the date of the last user message, approximate it. continue } + if bug.HasLabel(NoRemindersLabel, "") { + // The bug was intentionally excluded from monthly reminders. + continue + } if bug.ReproLevel == dashapi.ReproLevelNone { noRepro = append(noRepro, bug) } else { diff --git a/dashboard/app/subsystem_test.go b/dashboard/app/subsystem_test.go index 8898d3fe0..dc5689535 100644 --- a/dashboard/app/subsystem_test.go +++ b/dashboard/app/subsystem_test.go @@ -688,3 +688,149 @@ See https://goo.gl/tpsmEJ for more information about syzbot. syzbot engineers can be reached at syzkaller@googlegroups.com. `, bugToExtID["WARNING: a first"], bugToExtID["WARNING: a third"])) } + +// nolint: goconst +func TestSkipSubsystemReminders(t *testing.T) { + c := NewCtx(t) + defer c.Close() + + client := c.makeClient(clientSubsystemRemind, keySubsystemRemind, true) + build := testBuild(1) + client.UploadBuild(build) + + bugToExtID := map[string]string{} + + // WARNING: a first + aFirst := testCrash(build, 1) + aFirst.Title = `WARNING: a first` + aFirst.GuiltyFiles = []string{"a.c"} + client.ReportCrash(aFirst) + bugToExtID[aFirst.Title] = client.pollEmailExtID() + c.advanceTime(time.Hour) + + // WARNING: a second (1 crash) + aSecond := testCrash(build, 1) + aSecond.Title = `WARNING: a second` + aSecond.GuiltyFiles = []string{"a.c"} + client.ReportCrash(aSecond) + bugToExtID[aSecond.Title] = client.pollEmailExtID() + c.advanceTime(time.Hour) + + // WARNING: a third (1 crash) + aThird := testCrash(build, 1) + aThird.Title = `WARNING: a third` + aThird.GuiltyFiles = []string{"a.c"} + client.ReportCrash(aThird) + bugToExtID[aThird.Title] = client.pollEmailExtID() + c.advanceTime(time.Hour) + + // WARNING: a fourth (1 crash) + aFourth := testCrash(build, 1) + aFourth.Title = `WARNING: a fourth` + aFourth.GuiltyFiles = []string{"a.c"} + client.ReportCrash(aFourth) + bugToExtID[aFourth.Title] = client.pollEmailExtID() + c.advanceTime(time.Hour) + + // Report bugs once more to pretend they're still valid. + c.advanceTime(time.Hour * 24 * 14) + client.ReportCrash(aFirst) + client.ReportCrash(aSecond) + client.ReportCrash(aThird) + client.ReportCrash(aFourth) + c.advanceTime(time.Hour) + + _, err := c.GET("/cron/subsystem_reports") + c.expectOK(err) + + // Expect the reminder for subsystemA. + reply := client.pollEmailBug() + c.expectEQ(reply.Subject, "[moderation] Monthly subsystemA report (Jan 2000)") + c.expectEQ(reply.To, []string{"moderation@syzkaller.com"}) + c.expectEQ(reply.Cc, []string(nil)) + c.expectEQ(reply.Body, fmt.Sprintf(`Hello subsystemA maintainers/developers, + +This is a 30-day syzbot report for the subsystemA subsystem. +All related reports/information can be found at: +https://testapp.appspot.com/subsystem-reminders/s/subsystemA + +During the period, 4 new issues were detected and 0 were fixed. +In total, 4 issues are still open. + +Some of the still happening issues: + +Ref Crashes Repro Title +<1> 2 No WARNING: a first + https://testapp.appspot.com/bug?extid=%[1]v +<2> 2 No WARNING: a fourth + https://testapp.appspot.com/bug?extid=%[4]v +<3> 2 No WARNING: a second + https://testapp.appspot.com/bug?extid=%[2]v +<4> 2 No WARNING: a third + https://testapp.appspot.com/bug?extid=%[3]v + +The report will be sent to: [subsystemA@list.com subsystemA@person.com]. +If the report looks fine to you, please send the "syz upstream" command. + +--- +This report is generated by a bot. It may contain errors. +See https://goo.gl/tpsmEJ for more information about syzbot. +syzbot engineers can be reached at syzkaller@googlegroups.com. +`, bugToExtID["WARNING: a first"], bugToExtID["WARNING: a second"], + bugToExtID["WARNING: a third"], bugToExtID["WARNING: a fourth"])) + + c.incomingEmail(reply.Sender, `> In total, 4 issues are still open. +> +> Some of the still happening issues: +> +> Ref Crashes Repro Title +> <1> 2 No WARNING: a first +> https://testapp.appspot.com/bug?extid=%[1]v +> <2> 2 No WARNING: a fourth +> https://testapp.appspot.com/bug?extid=%[4]v +#syz set <2> no-reminders +> <3> 2 No WARNING: a second +> https://testapp.appspot.com/bug?extid=%[2]v +> <4> 2 No WARNING: a third +> https://testapp.appspot.com/bug?extid=%[3]v +#syz set <4> no-reminders +`) + + // Prepare for the next monthly report. + c.advanceTime(time.Hour * 24 * 31) + client.ReportCrash(aFirst) + client.ReportCrash(aSecond) + client.ReportCrash(aThird) + client.ReportCrash(aFourth) + c.advanceTime(time.Hour) + + _, err = c.GET("/cron/subsystem_reports") + c.expectOK(err) + + reply = client.pollEmailBug() + c.expectEQ(reply.Body, fmt.Sprintf(`Hello subsystemA maintainers/developers, + +This is a 30-day syzbot report for the subsystemA subsystem. +All related reports/information can be found at: +https://testapp.appspot.com/subsystem-reminders/s/subsystemA + +During the period, 0 new issues were detected and 0 were fixed. +In total, 4 issues are still open. + +Some of the still happening issues: + +Ref Crashes Repro Title +<1> 3 No WARNING: a first + https://testapp.appspot.com/bug?extid=%[1]v +<2> 3 No WARNING: a second + https://testapp.appspot.com/bug?extid=%[2]v + +The report will be sent to: [subsystemA@list.com subsystemA@person.com]. +If the report looks fine to you, please send the "syz upstream" command. + +--- +This report is generated by a bot. It may contain errors. +See https://goo.gl/tpsmEJ for more information about syzbot. +syzbot engineers can be reached at syzkaller@googlegroups.com. +`, bugToExtID["WARNING: a first"], bugToExtID["WARNING: a second"])) +} |
