aboutsummaryrefslogtreecommitdiffstats
path: root/dashboard/dashapi/dashapi.go
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2022-12-01 11:14:49 +0100
committerAleksandr Nogikh <wp32pw@gmail.com>2022-12-05 13:08:40 +0100
commit6b92e6649b6378f48541a9a85da68b47ae63542a (patch)
tree1511fc25eb25006838a2fa3975131560fd45d8e2 /dashboard/dashapi/dashapi.go
parent745ba1f433b221e9ad6fc29f2ae89e7d435de918 (diff)
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.
Diffstat (limited to 'dashboard/dashapi/dashapi.go')
-rw-r--r--dashboard/dashapi/dashapi.go21
1 files changed, 21 insertions, 0 deletions
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