From 6b92e6649b6378f48541a9a85da68b47ae63542a Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Thu, 1 Dec 2022 11:14:49 +0100 Subject: dashboard: post patch testing jobs externally Accept patch testing requests not only via email, but also by a direct dashboard API request. Introduce a new /add_test_job API call. Add tests that verify the expected flow and some side cases. --- dashboard/dashapi/dashapi.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'dashboard/dashapi/dashapi.go') diff --git a/dashboard/dashapi/dashapi.go b/dashboard/dashapi/dashapi.go index 15b4c6aa1..0c07079bd 100644 --- a/dashboard/dashapi/dashapi.go +++ b/dashboard/dashapi/dashapi.go @@ -498,6 +498,19 @@ type PollClosedResponse struct { IDs []string } +type TestPatchRequest struct { + BugID string + Link string + User string + Repo string + Branch string + Patch []byte +} + +type TestPatchReply struct { + ErrorText string +} + func (dash *Dashboard) ReportingPollBugs(typ string) (*PollBugsResponse, error) { req := &PollBugsRequest{ Type: typ, @@ -539,6 +552,14 @@ func (dash *Dashboard) ReportingUpdate(upd *BugUpdate) (*BugUpdateReply, error) return resp, nil } +func (dash *Dashboard) NewTestJob(upd *TestPatchRequest) (*TestPatchReply, error) { + resp := new(TestPatchReply) + if err := dash.Query("new_test_job", upd, resp); err != nil { + return nil, err + } + return resp, nil +} + type ManagerStatsReq struct { Name string Addr string -- cgit mrf-deployment