Skip to content

Conversation

@codeunia-dev
Copy link
Owner

@codeunia-dev codeunia-dev commented Sep 6, 2025

πŸ”§ Lighthouse CI improvements:

  1. βœ… Extended server ready timeout from 30s to 120s (2 minutes)
  2. βœ… Enhanced ready pattern to match multiple Next.js startup messages
  3. βœ… Added additional Chrome flags for CI environment stability
  4. βœ… Reduced number of runs from 3 to 1 for faster CI execution
  5. βœ… Better error handling for server startup issues

🎯 Root cause fixes:

  • Server timeout issues in CI environment
  • Chrome interstitial errors due to server not being ready
  • Improved pattern matching for Next.js startup messages

This should resolve the 'Chrome prevented page load with an interstitial' errors.

Summary by CodeRabbit

  • New Features

    • None
  • Bug Fixes

    • Improved server readiness detection for Lighthouse audits to recognize multiple startup messages.
  • Chores

    • Increased server startup timeout for audits to reduce flakes.
    • Reduced Lighthouse audit runs from 3 to 1 to speed up execution.
    • Expanded Chrome launch flags (added GPU-disable and other compatibility flags).
  • Tests

    • Stabilized Lighthouse audit configuration to produce more reliable results.

πŸ”§ Lighthouse CI improvements:
1. βœ… Extended server ready timeout from 30s to 120s (2 minutes)
2. βœ… Enhanced ready pattern to match multiple Next.js startup messages
3. βœ… Added additional Chrome flags for CI environment stability
4. βœ… Reduced number of runs from 3 to 1 for faster CI execution
5. βœ… Better error handling for server startup issues

🎯 Root cause fixes:
- Server timeout issues in CI environment
- Chrome interstitial errors due to server not being ready
- Improved pattern matching for Next.js startup messages

This should resolve the 'Chrome prevented page load with an interstitial' errors.
@vercel
Copy link

vercel bot commented Sep 6, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
codeunia Ready Ready Preview Comment Sep 6, 2025 11:28am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 6, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Broadened Lighthouse CI readiness regex, increased server startup timeout to 120000 ms, reduced Lighthouse runs to 1, and added --disable-gpu to Chrome flags in lighthouserc.js. Other configuration sections remain unchanged.

Changes

Cohort / File(s) Summary of Changes
Lighthouse CI config
lighthouserc.js
- startServerReadyPattern: from ready on β†’ Ready in|ready on|Local:
- startServerReadyTimeout: 30000 β†’ 120000 ms
- numberOfRuns: 3 β†’ 1
- chromeFlags: appended --disable-gpu (retains --no-sandbox, --disable-dev-shm-usage)
- Other properties (URLs, startServerCommand, presets, assertions, upload target) unchanged

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Runner as CLI Runner
  participant Server as Test Server
  participant Lighthouse as Lighthouse
  participant Upload as Upload Target

  Runner->>Server: execute startServerCommand
  Note over Runner,Server: Wait for readiness pattern: "Ready in" | "ready on" | "Local:"
  alt Ready before 120s
    Server-->>Runner: readiness match
    Runner->>Lighthouse: run audit (numberOfRuns=1, chromeFlags include --disable-gpu)
    Lighthouse-->>Runner: results
    Runner->>Upload: upload results
  else Timeout (>=120s)
    Server-->>Runner: no readiness match
    Runner-->>Runner: abort due to timeout
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

A rabbit spies the server light,
It waits and twitches through the night.
One run, no GPU to race,
Patterns broaden, timeout's space.
Reports hop in β€” soft and bright. πŸ‡βœ¨


πŸ“œ Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between af8dcad and ddf0da4.

πŸ“’ Files selected for processing (1)
  • lighthouserc.js (1 hunks)
✨ Finishing Touches
  • πŸ“ Generate Docstrings
πŸ§ͺ Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch production-readiness-improvements

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (2)
lighthouserc.js (2)

14-14: Timeout counts the build step; decouple build from start or bump further.

Because startServerCommand also runs the build, 120s can still be tight on CI. Prefer building earlier and only starting here; otherwise increase the timeout.

Option A (preferred) β€” move build out of LHCI and only start the server:

-      startServerCommand: 'npm run build && npm run start',
+      startServerCommand: 'npm run start',

Option B β€” keep as-is but give more headroom:

-      startServerReadyTimeout: 120000,
+      startServerReadyTimeout: 300000,

15-15: Single run increases metric variance; consider 2–3 runs or relax thresholds.

Going from 3β†’1 speeds CI but may cause flaky assertion failures. If you keep 1 run, consider slightly relaxing perf thresholds; otherwise set 2 for a compromise.

Apply this if you want a middle ground:

-      numberOfRuns: 1,
+      numberOfRuns: 2,
πŸ“œ Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 3cbaa52 and af8dcad.

πŸ“’ Files selected for processing (1)
  • lighthouserc.js (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Test Suite

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@codeunia-dev codeunia-dev merged commit 816b17c into main Sep 6, 2025
2 of 4 checks passed
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.

2 participants