aboutsummaryrefslogtreecommitdiffstats
path: root/dashboard/dashapi/dashapi.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2017-08-10 19:29:42 +0200
committerDmitry Vyukov <dvyukov@google.com>2017-08-10 19:29:42 +0200
commit0327584e9904f4b7ecda8b9787ee34e9a7b03731 (patch)
tree9c3c57435e6ea64c769befb760251649cff4ac31 /dashboard/dashapi/dashapi.go
parent89e74d8ccb576df7760103936288d7f23f1bf62f (diff)
dashboard/app: tell managers when dashboard needs a repro
Managers can't decide when a repro is required. First, there can be bugs with seq>0. Second, a repro can be already obtained on another manager.
Diffstat (limited to 'dashboard/dashapi/dashapi.go')
-rw-r--r--dashboard/dashapi/dashapi.go31
1 files changed, 24 insertions, 7 deletions
diff --git a/dashboard/dashapi/dashapi.go b/dashboard/dashapi/dashapi.go
index 7d006d747..4c744e9b4 100644
--- a/dashboard/dashapi/dashapi.go
+++ b/dashboard/dashapi/dashapi.go
@@ -85,19 +85,36 @@ type Crash struct {
ReproC []byte
}
-func (dash *Dashboard) ReportCrash(crash *Crash) error {
- return dash.query("report_crash", crash, nil)
+type ReportCrashResp struct {
+ NeedRepro bool
}
-// FailedRepro describes a failed repro attempt.
-type FailedRepro struct {
- Manager string
+func (dash *Dashboard) ReportCrash(crash *Crash) (*ReportCrashResp, error) {
+ resp := new(ReportCrashResp)
+ err := dash.query("report_crash", crash, resp)
+ return resp, err
+}
+
+// CrashID is a short summary of a crash for repro queires.
+type CrashID struct {
BuildID string
Title string
}
-func (dash *Dashboard) ReportFailedRepro(repro *FailedRepro) error {
- return dash.query("report_failed_repro", repro, nil)
+type NeedReproResp struct {
+ NeedRepro bool
+}
+
+// NeedRepro checks if dashboard needs a repro for this crash or not.
+func (dash *Dashboard) NeedRepro(crash *CrashID) (bool, error) {
+ resp := new(NeedReproResp)
+ err := dash.query("need_repro", crash, resp)
+ return resp.NeedRepro, err
+}
+
+// ReportFailedRepro notifies dashboard about a failed repro attempt for the crash.
+func (dash *Dashboard) ReportFailedRepro(crash *CrashID) error {
+ return dash.query("report_failed_repro", crash, nil)
}
type LogEntry struct {