Chromium Code Reviews| Index: milo/api/resp/build.go |
| diff --git a/milo/api/resp/build.go b/milo/api/resp/build.go |
| index 174f328f23bcb78db9c004d9d3f524c70170d9aa..e92c94b8825d4d550b8bb471fea5722f36cfe593 100644 |
| --- a/milo/api/resp/build.go |
| +++ b/milo/api/resp/build.go |
| @@ -285,11 +285,18 @@ func NewLink(label, url string) *Link { |
| } |
| func (comp *BuildComponent) toModelSummary() model.Summary { |
| + text := comp.Text |
| + // Max length for a datastore text field is 1500 char, but for summary purposes |
| + // we don't really need anything much longer than 200 char or so. |
|
dnj
2017/08/03 16:28:20
s/200/256?
Ryan Tseng
2017/08/03 16:32:58
I was trying to highlight the inexact nature of wh
|
| + const maxTextLen = 256 |
| + if len(text) > maxTextLen { |
| + text = text[0:256] |
|
dnj
2017/08/03 16:28:20
nit: can just do text[:256].
However, there is a
Ryan Tseng
2017/08/03 16:32:58
Weird, Go used to complain if I did [:number]
don
|
| + } |
| return model.Summary{ |
| Status: comp.Status, |
| Start: comp.Started, |
| End: comp.Finished, |
| - Text: comp.Text, |
| + Text: text, |
| } |
| } |