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

Unified Diff: milo/common/config.go

Issue 2979283002: Add manifest links and hack to index on revision. (Closed)
Patch Set: actually upload 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
« no previous file with comments | « milo/buildsource/buildbucket/pubsub.go ('k') | milo/common/model/build_summary.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: milo/common/config.go
diff --git a/milo/common/config.go b/milo/common/config.go
index 757e10e3acf61d453452e71f3f22a19255f7ef24..42097a94b966bd2e55a9a23c77f7463c74efc7e7 100644
--- a/milo/common/config.go
+++ b/milo/common/config.go
@@ -298,3 +298,29 @@ func GetConsole(c context.Context, projName, consoleName string) (*config.Consol
}
return nil, fmt.Errorf("Console %s not found in project %s", consoleName, projName)
}
+
+// ProjectConsole is a simple tuple type for GetConsolesForBuilder.
+type ProjectConsole struct {
+ ProjectID string
+ Console *config.Console
+}
+
+// GetConsolesForBuilder retrieves all the console definitions that this builder
+// belongs to.
+func GetConsolesForBuilder(c context.Context, builderName string) ([]*ProjectConsole, error) {
+ projs, err := GetAllProjects(c)
+ if err != nil {
+ return nil, err
+ }
+ ret := []*ProjectConsole{}
+ for _, p := range projs {
+ for _, con := range p.Consoles {
+ for _, b := range con.Builders {
+ if b.Name == builderName {
+ ret = append(ret, &ProjectConsole{p.ID, con})
+ }
+ }
+ }
+ }
+ return ret, nil
+}
« no previous file with comments | « milo/buildsource/buildbucket/pubsub.go ('k') | milo/common/model/build_summary.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698