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

Unified Diff: milo/frontend/view_console.go

Issue 2982183002: Milo: Store console defs as their own entities (Closed)
Patch Set: tests 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
« milo/buildsource/buildbot/pubsub_test.go ('K') | « milo/frontend/view_config.go ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: milo/frontend/view_console.go
diff --git a/milo/frontend/view_console.go b/milo/frontend/view_console.go
index b314fecf4da2344e12e9c1cf6b90ce0fe4af5e84..f5343090d8621cfcfc60eff7ba83d7ca9fee797f 100644
--- a/milo/frontend/view_console.go
+++ b/milo/frontend/view_console.go
@@ -28,7 +28,6 @@ import (
"github.com/luci/luci-go/server/router"
"github.com/luci/luci-go/server/templates"
- "github.com/luci/luci-go/milo/api/config"
"github.com/luci/luci-go/milo/api/resp"
"github.com/luci/luci-go/milo/common"
"github.com/luci/luci-go/milo/common/model"
@@ -46,7 +45,7 @@ func getConsoleBuilds(
// If the user is not a reader of the project, this will return a 404.
// TODO(hinoka): If the user is not a reader of any of of the builders returned,
// that builder will be removed from list of results.
-func getConsoleDef(c context.Context, project, name string) (*config.Console, error) {
+func getConsoleDef(c context.Context, project, name string) (*common.Console, error) {
cs, err := common.GetConsole(c, project, name)
if err != nil {
return nil, err
@@ -73,7 +72,7 @@ func console(c context.Context, project, name string) (*resp.Console, error) {
if err != nil {
return nil, err
}
- commits, err := getCommits(c, def.RepoURL, def.Branch, 25)
+ commits, err := getCommits(c, def.RepoURL, def.Ref, 25)
if err != nil {
return nil, err
}
@@ -89,9 +88,7 @@ func console(c context.Context, project, name string) (*resp.Console, error) {
// HACK(hinoka): This only supports buildbot....
builders := make([]resp.BuilderRef, len(def.Builders))
for i, b := range def.Builders {
- builders[i] = resp.BuilderRef{
- b.Name, strings.Split(b.Category, "|"), b.ShortName,
- }
+ builders[i] = resp.BuilderRef{Name: b}
}
cb, err := getConsoleBuilds(c, builders, commitNames)
tConsole := clock.Now(c)
@@ -107,7 +104,7 @@ func console(c context.Context, project, name string) (*resp.Console, error) {
}
cs := &resp.Console{
- Name: def.Name,
+ Name: def.ID,
Commit: ccb,
BuilderRef: builders,
}
« milo/buildsource/buildbot/pubsub_test.go ('K') | « milo/frontend/view_config.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698