Skip to content

Conversation

@codeunia-dev
Copy link
Owner

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

πŸ”§ Additional fixes:

  1. βœ… Lighthouse CI build issue - Updated startServerCommand to include 'npm run build && npm run start'
  2. βœ… GitHub token issue - Added GITHUB_TOKEN environment variable for Lighthouse CI
  3. βœ… Build sequence - Ensures Next.js app is built before starting for Lighthouse CI

🎯 Root cause fixes:

  • Lighthouse CI was trying to start server without building first
  • Missing GITHUB_TOKEN for Lighthouse CI GitHub integration
  • Build and start sequence now properly configured

This should resolve both the 'Could not find production build' and 'GitHub token not set' errors.

Summary by CodeRabbit

  • New Features

    • None
  • Bug Fixes

    • None
  • Chores

    • Improved performance monitoring by enhancing CI authentication for Lighthouse runs, increasing stability and reducing audit failures.
    • Adjusted Lighthouse collection to build the app before starting the server, aligning audits with production-ready assets for more accurate performance metrics and comparisons.
    • Enhances reliability of CI signals and consistency of performance reports without affecting user-facing functionality.

πŸ”§ Additional fixes:
1. βœ… Lighthouse CI build issue - Updated startServerCommand to include 'npm run build && npm run start'
2. βœ… GitHub token issue - Added GITHUB_TOKEN environment variable for Lighthouse CI
3. βœ… Build sequence - Ensures Next.js app is built before starting for Lighthouse CI

🎯 Root cause fixes:
- Lighthouse CI was trying to start server without building first
- Missing GITHUB_TOKEN for Lighthouse CI GitHub integration
- Build and start sequence now properly configured

This should resolve both the 'Could not find production build' and 'GitHub token not set' 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 Building Building Preview Comment Sep 6, 2025 10:54am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 6, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

CI workflow updated to expose GITHUB_TOKEN to the Lighthouse CI step. Lighthouse configuration now builds the app before starting the server during collection by changing startServerCommand to run a build then start.

Changes

Cohort / File(s) Summary
CI Workflow (Performance Monitoring env)
.github/workflows/ci-cd.yml
Added env variable GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} to the Lighthouse CI step alongside existing LHCI_GITHUB_APP_TOKEN and LHCI_TOKEN. No other steps or logic changed.
Lighthouse CI Config (server startup)
lighthouserc.js
Updated collect.startServerCommand from npm run start to npm run build && npm run start; other config fields unchanged.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Dev as Developer
  participant GH as GitHub Actions (CI)
  participant Build as Build step (npm run build)
  participant App as App Server (npm run start)
  participant LH as Lighthouse CI
  participant GHAPI as GitHub API

  Dev->>GH: Push/PR triggers Performance Monitoring job
  GH->>LH: Run LHCI with env\nGITHUB_TOKEN, LHCI_GITHUB_APP_TOKEN, LHCI_TOKEN
  Note over GH,LH: Collect phase startServerCommand
  GH->>Build: npm run build
  Build-->>GH: Build artifacts ready
  GH->>App: npm run start
  App-->>GH: Server listening
  GH->>LH: lhci collect/audit
  LH-->>GH: Results (reports, assertions)
  GH->>GHAPI: Authenticate using GITHUB_TOKEN (if needed)
  GH-->>Dev: Job completes with LHCI results
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I built before I sprang to run,
A token packed, the job’s begun.
Lighthouse beams across the night,
CI hums in steady light.
Thump-thumpβ€”my paws approve the flow,
Reports hop in; we’re good to go! πŸ‡βœ¨


πŸ“œ 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 fcf93cc and a595a80.

πŸ“’ Files selected for processing (2)
  • .github/workflows/ci-cd.yml (1 hunks)
  • 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.

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