Skip to content

Conversation

@codeunia-dev
Copy link
Owner

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

  • Add Chrome setup step using browser-actions/setup-chrome@v1
  • Simplify Lighthouse CI command to use existing lighthouserc.js config
  • Update lighthouserc.js to use warn-level assertions with realistic thresholds
  • Remove long CLI flags in favor of maintainable config file approach
  • Ensures Chrome availability and prevents flaky CI failures

Summary by CodeRabbit

  • Chores
    • Ensured Chrome is available during Lighthouse audits to improve CI reliability.
    • Simplified Lighthouse CI execution for more maintainable audit runs.
    • Converted Lighthouse assertions from failures to warnings and relaxed thresholds across performance, accessibility, best practices, and SEO metrics, reducing false failures while maintaining visibility into issues.

- Add Chrome setup step using browser-actions/setup-chrome@v1
- Simplify Lighthouse CI command to use existing lighthouserc.js config
- Update lighthouserc.js to use warn-level assertions with realistic thresholds
- Remove long CLI flags in favor of maintainable config file approach
- Ensures Chrome availability and prevents flaky CI failures
@vercel
Copy link

vercel bot commented Sep 6, 2025

Deployment failed with the following error:

Resource is limited - try again in 43 minutes (more than 100, code: "api-deployments-free-per-day").

Learn More: https://vercel.com/codeunias-projects?upgradeToPro=build-rate-limit

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 6, 2025

Walkthrough

Adds a Chrome setup step to the CI workflow before Lighthouse CI and simplifies the Lighthouse run command. Updates lighthouserc.js to relax thresholds and convert assertions to warnings across multiple metrics and categories.

Changes

Cohort / File(s) Summary
CI workflow updates
.github/workflows/ci-cd.yml
Inserts a "Setup Chrome" step before Lighthouse CI; replaces explicit lhci assert flags with a plain lhci autorun.
Lighthouse config thresholds
lighthouserc.js
Converts assertion severities to warnings and relaxes thresholds (lower minScores, higher maxNumericValue for FCP, LCP, CLS, TBT, Speed Index).

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Dev as GitHub Actions
  participant Job as CI Job
  participant Chrome as Setup Chrome
  participant LHCI as Lighthouse CI

  Dev->>Job: Trigger workflow
  Job->>Chrome: Install/Setup Chrome
  Note over Chrome,Job: Ensures Chrome is available for audits
  Job->>LHCI: Run `lhci autorun`
  Note over LHCI: Uses lighthouserc.js with relaxed thresholds and warn-level assertions
  LHCI-->>Job: Report results (warnings not failing build)
  Job-->>Dev: Publish CI results
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

I hop through pipelines, swift and bright,
Chrome now ready for the audit night.
LHCI hums with gentle warns,
Softer thresholds, fewer thorns.
Carrots cached, the build runs light—
Green meadows glow in dashboard light. 🥕✨

✨ 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: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/ci-cd.yml (1)

483-487: Bug: malformed FULL_HEALTH_URL (missing “?” before query params).

As written, the URL is invalid and will falsely fail the full health check when the bypass token path is exercised.

-              FULL_HEALTH_URL="$DEPLOYMENT_URL/api/health&x-vercel-set-bypass-cookie=true&x-vercel-protection-bypass=${{ secrets.VERCEL_BYPASS_TOKEN }}"
+              FULL_HEALTH_URL="$DEPLOYMENT_URL/api/health?x-vercel-set-bypass-cookie=true&x-vercel-protection-bypass=${{ secrets.VERCEL_BYPASS_TOKEN }}"
🧹 Nitpick comments (2)
.github/workflows/ci-cd.yml (2)

590-592: Make LHCI explicitly use the installed Chrome (export CHROME_PATH).

Occasionally LHCI fails to discover Chrome on runners. Since PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true, wiring the action’s chrome-path output removes that source of flakiness.

       - name: Setup Chrome
-        uses: browser-actions/setup-chrome@v1
+        id: setup-chrome
+        uses: browser-actions/setup-chrome@v1

       - name: Run Lighthouse CI
         run: |
           npm install -g @lhci/cli@0.12.x
           lhci autorun
         env:
+          CHROME_PATH: ${{ steps.setup-chrome.outputs.chrome-path }}
           LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
           LHCI_TOKEN: ${{ secrets.LHCI_TOKEN }}
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Also applies to: 593-601


595-596: Avoid global install; use npx to speed up and simplify the step.

This removes the global install, reduces step time, and still pins the CLI version.

-          npm install -g @lhci/cli@0.12.x
-          lhci autorun
+          npx -y @lhci/cli@0.12.x autorun
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 43d67eb and ceaee3b.

📒 Files selected for processing (2)
  • .github/workflows/ci-cd.yml (1 hunks)
  • 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
🔇 Additional comments (1)
lighthouserc.js (1)

23-31: LGTM: Warnings + realistic thresholds should curb CI flakiness.

Shifting key assertions to warn-level with pragmatic limits aligns with the stated PR goal and keeps visibility without blocking merges.

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