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

Unified Diff: appengine/cmd/milo/resp/console.go

Issue 2196453002: Milo: Console view prototype (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-go@master
Patch Set: fixes Created 4 years, 4 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: appengine/cmd/milo/resp/console.go
diff --git a/appengine/cmd/milo/resp/console.go b/appengine/cmd/milo/resp/console.go
new file mode 100644
index 0000000000000000000000000000000000000000..cc1e280e84e1cbc04628470d0d0332ba1fa2f704
--- /dev/null
+++ b/appengine/cmd/milo/resp/console.go
@@ -0,0 +1,54 @@
+// Copyright 2016 The LUCI Authors. All rights reserved.
+// Use of this source code is governed under the Apache License, Version 2.0
+// that can be found in the LICENSE file.
+
+package resp
+
+// This file contains the structures for defining a Console view.
+// Console: The main entry point and the overall struct for a console page.
+// BuilderRef: Used both as an input to request a builder and headers for the console.
+// CommitBuild: A row in the console. References a commit with a list of build summaries.
+// ConsoleBuild: A cell in the console. Contains all information required to render the cell.
+
+// Console represents a console view. Commit contains the full matrix of
+// Commits x Builder, and BuilderRef contains information on how to render
+// the header. The two structs are expected to be consistent. IE len(Console.[]BuilderRef)
+// Should equal len(commit.Build) for all commit in Console.Commit.
+type Console struct {
+ Name string
+
+ Commit []CommitBuild
+
+ BuilderRef []BuilderRef
+}
+
+// BuilderRef is an unambiguous reference to a builder, along with metadata on how
+// to lay it out for rendering.
+type BuilderRef struct {
+ // Module is the name of the module this builder belongs to. This could be "buildbot",
+ // "buildbucket", or "dm".
+ Module string
+ // Name is the canonical reference to a specific builder in a specific module.
+ Name string
+ // Category is a pipe "|" deliminated list of short strings used to catagorize
+ // and organize builders. Adjacent builders with common categories will be
+ // merged on the header.
+ Category string // TODO(hinoka): This should be a list?
nodir 2016/08/04 23:13:13 yes, it should be a slice here, but a pipe-delimit
estaab 2016/08/04 23:21:25 Does it need to be a list to support nested catego
hinoka 2016/08/05 00:10:42 It doesn't technically need to, the callee can spl
+ // ShortName is a string of length 1-3 used to label the builder.
+ ShortName string
+}
+
+// CommitBuild is a row in the console. References a commit with a list of build summaries.
+type CommitBuild struct {
+ Commit
+ Build []*ConsoleBuild
nodir 2016/08/04 23:13:13 consider making it [][]*ConsoleBuild since there m
hinoka 2016/08/05 00:10:42 Let's discuss the implications first, I'm not quit
+}
+
+// ConsoleBuild is a cell in the console. Contains all information required to render the cell.
+type ConsoleBuild struct {
+ // Link to the build. Alt-text goes on the Label of the link
+ Link *Link
+
+ // Status of the build.
+ Status Status
+}

Powered by Google App Engine
This is Rietveld 408576698