fix: playwright chromium should use playwright mirror, not chrome-for-testing#71
Conversation
…-testing `PLAYWRIGHT_CHROMIUM_DOWNLOAD_HOST` was set to `binaries/chrome-for-testing` in #67. That only matched playwright 1.58.0's transient `{version}/{platform}/...` layout. But: - playwright 1.58.1 changed chromium to `builds/cft/{version}/...` - playwright <= 1.57 still uses `builds/chromium/{rev}/...` both are served under `binaries/playwright`, and every version >= 1.52 DOES read `PLAYWRIGHT_CHROMIUM_DOWNLOAD_HOST` (chromium prefers it over `PLAYWRIGHT_DOWNLOAD_HOST`), so the chrome-for-testing override 404s them — e.g. `ut i` on playwright 1.57 fails with NoSuchKey. Remove the override so chromium falls back to `PLAYWRIGHT_DOWNLOAD_HOST` (= `binaries/playwright`), consistent with firefox/webkit. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
💤 Files with no reviewable changes (2)
📝 Walkthrough
✨ 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 |
There was a problem hiding this comment.
Code Review
This pull request removes the PLAYWRIGHT_CHROMIUM_DOWNLOAD_HOST environment variable from package.json and cleans up its corresponding references in the test suite within test/index.test.js. There are no review comments, and I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
🎉 This PR is included in version 2.20.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
…zureedge (#1099) ## 问题 playwright >= 1.58 的 chromium 从镜像下载会 404:`binaries/playwright/builds/cft/{browserVersion}/...` 目录为空,从未被同步落盘。 ## 根因 `PlaywrightBinary` 的上游 `DOWNLOAD_HOST` 用的是已废弃的 `playwright.azureedge.net`。实测(跟随 307 重定向): | 上游路径 | azureedge | cdn.playwright.dev | |---|---|---| | `builds/chromium/1200/...`(老,≤1.57) | 200 | 200 | | `builds/cft/145.0.7632.6/mac-arm64/...`(新,1.58.1+) | **400** ❌ | **200** ✅ | azureedge 只认老的 `builds/*`,**不认 playwright 1.58.1 起启用的 `builds/cft/*` 新命名空间**。所以同步 worker 抓 CFT 产物时拿到 400,chromium 二进制永远进不了镜像。 补充确认:playwright 从 1.58 起不再发布老结构 `builds/chromium/{rev}`(`cdn.playwright.dev/builds/chromium/1208` 也 404),1.58+ 的 chromium **只存在于 CFT 路径**,没有旧目录可回退——所以必须把 CFT 同步跑通。 ## 改动 `DOWNLOAD_HOST` 从 `https://playwright.azureedge.net/` 换成 `https://cdn.playwright.dev/`,并同步更新测试断言。 已验证 cdn.playwright.dev 对 driver / firefox / webkit / ffmpeg / 老 chromium / 新 cft chromium **全部 200**,是 azureedge 的安全超集,不影响已有同步。 合并后需触发一次 playwright binary 重新同步,`builds/cft/` 产物才会落盘。 > 配套修复:cnpm/binary-mirror-config#71(把 `PLAYWRIGHT_CHROMIUM_DOWNLOAD_HOST` 从错误的 `chrome-for-testing` 指向移除,修复 ≤1.57 的回归)。 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
背景
#67 新增了
PLAYWRIGHT_CHROMIUM_DOWNLOAD_HOST = https://cdn.npmmirror.com/binaries/chrome-for-testing,用于适配 playwright 1.58 起 chromium 改走 CFT。当时演示通过,是因为 playwright 1.58.0 的cftUrl路径是{browserVersion}/{platform}/...,恰好命中 npmmirror 的 chrome-for-testing 布局。但这个指向随后失效,且误伤了老版本:
builds/chromium/{rev}/chromium-mac-arm64.zipbinaries/playwright{browserVersion}/mac-arm64/chrome-mac-arm64.zipbinaries/chrome-for-testing← #67 只对这一版对builds/cft/{browserVersion}/mac-arm64/chrome-mac-arm64.zipbinaries/playwright两个问题:
{version}/...改成了builds/cft/{version}/...,chrome-for-testing指向随之 404。PLAYWRIGHT_CHROMIUM_DOWNLOAD_HOST(chromium 优先用它、再回退PLAYWRIGHT_DOWNLOAD_HOST),所以该指向把 ≤1.57 也打挂了 ——ut i装 playwright 1.57 直接NoSuchKey404。改动
删除
PLAYWRIGHT_CHROMIUM_DOWNLOAD_HOST,让 chromium 回退到PLAYWRIGHT_DOWNLOAD_HOST(=binaries/playwright),与 firefox/webkit 一致。cnpmcore 的PlaywrightBinary无论老builds/chromium还是新builds/cft都发布在binaries/playwright下,故这是唯一对所有版本都成立的 host。npm test通过(8/8)。🤖 Generated with Claude Code
This change is