fix(release): allow cli-entry.js in standalone dist allowlist#5153
Conversation
The OOM-prevention work in #4914 added a dist/cli-entry.js bin wrapper (re-spawns node --expose-gc cli.js) via prepare-package.js, but did not register it in the standalone packager's strict dist allowlist. The release job then fails with: Error: Unexpected dist asset: .../dist/cli-entry.js Add cli-entry.js to DIST_ALLOWED_ENTRIES, same fix as #5049 did for fzfWorker.js.
There was a problem hiding this comment.
Pull request overview
This PR fixes the standalone release packaging step by updating the standalone packager’s strict dist/ allowlist to accept the newly-generated dist/cli-entry.js wrapper, preventing the build from failing with “Unexpected dist asset”.
Changes:
- Add
cli-entry.jstoDIST_ALLOWED_ENTRIESinscripts/create-standalone-package.js. - Document why
cli-entry.jsexists (generated byprepare-package.jsas the packagebinwrapper; linked to #4914).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Thanks for the PR! Template looks good ✓ — all required sections present, bilingual, test plan included. On direction: this is a release-blocker hotfix. The standalone build is broken on On approach: exactly the right fix. One string added to the allowlist, matching the established pattern from #5049 ( Moving on to code review. 🔍 中文说明感谢贡献! 模板完整 ✓ — 所有必填段落都在,双语,包含测试计划。 方向:这是阻塞发布的紧急修复。自 #4914 添加了 方案:完全正确的修法。往白名单加一个字符串,复用 #5049( 进入代码审查 🔍 — Qwen Code · qwen3.7-max |
Code ReviewThe change is three lines in Before/After TestingTested the allowlist validation logic directly against The fix resolves the exact failure cited in the PR description (failing CI run). 中文说明代码审查改动是 前后对比测试直接针对
修复了 PR 描述中引用的 CI 失败。 — Qwen Code · qwen3.7-max |
|
This is a textbook hotfix: release build is broken, the fix is a one-line allowlist addition following the exact precedent set by #5049, and the before/after test confirms it works. The PR author clearly understands the codebase — they cite the prior art, link the failing CI run, and scope the change tightly. My independent proposal was identical: add Approving. ✅ 中文说明这是一个教科书式的紧急修复:发布构建挂了,修复方案是往白名单加一行,完全复用 #5049 的先例,前后对比测试确认有效。PR 作者显然熟悉代码库——引用了先例、链接了失败的 CI run、把范围控制得很紧凑。 我的独立方案和 PR 完全一致:把 批准 ✅ — Qwen Code · qwen3.7-max |
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
LGTM, looks ready to ship. ✅
Code Coverage Summary
CLI Package - Full Text ReportCore Package - Full Text ReportFor detailed HTML reports, please see the 'coverage-reports-22.x-ubuntu-latest' artifact from the main CI run. |
|
Qwen Code review did not complete successfully: Qwen review aborted with an API error before posting comments. See workflow logs. |
What this PR does
Adds
cli-entry.jsto the standalone packager's allowed dist-entry list (DIST_ALLOWED_ENTRIESinscripts/create-standalone-package.js), so the standalone release build no longer rejects it as an unexpected asset.Why it's needed
The standalone release build is currently broken on
main. #4914 added adist/cli-entry.jsbin wrapper — it re-spawnsnode --expose-gc cli.js— emitted byprepare-package.js, but it was never registered in the packager's strict dist allowlist. The release job fails withError: Unexpected dist asset: .../dist/cli-entry.js(failing run). This is the same class of miss that #5049 fixed forfzfWorker.js, and the fix is identical: register the new entry.Reviewer Test Plan
How to verify
scripts/create-standalone-package.jswalksdist/and callsfail()on any entry not inDIST_ALLOWED_ENTRIES. Before this changecli-entry.js(created byprepare-package.js) is not in the set, so packaging aborts. After this change it is allowed and copied into the standalonelib/like the other runtime assets. Confirm by running the release packaging step (npm run package:standalone:release) and checking it completes past the asset-validation stage instead of erroring oncli-entry.js.Evidence (Before & After)
N/A — release-tooling change, not user-visible.
Tested on
node -c scripts/create-standalone-package.jspasses; pre-commit prettier/eslint clean.Environment (optional)
N/A
Risk & Scope
cli-entry.jswrapper itself is the right design is out of scope — see the discussion on fix(cli,core): harden OOM prevention — idempotent compaction tests, explicit GC, debug log defaults #4914. This PR is the minimal hotfix to unblock release.Linked Issues
N/A
中文说明
这个 PR 做了什么
把
cli-entry.js加入 standalone 打包脚本的 dist 产物白名单(scripts/create-standalone-package.js的DIST_ALLOWED_ENTRIES),让 standalone release 构建不再把它当成意外产物拒绝掉。为什么需要
standalone release 构建当前在
main上是挂的。#4914 通过prepare-package.js新增了一个dist/cli-entry.js的 bin wrapper(它会 re-spawnnode --expose-gc cli.js),但从未在打包脚本的严格白名单里登记。release job 因此报Error: Unexpected dist asset: .../dist/cli-entry.js(失败的 run)。这和 #5049 修fzfWorker.js是同一类疏漏,修法也一样:把新产物登记进去。验证方式
scripts/create-standalone-package.js会遍历dist/,对任何不在DIST_ALLOWED_ENTRIES里的产物调用fail()。改动前cli-entry.js(由prepare-package.js生成)不在集合里,所以打包中止;改动后它被放行,和其他运行时产物一样拷进 standalone 的lib/。运行 release 打包步骤(npm run package:standalone:release),确认它能越过产物校验阶段、不再因cli-entry.js报错即可。风险与范围
cli-entry.js这个 wrapper 本身的设计是否合理不在本 PR 范围内,见 fix(cli,core): harden OOM prevention — idempotent compaction tests, explicit GC, debug log defaults #4914 的讨论。本 PR 只是解锁 release 的最小修复。