Skip to content

test: add homepage performance checks - #1355

Draft
jderochervlk wants to merge 22 commits into
masterfrom
test/homepage-performance-guardrails
Draft

jderochervlk wants to merge 22 commits into
masterfrom
test/homepage-performance-guardrails

Conversation

@jderochervlk

@jderochervlk jderochervlk commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

Context

Establish regression coverage before the homepage performance stack changes component boundaries, images, route payloads, CSS, effects, and compiler behavior. Relates to #1354.

Changes

  • add production-build Cypress coverage for prerendering, hydration, navigation, clipboard behavior, and image loading
  • use a supported data-cy-bootstrap hydration slot for Cypress startup coordination
  • run Lighthouse and deployed Cypress E2E independently after the Cloudflare Pages deployment
  • report JavaScript, CSS, and media referenced by the built HTML as an informational view of initial page assets, while still failing for missing referenced files
  • document that the asset report is complementary to browser measurements and does not enforce size thresholds
  • keep new Cypress and Vitest tests in ReScript while leaving existing Node-focused .mjs scripts in place
  • retain one current Lighthouse artifact per branch and compare each PR with its target branch baseline, reporting N/A when no target baseline exists
  • cover Lighthouse environment, restore, cleanup, report, and failure behavior in ReScript tests under Vitest Node

Existing slug-only Lighthouse artifacts are not reused. Each target branch will initially show N/A until it publishes its first artifact under the new key; old artifacts expire under their existing retention policy.

Full-stack Lighthouse comparison

Mobile reports for the complete homepage performance stack:

@jderochervlk

Copy link
Copy Markdown
Collaborator Author

@codex

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 18, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-20T01:44:55.792257Z f95ba67 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 282b282781

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@github-actions

github-actions Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Lighthouse baseline

No Lighthouse baseline is available for target branch master. Scores are the median of 3 runs against the deployed Cloudflare preview.

Category Target Current Change
Performance N/A 86 N/A
Accessibility N/A 74 N/A
Best practices N/A 100 N/A
SEO N/A 50 N/A

Download the full Lighthouse reports and baseline

Commit 7d2737e · Cloudflare preview

Add production Playwright coverage for prerendering, hydration, navigation, clipboard behavior, and image loading. Track initial asset, DOM, and media baselines in CI before the homepage optimization stack changes them.
Align the Playwright container and deterministic homepage budgets with the React Router, Vite, and Playwright versions now on master.
Run the production prerender build on the standard Ubuntu runner and install Chromium explicitly, avoiding the React Router temporary-server failure inside the Playwright job container.
Run Lighthouse three times against the exact Cloudflare Pages deployment URL and enforce conservative category and Core Web Vitals baselines. Upload the generated reports as workflow artifacts for inspection.
Persist a branch-scoped Lighthouse baseline with the full reports, restore it on the next deployment, and publish a sticky PR comparison comment with a direct artifact link. Cancel stale branch deploys and remove superseded artifacts so each branch retains one current baseline.
Continue collecting and comparing Lighthouse results without failing the performance stack while the homepage optimizations are still in progress.
Restore the Lighthouse artifact for each pull request's base branch instead of the previous artifact from its head branch. Report missing target baselines as N/A so the first stack layer can establish the initial baseline without implying a zero score.
Query the pull request API when selecting the Lighthouse target artifact so stacked pull requests compare against their current base branch even when the workflow event payload is stale.
Move branch setup, target baseline restoration, and artifact cleanup out of deploy.yml. Exercise each script through isolated GitHub CLI boundary tests, including API failures and missing baselines.

Addresses PR #1355 discussion_r4054814175.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1c9d4699f8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/scripts/lighthouse-cleanup.sh
Comment thread apps/docs/e2e-playwright/homepage.spec.mjs Outdated
Preserve prerendering, strict hydration, navigation, image, and real clipboard coverage using the existing Cypress runner. Keep Vitest's Playwright provider unchanged and test the isolated Cypress bootstrap cleanup.

Addresses PR #1355 review comment 4054821928.
Re-query the target artifact after download 404/410 responses, with three bounded attempts and N/A when no baseline remains. Preserve all other API and archive failures. Add restore race and failure regression coverage for PR #1355 review comment 4054919822.
Split deployment URL setup from Lighthouse baseline metadata and let both checks consume the deployment output directly.
Remove bundle and DOM budgets while retaining measurements and missing-asset checks. Document the limits of the HTML-referenced asset report.
Move the new homepage and Lighthouse tests into a separate Node Vitest configuration without migrating the existing Node script implementations.
Keep the user navigation checks without treating a single opacity value as a route styling contract.
Compile the homepage specs to JSX with typed Cypress bindings and retain prerendering, navigation, image loading, and clipboard assertions.
Replace custom injected-node removal with a stable script slot and a text placeholder. Assert slot usage while continuing to fail on application hydration and console errors.
Compute the stable production or preview URL inside each post-deploy job instead of passing the Wrangler URL through a redacted job output. Keep Lighthouse and Cypress independent after deployment and cover both URL forms in the script tests.
Provide a fake unzip executable in the ReScript workflow fixture and assert the restore script's invocation. This keeps the test focused on the shell contract without requiring unzip in the Vitest Playwright container.
@jderochervlk jderochervlk changed the title test: add homepage performance guardrails test: add homepage performance checks Sep 20, 2026
@jderochervlk

Copy link
Copy Markdown
Collaborator Author

@codex

Comment thread .github/scripts/deployment-environment.sh

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f95ba673b4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/scripts/deployment-environment.sh Outdated
Document the deployment, Cypress server, and Lighthouse helper contracts so their workflow responsibilities are clear.
Keep a readable branch prefix while appending a digest of the full raw name, and cover normalization and truncation collisions.
@github-actions

Copy link
Copy Markdown
Contributor

Docs preview

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.

1 participant