Skip to content

[PR] ci: add real npm layout e2e for self-update (#6643 regression class now covered by CI) | ci: 自更新补真实 npm 布局 e2e(#6643 回归类从此 CI 兜底) - #6676

Merged
ranxianglei merged 2 commits into
masterfrom
test/e2e-selfupdate-cli
Nov 14, 2026
Merged

ranxianglei merged 2 commits into
masterfrom
test/e2e-selfupdate-cli

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

这是啥问题?

bili update 原地自更新的代码之前没有任何跑真实 npm 安装布局的测试:单测全是手工搭目录,真实 npm 全局安装只有真模型 gate 的 X lane 覆盖。所以 #6643 那个「npm 布局下原地自更新 100% 失败」的回归(备份目录复用 + 相对 .bin 符号链接触发 libuv 自拷贝保护,ERR_FS_CP_EINVAL)一路漏到了 gate 才被发现。

修了什么

新增 tests/e2e/e2e-selfupdate-cli.test.ts,挂到现有的 hermetic registry lane(ACP_TEST_REGISTRY=1,ci-registry.yml,ubuntu + windows):

  1. fixture 包带一个带 bin 的依赖(mime),让 npm install -g 生成真实的相对 .bin 符号链接树——正是触发 [PR] In-place auto-update 100% failure fix: Backup must not exist prior to atomic swap (Gate Lane X repro) | 就地自动更新 100% 失败修复:备份不能先于原子交换存在(门禁 Lane X 复现) #6643 回归的布局;
  2. 跑真实 CLI bili update(不是直接调内部函数);
  3. 断言磁盘版本前进、bili --version 报告新版本、第二次 update 干净 no-op。

验证

能合并吗?

能。只加一个测试文件 + ci-registry.yml 运行列表加一行,零产品代码改动。建议合入,之后这类回归进不了主干。

…sion class)

The update code paths were only covered by unit tests with hand-built
directories and by the real-model gate Lane X, which materializes a REAL
npm global install. #6643 (pre-#6340 atomic-swap rewrite) made every
in-place update on an npm-layout install fail 100% — cp-onto-existing-
backup hit libuv's self-copy guard on the relative node_modules/.bin
symlinks — and no CI lane caught it.

New tests/e2e/e2e-selfupdate-cli.test.ts in the existing hermetic
registry lane (ACP_TEST_REGISTRY=1, ci-registry.yml, ubuntu+windows):
publish a fixture package with a bin-bearing dependency (so npm lays
down a real relative .bin symlink tree), npm install -g it, then run
the REAL CLI 'bili update' and assert the version advances on disk +
in 'bili --version', plus a clean no-op second update. Verified:
- green on master (fix in place) in the bili-gate container (node 22 / npm 10)
- red with #6643 reverted: exact gate failure signature
  'backup of current install failed ... ERR_FS_CP_EINVAL ... node_modules/.bin/mime'
- green locally (node 25 / npm 11 writes absolute .bin links — trap inert, flow still exercised)
@ranxianglei ranxianglei changed the title ci: 自更新补真实 npm 布局 e2e(#6643 回归类从此 CI 兜底) [PR] ci: add real npm layout e2e for self-update (#6643 regression class now covered by CI) | ci: 自更新补真实 npm 布局 e2e(#6643 回归类从此 CI 兜底) Nov 14, 2026
@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: test/e2e-selfupdate-cli (8a63a1c)

Latest build — install this exact version

npm install -g billion-context@0.0.9959-pr.6676.c7f16c5

This exact version is immutable and reproducible. The rolling pr tag tracks the newest test build across all PRs.

Recent builds (commit → version)

commit version build
8a63a1c billion-context@0.0.9959-pr.6676.c7f16c5 build
190962e billion-context@0.0.9933-pr.6676.2dec7a7 build

Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr6676.tgz
npm install -g package

Install instructions are refreshed on each push.

@ranxianglei
ranxianglei merged commit 8964c1f into master Nov 14, 2026
39 of 50 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

📦 Merged Build Published

This merge to master was published as 0.0.1198-master.8964c1f (rolling master tag).

npm install -g billion-context@0.0.1198-master.8964c1f  # this exact build
npm install -g billion-context@master  # always the newest merged build

npm view billion-context@master prints the current version at any time.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant