Skip to content

Conversation

Isabella-Mitchell
Copy link
Contributor

@Isabella-Mitchell Isabella-Mitchell commented Oct 17, 2025

Resolves JIRA: https://bbc.atlassian.net/browse/WS-1280

Summary

Updates lighthouse to latest version and adds as dev dependency.

Code changes

Follows steps on ticket:

  • Add lighthouse as a dev dependency (so that it can be updated via dependabot) by running yarn add lighthouse --dev
  • Update lighthouseRun script (remove npx [email protected] & just call lighthouse)
  • Remove dockerfile (doesn't seem to be used by anything
  • Updates article localhost following NextJS migration (oops 😬)
  • Updates article asset to WS asset and requires Lighthouse budget so that tests pass 😬
  • Remove third-parties-cookies audit from config and lighthouserc since this caused anything lighthouse 11.4.0 and up to fail.

Two follow up tickets:

Developer Checklist

  • UX
    • UX Criteria met (visual UX & screenreader UX)
  • Accessibility
    • Accessibility Acceptance Criteria met
    • Accessibility swarm completed
    • Component Health updated
    • P1 accessibility bugs resolved
    • P2/P3 accessibility bugs planned (if not resolved)
  • Security
    • Security issues addressed
    • Threat Model updated
  • Documentation
    • Docs updated (runbook, READMEs)
  • Testing
    • Feature tested on relevant environments
  • Comms
    • Relevant parties notified of changes

Testing

  • Manual Testing required?
    • Local (Ready-For-Test, Local)
    • Test (Ready-For-Test, Test)
    • Preview (Ready-For-Test, Preview)
    • Live (Ready-For-Test, Live)
  • Manual Testing complete?
    • Local
    • Test
    • Preview
    • Live

Additional Testing Steps

  1. Tested Lighthouse tests pass locally
  2. Checked Lighthouse tests pass on Github checks

Useful Links

@Isabella-Mitchell Isabella-Mitchell marked this pull request as ready for review October 17, 2025 09:25
@Isabella-Mitchell Isabella-Mitchell requested a review from a team as a code owner October 17, 2025 09:25
npx -p [email protected] lighthouse http://localhost:7081/pidgin/live/c07zr0zwjnnt --chrome-flags="--no-sandbox --headless --disable-gpu" --output json --output html --output-path simorgh --config-path scripts/lighthouseConfig.js && node scripts/lighthouseBudget.js run
npx -p [email protected] lighthouse http://localhost:7081/mundo/send/u50853489 --chrome-flags="--no-sandbox --headless --disable-gpu" --output json --output html --output-path simorgh --config-path scripts/lighthouseConfig.js && node scripts/lighthouseBudget.js run
npx -p [email protected] lighthouse http://localhost:7081/somali/send/u130092370 --chrome-flags="--no-sandbox --headless --disable-gpu" --output json --output html --output-path simorgh --config-path scripts/lighthouseConfig.js && node scripts/lighthouseBudget.js run
lighthouse http://localhost:7081/news/articles/cn7k01xp8kxo --chrome-flags="--no-sandbox --headless --disable-gpu" --output json --output html --output-path simorgh --config-path scripts/lighthouseConfig.js && node scripts/lighthouseBudget.js run
Copy link
Contributor

Choose a reason for hiding this comment

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

I am wondering if we should use one of our own articles as an example - rather than news? Perhaps one with a lot of content?

npx -p [email protected] lighthouse http://localhost:7081/pidgin/live/c07zr0zwjnnt --chrome-flags="--no-sandbox --headless --disable-gpu" --output json --output html --output-path simorgh --config-path scripts/lighthouseConfig.js && node scripts/lighthouseBudget.js run
npx -p [email protected] lighthouse http://localhost:7081/mundo/send/u50853489 --chrome-flags="--no-sandbox --headless --disable-gpu" --output json --output html --output-path simorgh --config-path scripts/lighthouseConfig.js && node scripts/lighthouseBudget.js run
npx -p [email protected] lighthouse http://localhost:7081/somali/send/u130092370 --chrome-flags="--no-sandbox --headless --disable-gpu" --output json --output html --output-path simorgh --config-path scripts/lighthouseConfig.js && node scripts/lighthouseBudget.js run
lighthouse http://localhost:7081/pidgin/articles/cwl08rd38l6o --chrome-flags="--no-sandbox --headless --disable-gpu" --output json --output html --output-path simorgh --config-path scripts/lighthouseConfig.js && node scripts/lighthouseBudget.js run
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we use either of these, which were "real" articles, and more representative than this test article?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep http://localhost:7081/pidgin/articles/ce9wk6glg4lo is one I was considering - only issue is that it\s 'bestPractises' score comes in at 88 not 90 - and so it fails. Am I ok to lower the Lighthouse budget?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, we can lower the budget (do we know why it has dropped?)

I think we probably do need to look at these issues, and create tickets to tackle them in the future

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes can create tickets - and no I don't know why it dropped - I'm having real issues recreating the issues on Github actions locally - all the assets I tried pass locally. But some get a lower score fail on Github actions.

It is possible to upload an "workflow artifact" with a github action run, which may allow us to deep dive into the results.

It may be significant to we have much lower pass margins for our Lighthouse tests on Test and Live.

Copy link
Contributor

@karinathomasbbc karinathomasbbc Oct 22, 2025

Choose a reason for hiding this comment

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

Are you running NextJS in production mode (i.e. yarn build; yarn start instead of yarn dev - as this is how we start up the application servers on CI).

Yes, I had also been thinking that being able to see the output would be useful - if it's not a huge scope creep could we look into adding it as part of this ticket?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes - running in production mode. Also tried using the command that's used in the runner.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh that's weird & annoying. Then I guess we need to see the output of the file - unless there's a command line thing we can add to make it output the issues to the console instead of to a file?

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