From 54259e6cafd8a674279301227c23cd032e8dd080 Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Fri, 19 May 2023 19:28:17 +0200 Subject: dashapi: display error text for BisectInfraError --- dashboard/dashapi/dashapi.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'dashboard/dashapi/dashapi.go') diff --git a/dashboard/dashapi/dashapi.go b/dashboard/dashapi/dashapi.go index 9f90467ef..161794e9f 100644 --- a/dashboard/dashapi/dashapi.go +++ b/dashboard/dashapi/dashapi.go @@ -227,6 +227,29 @@ const ( BisectResultInfraError // the bisect failed due to an infrastructure problem ) +func (flags JobDoneFlags) String() string { + if flags&BisectResultInfraError != 0 { + return "[infra failure]" + } + res := "" + if flags&BisectResultMerge != 0 { + res += "merge " + } + if flags&BisectResultNoop != 0 { + res += "no-op " + } + if flags&BisectResultRelease != 0 { + res += "release " + } + if flags&BisectResultIgnore != 0 { + res += "ignored " + } + if res == "" { + return res + } + return "[" + res + "commit]" +} + func (dash *Dashboard) JobPoll(req *JobPollReq) (*JobPollResp, error) { resp := new(JobPollResp) err := dash.Query("job_poll", req, resp) -- cgit mrf-deployment