Skip to content
Permalink
Browse files

dashboard/app: implement bug notifications/actions

Currently dashboard can only report new bugs and add reproducers
to already reported bugs.
This change adds infrastructure for the dashboard to actively act
on existing bugs in different ways. 4 new notifications (actions) added:
 - dashboard can auto-upstream bugs from moderation after an embargo period
 - dashboard can auto-upstream bugs if reporting criteria changes
   (e.g. it reported a bug into moderation because there was no repro,
   but then repro appears and the bug is automatically sent upstream)
 - dashboard detects when a fixing commit does not appear in any tested trees
   for too long and sends a notification about this
 - dashboard detects stale bugs (last happened monts ago, no repro, no activity)
   and auto-invalidates them
This will also be useful to send pings for old bugs and do other automation.
  • Loading branch information...
dvyukov committed Feb 21, 2019
1 parent 7ff74a9 commit 6a5fcca423a42e14346de8637cc30d79530bf034
@@ -34,6 +34,7 @@ var apiHandlers = map[string]APIHandler{
"job_poll": apiJobPoll,
"job_done": apiJobDone,
"reporting_poll_bugs": apiReportingPollBugs,
"reporting_poll_notifs": apiReportingPollNotifications,
"reporting_poll_closed": apiReportingPollClosed,
"reporting_update": apiReportingUpdate,
}
@@ -55,16 +55,11 @@ var testConfig = &GlobalConfig{
{
Name: "reporting1",
DailyLimit: 3,
Embargo: 14 * 24 * time.Hour,
Filter: skipWithRepro,
Config: &TestConfig{
Index: 1,
},
Filter: func(bug *Bug) FilterResult {
if strings.HasPrefix(bug.Title, "skip without repro") &&
bug.ReproLevel != dashapi.ReproLevelNone {
return FilterSkip
}
return FilterReport
},
},
{
Name: "reporting2",
@@ -99,9 +94,10 @@ var testConfig = &GlobalConfig{
{
Name: "reporting1",
DailyLimit: 5,
Embargo: 14 * 24 * time.Hour,
Filter: skipWithRepro,
Config: &EmailConfig{
Email: "test@syzkaller.com",
Moderation: true,
Email: "test@syzkaller.com",
},
},
{
@@ -215,6 +211,14 @@ const (
keyPublic = "clientpublickeyclientpublickey"
)

func skipWithRepro(bug *Bug) FilterResult {
if strings.HasPrefix(bug.Title, "skip with repro") &&
bug.ReproLevel != dashapi.ReproLevelNone {
return FilterSkip
}
return FilterReport
}

type TestConfig struct {
Index int
}
@@ -102,10 +102,15 @@ type Reporting struct {
Filter ReportingFilter
// How many new bugs report per day.
DailyLimit int
// Upstream reports into next reporting after this period.
Embargo time.Duration
// Type of reporting and its configuration.
// The app has one built-in type, EmailConfig, which reports bugs by email.
// And ExternalConfig which can be used to attach any external reporting system (e.g. Bugzilla).
Config ReportingType

// Set for all but last reporting stages.
moderation bool
}

type ReportingType interface {
@@ -270,6 +275,10 @@ func checkNamespaceReporting(ns string, cfg *Config) {
if reporting.DisplayTitle == "" {
reporting.DisplayTitle = reporting.Name
}
reporting.moderation = ri < len(cfg.Reporting)-1
if !reporting.moderation && reporting.Embargo != 0 {
panic(fmt.Sprintf("embargo in the last reporting %v", reporting.Name))
}
checkConfigAccessLevel(&reporting.AccessLevel, parentAccessLevel,
fmt.Sprintf("reporting %q/%q", ns, reporting.Name))
parentAccessLevel = reporting.AccessLevel
@@ -214,6 +214,7 @@ kernel config: %[4]v
dashboard link: https://testapp.appspot.com/bug?extid=%[1]v
compiler: compiler10
syz repro: %[2]v
CC: [bar@foo.com foo@bar.com maintainers@repo10.org bugs@repo10.org]
IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+%[1]v@testapp.appspotmail.com
@@ -289,6 +290,7 @@ dashboard link: https://testapp.appspot.com/bug?extid=%[1]v
compiler: compiler10
syz repro: %[3]v
C reproducer: %[2]v
CC: [qux@qux.com maintainers@repo10.org bugs@repo10.org]
IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+%[1]v@testapp.appspotmail.com
@@ -508,19 +510,19 @@ func TestEmailCrossReportingDup(t *testing.T) {
crash1 := testCrash(build, 1)
crash1.Title = fmt.Sprintf("bug_%v", i)
c.client2.ReportCrash(crash1)
bugSender := c.pollEmailBug()
bugSender := c.pollEmailBug().Sender
for j := 0; j < test.bug; j++ {
c.incomingEmail(bugSender, "#syz upstream")
bugSender = c.pollEmailBug()
bugSender = c.pollEmailBug().Sender
}

crash2 := testCrash(build, 2)
crash2.Title = fmt.Sprintf("dup_%v", i)
c.client2.ReportCrash(crash2)
dupSender := c.pollEmailBug()
dupSender := c.pollEmailBug().Sender
for j := 0; j < test.dup; j++ {
c.incomingEmail(dupSender, "#syz upstream")
dupSender = c.pollEmailBug()
dupSender = c.pollEmailBug().Sender
}

c.incomingEmail(bugSender, "#syz dup: "+crash2.Title)
@@ -102,7 +102,9 @@ type BugReporting struct {
Link string
CC string // additional emails added to CC list (|-delimited list)
CrashID int64 // crash that we've last reported in this reporting
Auto bool // was it auto-upstreamed/obsoleted?
ReproLevel dashapi.ReproLevel
OnHold time.Time // if set, the bug must not be upstreamed
Reported time.Time
Closed time.Time
}
@@ -598,6 +598,9 @@ func createUIBug(c context.Context, bug *Bug, state *ReportingState, managers []
switch bug.Status {
case BugStatusInvalid:
status = "closed as invalid"
if bugReporting.Auto {
status = "auto-" + status
}
case BugStatusFixed:
status = "fixed"
case BugStatusDup:
Oops, something went wrong.

0 comments on commit 6a5fcca

Please sign in to comment.
You can’t perform that action at this time.