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

Unified Diff: milo/appengine/buildbot/build.go

Issue 2608493002: Milo: Parse <br> from step text and renders the line breaks (Closed)
Patch Set: Review Created 4 years 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/appengine/buildbot/expectations/win_chromium_rel_ng.246309.build.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: milo/appengine/buildbot/build.go
diff --git a/milo/appengine/buildbot/build.go b/milo/appengine/buildbot/build.go
index 153b7c9e2cc60ac5ccc7a5e59aa80069b3e3c6b5..4b33461ecf87184c2ed87715249d6f3c4ee36802 100644
--- a/milo/appengine/buildbot/build.go
+++ b/milo/appengine/buildbot/build.go
@@ -10,6 +10,7 @@ import (
"io/ioutil"
"net/http"
"path/filepath"
+ "regexp"
"sort"
"strings"
"time"
@@ -174,6 +175,8 @@ func summary(c context.Context, b *buildbotBuild) resp.BuildComponent {
return sum
}
+var rLineBreak = regexp.MustCompile("<br */?>")
+
// components takes a full buildbot build struct and extract step info from all
// of the steps and returns it as a list of milo Build Components.
func components(b *buildbotBuild) (result []*resp.BuildComponent) {
@@ -183,7 +186,12 @@ func components(b *buildbotBuild) (result []*resp.BuildComponent) {
}
bc := &resp.BuildComponent{
Label: step.Name,
- Text: step.Text,
+ }
+ // Step text sometimes contains <br>, which we want to parse into new lines.
+ for _, t := range step.Text {
+ for _, line := range rLineBreak.Split(t, -1) {
+ bc.Text = append(bc.Text, line)
+ }
}
// Figure out the status.
« no previous file with comments | « no previous file | milo/appengine/buildbot/expectations/win_chromium_rel_ng.246309.build.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698