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

Unified Diff: milo/common/config.go

Issue 2979283002: Add manifest links and hack to index on revision. (Closed)
Patch Set: fix nits Created 3 years, 5 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/common/config.go
diff --git a/milo/common/config.go b/milo/common/config.go
index 757e10e3acf61d453452e71f3f22a19255f7ef24..9d36a5bdca14b780f5a04f3728d12756b5fdbab1 100644
--- a/milo/common/config.go
+++ b/milo/common/config.go
@@ -298,3 +298,23 @@ func GetConsole(c context.Context, projName, consoleName string) (*config.Consol
}
return nil, fmt.Errorf("Console %s not found in project %s", consoleName, projName)
}
+
+// GetConsolesForBuilder retrieves all the console definitions that this builder
+// belongs to.
+func GetConsolesForBuilder(c context.Context, builderName string) ([]*config.Console, error) {
+ projs, err := GetAllProjects(c)
+ if err != nil {
+ return nil, err
+ }
+ ret := []*config.Console{}
+ for _, p := range projs {
+ for _, cons := range p.Consoles {
+ for _, b := range cons.Builders {
+ if b.Name == builderName {
+ ret = append(ret, cons)
+ }
+ }
+ }
+ }
+ return ret, nil
+}

Powered by Google App Engine
This is Rietveld 408576698