Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(88)

Unified Diff: milo/appengine/buildbot/build.go

Issue 2823413002: Milo buildbot: Add in the rest of the blame/commits information. (Closed)
Patch Set: Review Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: milo/appengine/buildbot/build.go
diff --git a/milo/appengine/buildbot/build.go b/milo/appengine/buildbot/build.go
index ff849722415e0eab2655cb4a6c30e804690aced4..af66b6a7670e26c3d772a3cf30af08b13befbe41 100644
--- a/milo/appengine/buildbot/build.go
+++ b/milo/appengine/buildbot/build.go
@@ -384,21 +384,15 @@ func properties(b *buildbotBuild) (result []*resp.PropertyGroup) {
// returns it as a list of Commits.
func blame(b *buildbotBuild) (result []*resp.Commit) {
for _, c := range b.Sourcestamp.Changes {
- files := make([]string, len(c.Files))
- for i, f := range c.Files {
- // Buildbot stores files both as a string, or as a dict with a single entry
- // named "name". It doesn't matter to us what the type is, but we need
- // to reflect on the type anyways.
- if fn, ok := f.(string); ok {
- files[i] = fn
- } else if fn, ok := f.(struct{ Name string }); ok {
- files[i] = fn.Name
- }
- }
+ files := c.GetFiles()
result = append(result, &resp.Commit{
AuthorEmail: c.Who,
Repo: c.Repository,
- Revision: c.Revision,
+ CommitTime: time.Unix(int64(c.When), 0),
+ Revision: &resp.Link{
+ URL: c.Revlink,
+ Label: c.Revision,
+ },
Description: c.Comments,
Title: strings.Split(c.Comments, "\n")[0],
File: files,
@@ -412,6 +406,8 @@ func blame(b *buildbotBuild) (result []*resp.Commit) {
func sourcestamp(c context.Context, b *buildbotBuild) *resp.SourceStamp {
ss := &resp.SourceStamp{}
rietveld := ""
+ got_revision := ""
+ repository := ""
issue := int64(-1)
// TODO(hinoka): Gerrit URLs.
for _, prop := range b.Properties {
@@ -431,11 +427,15 @@ func sourcestamp(c context.Context, b *buildbotBuild) *resp.SourceStamp {
case "got_revision":
if v, ok := prop.Value.(string); ok {
- ss.Revision = v
+ got_revision = v
} else {
logging.Warningf(c, "Field got_revision is not a string: %#v", prop.Value)
}
+ case "repository":
+ if v, ok := prop.Value.(string); ok {
+ repository = v
+ }
}
}
if issue != -1 {
@@ -449,6 +449,14 @@ func sourcestamp(c context.Context, b *buildbotBuild) *resp.SourceStamp {
logging.Warningf(c, "Found issue but not rietveld property.")
}
}
+ if got_revision != "" {
+ ss.Revision = &resp.Link{
+ Label: got_revision,
+ }
+ if repository != "" {
+ ss.Revision.URL = repository + "/+/" + got_revision
+ }
+ }
return ss
}
« no previous file with comments | « milo/appengine/backend/git/gitiles.go ('k') | milo/appengine/buildbot/expectations/CrWinGoma.30608.build.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698