Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSV and excel reporters for CI #63

Closed
dit7ya opened this issue May 9, 2023 · 8 comments
Closed

CSV and excel reporters for CI #63

dit7ya opened this issue May 9, 2023 · 8 comments
Labels
enhancement New feature or request

Comments

@dit7ya
Copy link

dit7ya commented May 9, 2023

Clear and concise description of the problem

I would like to use the results of the the Lighthouse scan in CI to automatically comment on PRs with the scores. The static HTML is great, but just having the main scores as output of the CLI program will be awesome.

This action has some examples - https://github.com/foo-software/lighthouse-check-action

Suggested solution

I would imagine a flag --output-scores that saves a scores.json file. For the actual implementation, I am not sure how to achieve it.

Alternative

No response

Additional context

No response

@dit7ya dit7ya added the enhancement New feature or request label May 9, 2023
@mgifford
Copy link

I'd prefer a CSV, but whatever. Both can be good.

I like the output from https://github.com/cloudfour/lighthouse-parade

@harlan-zw
Copy link
Owner

harlan-zw commented May 10, 2023

Thanks for the references, it's a good idea. Will work on this when I have some free time. PRs very much welcome in the mean time.

FYI running the unlighthouse-ci will output a JSON file will all scores.

@briantully
Copy link

briantully commented May 15, 2023

Great to hear that the data/scores may be exported easily, especially for those of us that may want a historical perspective when publishing new releases to see if any areas have regression in score.
In terms of the data format -- perhaps we can integrate with jq (https://github.com/stedolan/jq) or node-jq to convert from JSON to CSV, or at least mention it in the docs somewhere, as I'd expect CSV would be more flexible/useful as a reference/comparison format

@dit7ya
Copy link
Author

dit7ya commented May 16, 2023

Just pointing out that I have nothing against CSV and mentioned JSON just as an example format in the OP.

@mgifford
Copy link

CSV is just easier to import into a spreadsheet, which is how many of these reports are going to need to be processed. 

Great about unlighthouse-ci - when I try to run it though I get:

% npx unlighthouse-ci --site https://www.example.com
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/unlighthouse-ci - Not found
npm ERR! 404
npm ERR! 404  'unlighthouse-ci@*' is not in this registry.
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

@mgifford
Copy link

Never mind. It's working when I RTFM https://unlighthouse.dev/integrations/ci

@harlan-zw harlan-zw changed the title Allow concise and structured output of the Lighthouse results CSV and excel reporters for CI May 22, 2023
@harlan-zw
Copy link
Owner

I think there are two issues here:

  1. More advanced reporters, currently we only have two, see https://unlighthouse.dev/integrations/ci#reporting. Ideally a CSV and excel format would be supported
  2. A GitHub action to compare results from these reports. I haven't made a GitHub action before so i think this is a bit further out of scope and would be covered by a seperate repo. I'm guessing it would need some sort of cloud storage for the reports?

For now I've updated this issue to just cover issue 1. Feel free to make a separate issue for the GitHub action if it's more appropriate

@harlan-zw
Copy link
Owner

harlan-zw commented Jun 16, 2023

CSV is now supported in v0.9.0, have moved GitHub Action Support to this issue.

Please let me know you're feedback, will look to improve it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants