New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 704387 link

Starred by 3 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: 3
NextAction: ----
OS: ----
Pri: 3
Type: Feature

Blocked on:
issue 850113
issue 670172

Blocking:
issue 704394
issue 769859



Sign in to add a comment

Milo should support limited HTML output (or maybe markdown?) in STEP_TEXT output

Project Member Reported by tansell@chromium.org, Mar 23 2017

Issue description

The 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    |
+-------------+-----------+-------------+--------+

===============================

 
Blockedon: 670172
Blocking: 704394

Comment 3 by no...@chromium.org, Mar 23 2017

EstimatedDays: 3
Labels: luci
Status: Available (was: Untriaged)
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.
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.

Comment 5 by estaab@chromium.org, 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.

Comment 6 by no...@chromium.org, 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

Comment 7 by no...@chromium.org, 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
Cc: -serg...@chromium.org
Could I get a status update on this?

Comment 10 by no...@chromium.org, 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.
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.
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.
<p> should be fine too

Regardless of this discussion, we should limit width of step text.
here, I wrote HTML sanitization package https://codereview.chromium.org/2849353002/
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....
Predefined CSS classes sgtm
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.
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
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.
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).
BTW, it shouldn't be hard to render HTML tables/lists/paragraphs as text in terminal, given we already have an HTML parser
Project Member

Comment 24 by bugdroid1@chromium.org, 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

Cc: phosek@chromium.org hinoka@chromium.org no...@chromium.org
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

Comment 26 by no...@chromium.org, Aug 11 2017

Cc: estaab@chromium.org
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.
nodir@, we only need hyperlinks actually.

Comment 28 by no...@chromium.org, Aug 11 2017

recipe engine already has API for links: https://cs.chromium.org/search/?q=presentation.links&sq=package:chromium&type=cs
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.

Comment 30 by no...@chromium.org, Sep 28 2017

Blocking: 769859
Project Member

Comment 31 by sheriffbot@chromium.org, Oct 1

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
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
Status: Available (was: Untriaged)

Sign in to add a comment