fix: cache downloaded playwright browsers with re-attempt#3722
Conversation
📝 WalkthroughWalkthroughThe Playwright CI workflow adds a caching step for browser binaries under ChangesPlaywright CI Install Reliability
Estimated code review effort: 1 (Trivial) | ~5 minutes Suggested labels: CI, workflow Suggested reviewers: None specified 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
🤖 Pull request artifacts
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/playwright.yml (1)
77-82: 🚀 Performance & Scalability | 🔵 Trivial | 💤 Low valueSkip the sleep after the final failed attempt.
On the 3rd attempt, if
npx playwright installfails, the loop still sleeps 90s before falling through toexit 1, needlessly delaying failure feedback.♻️ Proposed fix
for attempt in 1 2 3; do npx playwright install chromium --with-deps && exit 0 echo "Playwright install failed on attempt $attempt" - sleep $((attempt * 30)) + [ "$attempt" -lt 3 ] && sleep $((attempt * 30)) done exit 1🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/playwright.yml around lines 77 - 82, The retry loop in the Playwright install step still sleeps after the final failed attempt, delaying failure unnecessarily. Update the shell logic around the npx playwright install chromium --with-deps retry block so sleep only happens when another attempt remains, and skip it on the third/final iteration before exit 1.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In @.github/workflows/playwright.yml:
- Around line 77-82: The retry loop in the Playwright install step still sleeps
after the final failed attempt, delaying failure unnecessarily. Update the shell
logic around the npx playwright install chromium --with-deps retry block so
sleep only happens when another attempt remains, and skip it on the third/final
iteration before exit 1.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: ef1dd768-dbc0-4f76-9205-5e7daffd88ef
📒 Files selected for processing (1)
.github/workflows/playwright.yml
|
Size Change: +10 B (0%) Total Size: 2.63 MB 📦 View Changed
ℹ️ View Unchanged
|
fixes #3723
Summary by CodeRabbit