treosh / lighthouse-ci-action

Audit URLs using Lighthouse and test performance with Lighthouse CI.
MIT License
1.16k stars 82 forks source link

feature request: report results as a PR comment? #17

Closed ooloth closed 4 years ago

ooloth commented 4 years ago

Thanks for this project!

Would it be possible to see the results of each Lighthouse audit as a comment on the PR (similar to the behaviour of the deprecated lighthousebot project)?

robinmetral commented 4 years ago

FYI, the Typescript website repo has something like this set up using a Danger plugin, danger-plugin-lighthouse (by @orta).

It looks like this:

source: https://github.com/microsoft/TypeScript-Website/pull/121
Screenshot_2019-11-25 Fill out the TS Config reference by orta · Pull Request #121 · microsoft TypeScript-Website

I agree that it would be nice to make this possible in this action without a Danger dep :slightly_smiling_face:

orta commented 4 years ago

Yeah, I think might be able to provide some text inside inside a GitHub check (Danger has this as a feature).

I found it a particularly weak use-case for anything which isn't an obvious hard pass/fail though because no one will click through to see the results if it's not blocking their way. Via an GH action you don't have enough auth to write a comment though, so it probably is the best option.

That said - if you do, I'd love to share ideas on the results JSON -> markdown rendering

exterkamp commented 4 years ago

That said - if you do, I'd love to share ideas on the results JSON -> markdown rendering

We have been playing with the idea of using the markdown results of the check as output here #2. But since this is an action it is a bit limited vs. a full app on what we can do in the action native status, we basically have to post a new status.

Via an GH action you don't have enough auth to write a comment though

We can get a client to do git stuff, like post statuses and I think comments with the octokit client via pulls.createComment

paulirish commented 4 years ago

Please also see https://github.com/treosh/lighthouse-ci-action/issues/2#issuecomment-558395025 where I summarized some of the options we have.

alekseykulikov commented 4 years ago

From our experience, a comment for each PR provides more noise, than value. To track the history, it's better to use LHCI Server. If the tests fail, the action uses annotations https://github.com/treosh/lighthouse-ci-action/issues/2#issuecomment-601456805