Browser channel override still requires the bundled Playwright Chromium

未关闭
#2,606 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
72/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
playwright, typescript
领域
backend, testing

调研方向

Start with packages/runtime-playground/src/browser-capture-session.ts, tracing how launchChromiumBrowser() and playwrightBrowserReadiness() handle WP_CODEBOX_BROWSER_CHANNEL. Check the browser provenance and metadata paths named by the issue as well. Confirm channel mode launches and reports readiness without bundled Chromium, while no-channel mode keeps requiring it with the existing error.

由索引模型根据 Issue 内容生成。

描述

Problem

launchChromiumBrowser (packages/runtime-playground/src/browser-capture-session.ts) first calls assertPlaywrightBrowserReady(), which throws unless Playwright's bundled Chromium is on disk. Only after that does it launch with channel: process.env.WP_CODEBOX_BROWSER_CHANNEL.

This makes the documented channel override unusable on its own. A host that wants the system Chrome (WP_CODEBOX_BROWSER_CHANNEL=chrome, which every GitHub-hosted Ubuntu runner already has) still has to download the pinned Chromium and its apt dependencies, only to never launch it. playwrightBrowserReadiness() (used by discovery) has the same blind spot and reports such a host as unavailable.

Evidence

On a GitHub Actions ubuntu-latest runner with WP_CODEBOX_BROWSER_CHANNEL=chrome and google-chrome on PATH, a wordpress.browser-probe step failed with:

Required Playwright Chromium 149.0.7827.55 (revision 1228) is unavailable. Install the browser owned by this WP Codebox package with: node ./node_modules/playwright/cli.js install chromium

Downstream, the browser install step (playwright install --with-deps chromium) costs 56 s on average and up to 258 s per run in a production deploy gate.

Expected

  • When WP_CODEBOX_BROWSER_CHANNEL is set, launch through that channel without requiring the bundled Chromium. If the channel's browser is missing, Playwright's own launch error is the one surfaced.
  • playwrightBrowserReadiness() reports a channel-configured host as ready, or checks the channel's browser instead of the bundled one, so discovery agrees with launch.
  • Browser provenance and metadata name the channel in use.
  • With no channel set, behaviour is unchanged: the bundled Chromium is still required, with the same error.

AI disclosure: Claude (Anthropic) in the Pi coding agent (Franklin), directed by @chubes4. AI traced the failure from a deploy gate run and wrote this issue.

主要语言
TypeScript
星标
19
派生
4
平均合并
35 分钟
30 天内合并 PR
11

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Automattic/wp-codebox 的其他 Issue

查看 Automattic/wp-codebox 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。