From 0327584e9904f4b7ecda8b9787ee34e9a7b03731 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Thu, 10 Aug 2017 19:29:42 +0200 Subject: 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. --- dashboard/dashapi/dashapi.go | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) (limited to 'dashboard/dashapi/dashapi.go') 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 { -- cgit mrf-deployment