[fix] Self-heal Playwright browser cache#4723
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe CI workflow for web unit tests updates the Playwright binaries cache key to include a hash of ChangesPlaywright Browser Install Hardening
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/12-check-unit-tests.yml (1)
85-86: 💤 Low valueOptional: Remove unused step ID.
The
id: restore-playwright-cacheis no longer referenced now that the browser install step runs unconditionally. Consider removing it to reduce confusion.♻️ Proposed cleanup
- name: Cache Playwright binaries - id: restore-playwright-cache if: github.event_name != 'workflow_dispatch' || contains(fromJSON('["all","web-only"]'), inputs.packages)
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: b7229b9c-42be-455b-b140-864d0bdbc9c1
📒 Files selected for processing (1)
.github/workflows/12-check-unit-tests.yml
Context
Web Playwright jobs can fail before any test starts when GitHub Actions restores a stale
~/.cache/ms-playwrightdirectory. The workflow previously skippedplaywright install chromiumwhenever the cache hit, so a cache with the wrong browser revision stayed broken and surfaced as a misleading0 passed, 0 failed, 0 skippedrun.Changes
The Playwright browser cache key now includes
web/pnpm-lock.yaml, with a restore prefix for older caches. After restoring the cache, the workflow always runspnpm exec playwright install chromiumwith a short retry loop. A valid cache remains fast because the install is a no-op; a stale restored cache downloads the missing browser and can be saved under the new lockfile-specific key.Tests / notes
git diff --checkfor.github/workflows/12-check-unit-tests.yml..github/workflows/44-railway-tests.yml.