diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2019-02-21 18:18:18 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2019-02-22 11:42:54 +0100 |
| commit | 6a5fcca423a42e14346de8637cc30d79530bf034 (patch) | |
| tree | 3ba2ed78cc94936b42e2b4e36898947a3d1869c3 /dashboard/dashapi/dashapi.go | |
| parent | 7ff74a98320355d2a8c097333827b6565dbf64b9 (diff) | |
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.
Diffstat (limited to 'dashboard/dashapi/dashapi.go')
| -rw-r--r-- | dashboard/dashapi/dashapi.go | 69 |
1 files changed, 60 insertions, 9 deletions
diff --git a/dashboard/dashapi/dashapi.go b/dashboard/dashapi/dashapi.go index 02d7ea132..ed95d0f38 100644 --- a/dashboard/dashapi/dashapi.go +++ b/dashboard/dashapi/dashapi.go @@ -262,6 +262,7 @@ type BugReport struct { JobID string ExtID string // arbitrary reporting ID forwarded from BugUpdate.ExtID First bool // Set for first report for this bug. + Moderation bool Title string Maintainers []string CC []string // additional CC emails @@ -297,15 +298,17 @@ type BugReport struct { } type BugUpdate struct { - ID string - ExtID string - Link string - Status BugStatus - ReproLevel ReproLevel - DupOf string - FixCommits []string // Titles of commits that fix this bug. - CC []string // Additional emails to add to CC list in future emails. - CrashID int64 + ID string + ExtID string + Link string + Status BugStatus + ReproLevel ReproLevel + DupOf string + OnHold bool // If set for open bugs, don't upstream this bug. + Notification bool // Reply to a notification. + FixCommits []string // Titles of commits that fix this bug. + CC []string // Additional emails to add to CC list in future emails. + CrashID int64 } type BugUpdateReply struct { @@ -325,6 +328,31 @@ type PollBugsResponse struct { Reports []*BugReport } +type BugNotification struct { + Type BugNotif + Namespace string + Config []byte + ID string + ExtID string // arbitrary reporting ID forwarded from BugUpdate.ExtID + Title string + Text string // meaning depends on Type + CC []string // additional CC emails + Maintainers []string + // Public is what we want all involved people to see (e.g. if we notify about a wrong commit title, + // people need to see it and provide the right title). Not public is what we want to send only + // to a minimal set of recipients (our mailing list) (e.g. notification about an obsoleted bug + // is mostly "for the record"). + Public bool +} + +type PollNotificationsRequest struct { + Type string +} + +type PollNotificationsResponse struct { + Notifications []*BugNotification +} + type PollClosedRequest struct { IDs []string } @@ -344,6 +372,17 @@ func (dash *Dashboard) ReportingPollBugs(typ string) (*PollBugsResponse, error) return resp, nil } +func (dash *Dashboard) ReportingPollNotifications(typ string) (*PollNotificationsResponse, error) { + req := &PollNotificationsRequest{ + Type: typ, + } + resp := new(PollNotificationsResponse) + if err := dash.Query("reporting_poll_notifs", req, resp); err != nil { + return nil, err + } + return resp, nil +} + func (dash *Dashboard) ReportingPollClosed(ids []string) ([]string, error) { req := &PollClosedRequest{ IDs: ids, @@ -384,6 +423,7 @@ func (dash *Dashboard) UploadManagerStats(req *ManagerStatsReq) error { type ( BugStatus int + BugNotif int ReproLevel int ) @@ -396,6 +436,17 @@ const ( ) const ( + // Upstream bug into next reporting. + // If the action succeeds, reporting sends BugStatusUpstream update. + BugNotifUpstream BugNotif = iota + // Bug needs to be closed as obsoleted. + // If the action succeeds, reporting sends BugStatusInvalid update. + BugNotifObsoleted + // Bug fixing commit can't be discovered (wrong commit title). + BugNotifBadCommit +) + +const ( ReproLevelNone ReproLevel = iota ReproLevelSyz ReproLevelC |
