diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2019-02-14 10:35:03 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2019-02-17 15:08:45 +0100 |
| commit | 3e98cc30803fb5e41504dd08b1325cb074a8a3f2 (patch) | |
| tree | 5f0a7a4702bedbb9706c158e09e4be1875894625 /dashboard/dashapi/dashapi.go | |
| parent | f42dee6d5e501a061cdbb807672361369bf28492 (diff) | |
dashboard/app: poll commits info
This implements 2 features:
- syz-ci polls a set of additional repos to discover fixing commits sooner
(e.g. it can now discover a fixing commit in netfilter tree before
it reaches any of the tested trees).
- syz-ci uploads info about commits to dashboard.
For example, a user marks a bug as fixed by commit "foo: bar".
syz-ci will find this commit in the main namespace repo
and upload commmit hash/date/author to dashboard. This in turn
allows to show links to fixing commits.
Fixes #691
Fixes #610
Diffstat (limited to 'dashboard/dashapi/dashapi.go')
| -rw-r--r-- | dashboard/dashapi/dashapi.go | 39 |
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 |
