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

Unified Diff: milo/appengine/buildbot/structs.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/structs.go
diff --git a/milo/appengine/buildbot/structs.go b/milo/appengine/buildbot/structs.go
index da95196c4b0f9f277b8d4b68802564af8852782a..e87058e013105dd6b36752051beb7c10253e403a 100644
--- a/milo/appengine/buildbot/structs.go
+++ b/milo/appengine/buildbot/structs.go
@@ -334,6 +334,24 @@ type buildbotChange struct {
Who string `json:"who"`
}
+func (bc *buildbotChange) GetFiles() []string {
+ files := make([]string, 0, len(bc.Files))
+ for _, f := range bc.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.
+ switch fn := f.(type) {
+ case string:
+ files = append(files, fn)
+ case map[string]interface{}:
+ if name, ok := fn["name"]; ok {
+ files = append(files, fmt.Sprintf("%s", name))
+ }
+ }
+ }
+ return files
+}
+
// buildbotSlave describes a slave on a master from a master json, and also includes the
// full builds of any currently running builds.
type buildbotSlave struct {
« no previous file with comments | « milo/appengine/buildbot/expectations/win_chromium_rel_ng.246309.build.json ('k') | milo/appengine/buildbucket/common.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698