GoogleChromeLabs / lighthousebot

Run Lighthouse in CI, as a web service, using Docker. Pass/Fail GH pull requests.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Proposal: Add link to the report in the bot comment

abdonrd opened this issue · comments

It would be great if the bot comment had a link to the report.

From:

Updated Lighthouse report for the changes in this PR:

Category Score
Progressive Web App 91
Performance 93
Accessibility 100
Best Practices 92

Tested with Lighthouse version: 2.3.0

To:

Updated Lighthouse report for the changes in this PR:

Category Score
Progressive Web App 91
Performance 93
Accessibility 100
Best Practices 92

Tested with Lighthouse version: 2.3.0

Good call. Want to send a PR?

@ebidel btw, what's the retention policy for these reports ? how long are they going to be available ?

There's no guarantees on uptime, retention, or reports being available, long-term. I suggest running your own setup if that's something important to you :)

Is there any progress on this?

@ebidel I'm interested in making a PR for this, but I'd love some insights 🙂

So we can generate the html file by passing output: html:

curl -X POST \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: [secret]" \
  --data '{"output": "html", "url": "https://developers.google.com/web/tools/lighthouse/"}' \
  https://builder-dot-lighthouse-ci.appspot.com/ci

One thing we could do is add a flag in the request to /ci that would only send back the generated fileName (timestamp-based) so we can add the URL to the comment.

This can be done in runLH:

function runLH(params, req, res, next) {

Hey @robinmetral @balazsorban44 @abdonrd

lighthouse-keeper uploads not only full html reports but also keeps track of how metrics change between PR. You should check it out!

@krzkaczor thanks, I'll take a look! 😃