Repository navigation
fix: open-connector 锁文件下载源换官方 registry(nightly .117 optional 包静默丢失) - #320
Merged
Merged
Conversation
There was a problem hiding this comment.
审查结论:✅ 无阻塞问题
对 apps/desktop/scripts/open-connector-package-lock.json 做了逐行核验,本次变更确实是纯 URL 主机改写,未发现正确性、安全或发布风险。
核验过程与证据
1. Diff 纯度(逐行)
- 删除 697 行、新增 697 行,全部一一配对。
- 每一条删除行均为
"resolved": "https://mirrors.cloud.tencent.com/npm/...",每一条新增行均为"resolved": "https://registry.npmjs.org/..."——没有任何integrity、version、依赖图或结构性改动(非 resolved 类字段差异为 0)。 - 抽查配对路径(@aws-sdk 系列、
lightningcss、lightningcss-win32-x64-msvc等):路径完全同构,仅主机前缀不同。
2. 完整性
- 文件中腾讯镜像 URL 残留:0。
- 全文件 698 条
resolved:697 条指向registry.npmjs.org+ 1 条 workspace 链接("resolved": "web",非 URL,正常)。 - JSON 语法有效(jq 解析通过);diff 头 blob sha(
cd305104..06e1eba0)与 PR 描述一致。
3. 修复有效性
- 该锁文件由
apps/desktop/scripts/prepare-open-connector.mjs:61拷入 staging,随后prepare-open-connector.mjs:84执行npm ci --include=dev --ignore-scripts --no-audit --no-fund。npm ci会直接按锁文件resolvedURL 下载 tarball,且仓库中不存在任何.npmrc或 CI--registry覆盖(已全仓检索),因此本改写就是唯一且充分的决定下载源的机制——修复对 macos-14 / windows-2025 / ubuntu-24.04 三个 GitHub 托管 runner 均生效。
4. 供应链安全
- 所有
integritysha512 哈希逐字节未变。npm 下载后会按 integrity 校验 tarball,因此即使某个 URL 路径被误改,最坏结果是响亮的 EINTEGRITY/404 失败,而不可能静默装入不同内容的包。改写本身不引入供应链风险,且官方 registry 反而消除了第三方镜像作为攻击面的隐患。
5. 合并干净度
- 测试合并提交(383fe818)相对 PR head 无额外改动,无冲突残留。
非阻塞备注(供知悉,无需改动)
- 国内本地开发者构建变慢的取舍:此前锁文件指向腾讯镜像,大陆本地首次执行
prepare-open-connector(无 runtime marker 缓存时)需从registry.npmjs.org拉约 544 个包,可能明显变慢或不可达。这是为 CI 确定性做出的合理取舍(marker 缓存.everroom-runtime.json会跳过重复构建,且开发者可自行配代理),仅提示知悉。 - PR 描述中第三项复选框(合并后重跑 nightly 双平台确认绿)尚未勾选,属预期的合并后验证步骤,建议合并后跟进确认。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
prepare-open-connector的 npm ci 从腾讯镜像(锁文件 resolved 全指向 mirrors.cloud.tencent.com)拉包时,2 个 optional 原生包下载失败被 npm 静默跳过(绿 .116 装了 544 包,挂的 .117 只装 542 且耗时 4 倍),lightningcss-win32-x64-msvc缺失致 vite CSS 压缩报 Cannot find module。CI runner 在美国,拉国内镜像是非确定性抖动源。https://mirrors.cloud.tencent.com/npm/换为https://registry.npmjs.org/(路径同构,纯 URL 改写,依赖图与 integrity 零变化)。Test plan
npm ci --include=dev --ignore-scripts --no-audit --no-fund:544 包(与 CI 绿色运行计数一致),lightningcss.win32-x64-msvc.node落盘验证存在git hash-object一致(06e1eba0,字节级校验;并确认入库存的是 LF 而非工作树 CRLF)