Skip to content

ci: install only the headless Chromium shell - #5187

Open
orangeCatDeveloper wants to merge 1 commit into
apache:mainfrom
orangeCatDeveloper:ci/playwright-only-shell
Open

ci: install only the headless Chromium shell#5187
orangeCatDeveloper wants to merge 1 commit into
apache:mainfrom
orangeCatDeveloper:ci/playwright-only-shell

Conversation

@orangeCatDeveloper

@orangeCatDeveloper orangeCatDeveloper commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Summary

The Storybook smoke always launches headless, and Playwright picks its executable
by headedness, so playwright install chromium downloaded the full Chrome build
on every Storybook-selected run and never opened it. --only-shell installs only
the build the smoke uses.

No behavior change — the smoke was already launching chromium-headless-shell.
SMOKE_HEADED=1 stops working on a runner; it was only ever meaningful locally,
where developers install their own browsers.

Verification

Download per Storybook-selected run:

before   184.3 MiB full Chrome + 114.7 MiB headless shell + 2.3 MiB FFmpeg = 301.3 MiB, 18s
after                           114.7 MiB headless shell + 2.3 MiB FFmpeg = 117.0 MiB, 13s

Before from job 102913386594 on main, after from this PR's own run. The install after the change, and the
smoke's exact launch call against it:

$ npx playwright install --only-shell chromium && ls "$PLAYWRIGHT_BROWSERS_PATH"
chromium_headless_shell-1234
ffmpeg-1011

$ node -e "chromium.launch({headless:true})..."
LAUNCH OK: ok

$ node -e "chromium.launch({headless:false})..."
browserType.launch: Executable doesn't exist at .../chromium-1234/...

Ran locally: npm run format:check, node --test scripts/ci-workflow-policy.test.mjs
(43 pass). Editing ci.yml selects every surface, so this PR's own test run
exercises the changed step.

AI use

Select exactly one:

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: Claude Code found the unused download while profiling CI step
timings, wrote the change and ran the verification above. Codex (gpt-5.6-sol) and
a second independent Claude session reviewed the diff. Review below is human.

Checklist

  • Tests cover the change and fail without it — no test covers a workflow
    install flag; a wrong flag fails the Storybook smoke outright
  • Lint, format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No

@github-actions github-actions Bot added the effort/XS Under 10 readable lines label Sep 11, 2026
The Storybook smoke always launches headless, and Playwright picks its
executable by headedness, so the full Chrome build was downloaded on
every Storybook-selected run and never opened.

Generated-by: Claude Code

@me2seeks me2seeks left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR 5187 Review

结论

APPROVE
--only-shell 改动的消费方核实无误:ci.yml 该安装步骤只服务 storybook smoke(scripts/storybook-visual-smoke.mjs:391headless: process.env.SMOKE_HEADED !== '1',CI runner 上恒为 headless),而 headed 的 scripts/perf/storybook.mjs:26headless: false)由独立 workflow performance-frontend.yml:40 自己 playwright install chromium,不受本改动影响。Desktop e2e 用 Electron 自带 Chromium(apps/desktop/e2e/playwright.config.ts 不配 browserType),也不依赖系统 chromium 构建。

发现

不确定性(不发到 GitHub 的疑虑)

  • SMOKE_HEADED=1 在 CI runner 上从此必失败(PR 描述已承认"only ever meaningful locally")。若有人真在 CI 里想开 headed 验证,需手工装完整 chromium——可接受,文档化于注释。
  • 注释中 "The headed consumer (perf/storybook.mjs) self-installs" 措辞上 perf 脚本本身不含 install 命令,是 perf workflow 自己装;不影响正确性。

✅ 对抗性审查(第一性原理 + 奥卡姆剃刀 + 证据核对)通过:未发现真实的 P0–P3 问题。@me2seeks 请把关是否 merge。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/XS Under 10 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants