aboutsummaryrefslogtreecommitdiffstats
path: root/dashboard/dashapi/dashapi.go
diff options
context:
space:
mode:
Diffstat (limited to 'dashboard/dashapi/dashapi.go')
-rw-r--r--dashboard/dashapi/dashapi.go39
1 files changed, 35 insertions, 4 deletions
diff --git a/dashboard/dashapi/dashapi.go b/dashboard/dashapi/dashapi.go
index bec406d78..02d7ea132 100644
--- a/dashboard/dashapi/dashapi.go
+++ b/dashboard/dashapi/dashapi.go
@@ -68,12 +68,15 @@ type Build struct {
KernelCommitDate time.Time
KernelConfig []byte
Commits []string // see BuilderPoll
- FixCommits []FixCommit
+ FixCommits []Commit
}
-type FixCommit struct {
- Title string
- BugID string
+type Commit struct {
+ Hash string
+ Title string
+ Author string
+ BugIDs []string // ID's extracted from Reported-by tags
+ Date time.Time
}
func (dash *Dashboard) UploadBuild(build *Build) error {
@@ -161,6 +164,34 @@ func (dash *Dashboard) ReportBuildError(req *BuildErrorReq) error {
return dash.Query("report_build_error", req, nil)
}
+type CommitPollResp struct {
+ ReportEmail string
+ Repos []Repo
+ Commits []string
+}
+
+type CommitPollResultReq struct {
+ Commits []Commit
+}
+
+type Repo struct {
+ URL string
+ Branch string
+}
+
+func (dash *Dashboard) CommitPoll() (*CommitPollResp, error) {
+ resp := new(CommitPollResp)
+ err := dash.Query("commit_poll", nil, resp)
+ return resp, err
+}
+
+func (dash *Dashboard) UploadCommits(commits []Commit) error {
+ if len(commits) == 0 {
+ return nil
+ }
+ return dash.Query("upload_commits", &CommitPollResultReq{commits}, nil)
+}
+
// Crash describes a single kernel crash (potentially with repro).
type Crash struct {
BuildID string // refers to Build.ID