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

Unified Diff: milo/api/resp/build.go

Issue 2978293002: [milo] Add an (uncached) method to get console rows. (Closed)
Patch Set: make manifestkey its own type 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 | « no previous file | milo/api/resp/console.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: milo/api/resp/build.go
diff --git a/milo/api/resp/build.go b/milo/api/resp/build.go
index 1cf550d120f6338d16d7dbb24ac4c38e93e931fa..b316f18f855f499730eef2cebbc5559963db1841 100644
--- a/milo/api/resp/build.go
+++ b/milo/api/resp/build.go
@@ -20,6 +20,7 @@ package resp
import (
"encoding/hex"
"encoding/json"
+ "strings"
"time"
"golang.org/x/net/context"
@@ -104,8 +105,6 @@ type Commit struct {
Revision *Link
// The commit message.
Description string
- // The commit title, usually the first line of the commit message.
- Title string
// Rietveld or Gerrit URL if the commit is a patch.
Changelist *Link
// Browsable URL of the commit.
@@ -114,6 +113,18 @@ type Commit struct {
File []string
}
+// Title is the first line of the commit message (Description).
+func (c *Commit) Title() string {
+ switch lines := strings.SplitN(c.Description, "\n", 2); len(lines) {
+ case 0:
+ return ""
+ case 1:
+ return c.Description
+ default:
+ return lines[0]
+ }
+}
+
// BuildProgress is a way to show progress. Percent should always be specified.
type BuildProgress struct {
// The total number of entries. Shows up as a tooltip. Leave at 0 to
@@ -312,7 +323,7 @@ func (rb *MiloBuild) SummarizeTo(c context.Context, bs *model.BuildSummary) erro
// HACK(iannucci): Until we have real manifest support, console
// definitions will specify their manifest as "REVISION", and we'll do
// lookups with null URL fields.
- bs.AddManifestRevisionIndex(
+ bs.AddManifestKey(
con.ProjectID, con.Console.Name, "REVISION", "", revisionBytes)
}
}
« no previous file with comments | « no previous file | milo/api/resp/console.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698