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

Add Lighthouse-CI #5492 #5521

Closed
wants to merge 50 commits into from
Closed

Conversation

Chandupuram
Copy link

@Chandupuram Chandupuram commented Jul 16, 2023

Description

This PR consists of the infra setup for the Lighthouse CI for this project. This helps us to check and monitor the performance of the pages and various statistics after each and every push done to the repo.

Related Issues

Add Lighthouse-CI #5492

Check List

  • I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • I have run npx turbo lint to ensure the code follows the style guide. And run npx turbo lint:fix to fix the style errors if necessary.
  • I have run npx turbo format to ensure the code follows the style guide.
  • I have run npx turbo test to check if all tests are passing, and/or npx turbo test:snapshot to update snapshots if I created and/or updated React Components.
  • I've covered new added functionality with unit tests if necessary.

@ovflowd
Copy link
Member

ovflowd commented Jul 16, 2023

I also share the views fo @bmuenzenmeyer is there any test repository or fork you've enabled this so we can see the results?

Also, how does this PR achieves . This helps us to check and monitor the performance of the pages and various statistics after each and every push done to the repo. from your PR description?

Could you describe how we are able to actually get the insights and analysis? Is the bot/CI supposed to comment on the PR or what?

@Chandupuram
Copy link
Author

Chandupuram commented Jul 16, 2023

  1. I wonder if anyone else thinks this functionality should exist in this file as a separate workflow, or integrate into one of the existing ones at https://github.com/nodejs/nodejs.org/tree/main/.github/workflows. I can see both ways making sense, and not clear precedent. build-and-analysis is rather new.
  2. do you have validation from your fork that we can look at?

https://github.com/Chandupuram/nodejs.org/pull/2
Report for /about page: https://storage.googleapis.com/lighthouse-infrastructure.appspot.com/reports/1689488571961-82303.report.html
look at this PR commits and the detail reports generated by LightHouse CI

@ovflowd
Copy link
Member

ovflowd commented Jul 16, 2023

look at this PR commits and the detail reports generated by LightHouse CI

It's kinda annoying that Lighthouse generates one status-check per page. As I mentioned we probably would like to generate reports for each major page, but that seems probably not feasible. What bothers me is how these scores are so low, when I see these when running Lighthouse by myself 🤔

image

I was genuinely looking forward to something like this: https://github.com/OskarAhl/Lighthouse-github-action-comment, but not sure if this creates a new comment on every run or what.

I also wonder where are the custom settings/thresholds at? Did you configure them somewhere? I don't see that in this PR.

@ovflowd

This comment was marked as resolved.

@bmuenzenmeyer

This comment was marked as resolved.

@Chandupuram

This comment was marked as resolved.

@bmuenzenmeyer
Copy link
Collaborator

bmuenzenmeyer commented Jul 17, 2023

@Chandupuram my initial notes and suggested tooling were not clear enough and that's led us down an incorrect path for a bit.

as stated in earlier review, lets make sure to:

@ovflowd
Copy link
Member

ovflowd commented Jul 17, 2023

It will run against the local development not for the nodejs.org. The thresholds we were using were the Lighthouse CI recommended values. You can check the assert part in .json file.

Are we sure about that? What does the "URL" field then even mean? How can it run against the local environment / current running-CI if no web server is running? That doesn't sound correct to me.

@ovflowd
Copy link
Member

ovflowd commented Jul 17, 2023

At this point, @ovflowd I like the idea of leaning on a tool we dont have to maintain. are you okay with treosh/lighthouse-ci-action ?

Is this still a recommendation?

@vercel vercel bot temporarily deployed to Preview – nodejs-org-stories July 19, 2023 10:01 Inactive
@vercel vercel bot temporarily deployed to Preview – nodejs-org July 19, 2023 10:02 Inactive
@vercel vercel bot temporarily deployed to Preview – nodejs-org-stories July 20, 2023 01:58 Inactive
@vercel vercel bot temporarily deployed to Preview – nodejs-org July 20, 2023 01:59 Inactive
@bmuenzenmeyer
Copy link
Collaborator

bmuenzenmeyer commented Jul 22, 2023

Here's what I think we should do.

Let's first clear up requirements:


@Chandupuram do you feel up for this pivot? If I don't hear from one in a couple days I will start it

@Chandupuram
Copy link
Author

Chandupuram commented Jul 23, 2023

I think you can start working on this @bmuenzenmeyer

@vercel vercel bot temporarily deployed to Preview – nodejs-org July 23, 2023 04:25 Inactive
@vercel vercel bot temporarily deployed to Preview – nodejs-org-stories July 23, 2023 04:26 Inactive
`*Lighthouse ran on [${Object.keys(links)[0]}](${Object.keys(links)[0]})*`
].join('\n')

core.setOutput("comment", comment);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The indentation of this line is wrong.

@vercel vercel bot temporarily deployed to Preview – nodejs-org July 23, 2023 13:36 Inactive
@vercel vercel bot temporarily deployed to Preview – nodejs-org-stories July 23, 2023 13:37 Inactive
@@ -0,0 +1,71 @@
name: Google Lighthouse

on:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this is correct, I believe the on here should be of pull_request, since this should be updated on every Pull Request.

id: loading_comment_to_pr
uses: marocchino/sticky-pull-request-comment@v2
with:
GITHUB_TOKEN: ${{ secrets.LIGHTHOUSE_APP_TOKEN }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be set. By default it will use GITHUB_TOKEN which is already an Environment Variable

@bmuenzenmeyer
Copy link
Collaborator

I think you can start working on this @bmuenzenmeyer

citing the above, we will be closing this to take another run at it in the future

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

Successfully merging this pull request may close these issues.

3 participants