-
Notifications
You must be signed in to change notification settings - Fork 2
improve: Implement CodeRabbit AI suggestions for better CI reliability #224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- 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
|
Deployment failed with the following error: Learn More: https://vercel.com/codeunias-projects?upgradeToPro=build-rate-limit |
WalkthroughAdds 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
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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
✨ Finishing Touches
🧪 Generate unit tests
Comment |
There was a problem hiding this 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
📒 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.
Summary by CodeRabbit