Milo should support limited HTML output (or maybe markdown?) in STEP_TEXT output |
||||||||||
Issue descriptionThe STEP_TEXT output is used by humans to quickly understand what happened in a step and why it failed. We should enable easy highlighting of where problems are and what is causing them. I suggest at a minimum we probably want; * Lists - definately unordered, (maybe) ordered * Highlighting - <em> or <strong> (or something along those lines) * Links * (maybe) Tables The reasons we want each are; * Lists are used for displaying things like the test names which failed. * Highlighting is used to bring the eye to the important information. This could be a number which is not the expected valued (IE unexpected failures or flakes) or some other important part of text. Probably want "warning" and "failure" levels of highlighting. * Links are used to quickly take the user to the relevant "more information" page. In things like the layout test case they could be used to take you to the uploaded failure dashboard showing the specific test they click. In the flaky case they could be used to take a user to the flakiness dashboard showing the specific test. You want these links to be associated with the STEP_TEXT they are relevant too, so STEP_LINK isn't all that useful. * Tables are a great way to quickly show detailed information aligned in a way people understand. See examples. =============================== Here are some examples; ------- Total tests: 6 * Passed: 1 (1 expected, 0 unexpected) * Failed: 2 (2 expected, 0 unexpected) * Flaky: 3 (3 expected, 0 unexpected) ------- On the failure case; ------- Total tests: 6 * Passed: 1 (1 expected, 0 unexpected) * Failed: 2 (0 expected, >>>2 unexpected<<<) * Flaky: 3 (3 expected, 0 unexpected) Unexpected Failures: * bad/totally-bad-probably.html * tricky/totally-maybe-not-awesome.html ------- Bigger list of failures; ------- Total tests: 131 * Passed: 1 (1 expected, 0 unexpected) * Failed: 127 (0 expected, >>>127 unexpected<<<) * Flaky: 3 (0 expected, >>>3 unexpected<<<) Unexpected Failures: * bad/failing0.html <snip> * bad/failing27.html * bad/failing28.html * bad/failing29.html * ... 97 more ... Unexpected Flakes: * flake/slow.html * flake/timeout-then-crash.html * flake/totally-flakey.html ------- Table version; +-------------+-----------+-------------+--------+ | State | Expected | Unexpected | Total | +-------------+-----------+-------------+--------+ | Passing | 4 | 2 | 6 | | Failing | 8 | >> 1 <<< | 9 | | Flaking | 2 | 0 | 2 | +-------------+-----------+-------------+--------+ ===============================
,
Mar 23 2017
,
Mar 23 2017
I think this request is reasonable. We've considered Markdown. Although it is more secure, the problem is it is not compatible with Buildbot, which may complicate the transition. I think we could find a Go lib that sanitizes HTML.
,
Mar 23 2017
The great thing about Markdown is that it is human readable, hence it would still look okay if not rendered on BuildBot. It would also be suitable for including in plain text emails and other places. If we go with HTML, please use one of the SecOps approved libraries.
,
Mar 26 2017
I like the markdown idea. I'd like us to have a command line client for accessing build results and this would be compatible with that.
,
Mar 26 2017
Perhaps existing usage of step text is compatible with md because perhaps we use only <br>s and they are compatible with it
,
Mar 30 2017
I didn't find a GoogleSecurity-approved Go library for Markdown processing. In particular, https://github.com/russross/blackfriday is disapproved for untrusted input
,
Mar 30 2017
,
Apr 28 2017
Could I get a status update on this?
,
Apr 28 2017
this is p3 bug, we didn't do anything about this bug since #7 if you know a secure Markdown or HTML sanitization library in Go, please let us know. Absence of a good library is the primary blocker of this bug.
,
Apr 29 2017
We could use https://godoc.org/golang.org/x/net/html
,
May 1 2017
I am okay with rendering markdown (provided we find a approved library), but I object at supporting rendering arbitrary HTML because: * The amount of rendering "looks" we support becomes unbounded. What if someone throws in a style, expecting it to show up on the buildbot theme, which brings me to my next point * The buildbot theme is not meant to last forever. We do want to allow for future teams to create a completely different theme that isn't tied to how buildbot looks today. Allow arbitrary HTML will make that job significantly harder, if there are dependencies on how buildbot looks today * Markdown is constrained enough that this becomes less of an issue, since markdown could potentially work in any theme. * Allowing <img> tags is still probably a dumb idea, I hope no one actually does that.
,
May 1 2017
I don't think anyone suggested to support arbitrary HTML #11 implied a limited (very limited) HTML as the bug description specifies. In particular, I think the only HTML tags we may support is: ul, ol, li: no attributes strong, em: no attributes a: attributes "href" and "alt" table, tr, td: attributes "rowspan" and "colspan" Users input should not be able to control style. We will control the style of user-supplied rich text.
,
May 1 2017
<p> should be fine too Regardless of this discussion, we should limit width of step text.
,
May 1 2017
here, I wrote HTML sanitization package https://codereview.chromium.org/2849353002/
,
May 2 2017
We probably want some type of red (failure)/green (success)/yellow (warning)/purple (infra failure) coloring? Or maybe <span style="failure"> / <span style="success"> / etc....
,
May 2 2017
Predefined CSS classes sgtm
,
May 2 2017
I want to put in my vote for markdown since it will look good both rendered and as plain text. I hope that eventually we will have a milo command line client for accessing failing step data associated with a user's build and raw markdown will be readable but html won't.
,
May 2 2017
yeah, markdown would be great. It is just we don't have a secure lib to render it. Waiting for it and not implementing a limited set of HTML is an option too
,
May 4 2017
if we prefer markdown, we can essentially mitigate the problem by printing nicely looking markdown everywhere. In this case, Milo build pages immediately look OKish even without a markdown renderer (because markdown looks nice as is). And when we find a secure markdown lib in Go, Milo build pages will just become a bit nicer.
,
May 4 2017
I don't think we should use markdown for this. Markdown is a good language for humans to author text, but it's at best kinda awkward to generate programmatically, and it's fairly silly to have a machine generate markdown just to then convert it back into HTML. I also don't think this is an area where we should spend a lot of time customizing the step output; we should really be shooting for a world where things just all pass or don't (i.e., the webkit_tests complexity is something we should move away from, not embrace).
,
May 4 2017
BTW, it shouldn't be hard to render HTML tables/lists/paragraphs as text in terminal, given we already have an HTML parser
,
May 10 2017
The following revision refers to this bug: https://chromium.googlesource.com/external/github.com/luci/luci-go.git/+/e3b4c50fa889a3825db10a0eb87adf7bc0807cb3 commit e3b4c50fa889a3825db10a0eb87adf7bc0807cb3 Author: nodir <nodir@chromium.org> Date: Wed May 10 17:19:11 2017 sanitizehtml: add a package to sanitize HTML It is based on an existing HTML parser in golang.org/x/net/html. The motivation is to support user-supplied HTML in step_text in Milo. R=dnj@chromium.org, vadimsh@chromium.org BUG=704387 Review-Url: https://codereview.chromium.org/2849353002 [add] https://crrev.com/e3b4c50fa889a3825db10a0eb87adf7bc0807cb3/common/data/text/sanitizehtml/sanitize.go [add] https://crrev.com/e3b4c50fa889a3825db10a0eb87adf7bc0807cb3/common/data/text/sanitizehtml/sanitize_test.go
,
May 10 2017
The following revision refers to this bug: https://chromium.googlesource.com/external/github.com/luci/luci-go.git/+/67031d2b5cda2e5a7342fd218917d6d5c61ce389 commit 67031d2b5cda2e5a7342fd218917d6d5c61ce389 Author: nodir <nodir@chromium.org> Date: Wed May 10 19:51:25 2017 sanitizehtml: disallow tables It is not trivial to control presentation of tables. In particular, tables do not honor ancestor node boundaries. Disallow them for now. R=hinoka@chromium.org BUG=704387 Review-Url: https://codereview.chromium.org/2873983003 [modify] https://crrev.com/67031d2b5cda2e5a7342fd218917d6d5c61ce389/common/data/text/sanitizehtml/sanitize.go [modify] https://crrev.com/67031d2b5cda2e5a7342fd218917d6d5c61ce389/common/data/text/sanitizehtml/sanitize_test.go
,
Jul 31 2017
Hi nodir@ and hinoka@, What is the status of this bug? It looks like there is some progress with the sanitizehtml stuff? It also looks like you have disabled tables, which is one feature that would have been super useful in my examples above... I also believe phosek@ is after some similar features for some of the work he is doing. Tim 'mithro' Ansell
,
Aug 11 2017
the status is there is not enough consensus on our team about this bug. I am fine with rendering sanitized HTML in step text. This will at least solve the problem that currently LUCI builds with webkit failures look terrible: https://ci.chromium.org/swarming/task/37ec3b2785898d10, look at the width there. I think hinoka@ and estaab@ are on the fence. The tables were disabled because it is hard to control their presentation via CSS. E.g. we cannot limit their bounds. I think phosek@ needs to render large amount of HTML which we cannot allow on a build page, so fixing this bug probably won't help them.
,
Aug 11 2017
nodir@, we only need hyperlinks actually.
,
Aug 11 2017
recipe engine already has API for links: https://cs.chromium.org/search/?q=presentation.links&sq=package:chromium&type=cs
,
Aug 11 2017
I just realized this bug is only for Milo output, what we really need is support for HTML in LogDog's web viewer. I'll file a separate bug for that.
,
Sep 28 2017
,
Oct 1
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue. Sorry for the inconvenience if the bug really should have been left as Available. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Oct 1
the new protocol supports Markdown https://chromium.googlesource.com/infra/luci/luci-go/+/b4019a5efec0c7b2890bb5a7c5c8b2036ccdd9d5/buildbucket/proto/step.proto#91 Milo doesn't use it yet, that's bug 850113.
,
Oct 1
|
||||||||||
►
Sign in to add a comment |
||||||||||
Comment 1 by tansell@chromium.org
, Mar 23 2017