Skip to content

[PR] fix(ci): drop the unused export of ClientBuildCheck - #4603

Closed
Zhishulo wants to merge 1 commit into
ranxianglei:masterfrom
Zhishulo:2026-10-25_drop-unused-export-client-build-check
Closed

Zhishulo wants to merge 1 commit into
ranxianglei:masterfrom
Zhishulo:2026-10-25_drop-unused-export-client-build-check

Conversation

@Zhishulo

Copy link
Copy Markdown
Contributor

Fixes #4602

改动(一行)

src/agent/client-build-note.ts:32 去掉 export:

-export type ClientBuildCheck = {
+type ClientBuildCheck = {

为什么

master head 146b34f27 起 CI 的 unused-exports job 在 master 上就红(run 40111170499, job 120923016330):

✗ 1 unused export(s):

  INTERNAL_ONLY src/agent/client-build-note.ts: ClientBuildCheck

门禁自己给出的处置就是 INTERNAL_ONLY → drop the leading export。该类型确实只在本文件内使用:

  • git grep ClientBuildCheck origin/master 只有 5 处,全在 src/agent/client-build-note.ts(32 声明、45 maxTestedVersion 形参、81 DSH_BUILD_CHECK 类型标注、93 / 115 check: 字段)
  • 消费者只导入值/函数,不导入这个类型:src/agent/dsh-native.ts:55 导入 DSH_BUILD_CHECK, emitNewerClientBuildNote, walkUpNodeModuleVersion;tests/client-build-note.test.ts:13 导入 DSH_BUILD_CHECK, emitNewerClientBuildNote, maxTestedVersion, newerClientBuildMessage, walkUpNodeModuleVersion
  • 没有 .d.ts surface 会被这个改动波及:tsconfig.json 是 noEmit: true,tsup.config.ts 没有 dts,包也不发布 types

验证

  • npx tsc --noEmit -p tsconfig.json → exit 0(kernel 先 npx tsc -p kernel/tsconfig.json 重建,否则会因本地 dist 陈旧报 acp-kernel has no exported member 'restampRefsToLedger')
  • 纯类型改动,运行时零行为变化(esbuild/tsc 擦除),不涉及测试断言
  • 改动后本文件不再有任何「导出但无外部使用者」的符号

影响

这是纯门禁解红:该 job 是每个 PR 的静态前置门之一,现在任何 PR(例如 #4263 的 head 9f485444a,run 40115261762)都会继承这条失败,红信号因此失去区分度。

如果这个类型本来就打算作为对外 surface(供客户端构建检查消费),那正确做法是补上真实使用者或按 WAIVERS 里的先例写一条带理由的豁免——但现状(导出了却没人 import)无论哪种都该改。

@Zhishulo

Copy link
Copy Markdown
Contributor Author

补一条依赖说明:本 PR 的 11 个 test (...) 分片红不是本改动引起的,是 master 上手打红:

##[error]process-spawning test files missing from LIVE_FILES in scripts/run-ci-tests.mjs: tests/issue3890-parent-gone-confirm-drain.test.ts ...

已按同样方式提单:#4604(issue)+ #4605(PR,scripts/live-files.mjs 追加一行登记)。tests/issue3890-parent-gone-confirm-drain.test.ts 是 master head 146b34f27 里已有的文件(由 69f3a2294 / #3890 引入),登记缺失使所有 PR 的测试矩阵 11/11 全红。

因此本 PR 要等 #4605 先合、再 rebase 后重跑 test,才会出现真实信号(#4605 若先合,我可以立即 rebase 本分支触发重跑)。两条互不依赖、可并行审。

@Zhishulo

Copy link
Copy Markdown
Contributor Author

改成合并提交了,本 PR 由 #4606 涵盖并取代(代码逐字节相同,只是一条分支同时含两条修复)。

原因:本 PR 与 #4605 互为前提 —— 只合本 PR 的话,它自己那几个分片/F 检查仍会红在另一条 master 常红上,拿不到全绿;合并成一条分支后,一次 merge 就能让 master 的两条常红同时消失。

如果你更愿意分开合,直接合 #4606 即可(它包含本 PR 的全部改动);需要分开的话我可以立刻重开本 PR。

@Zhishulo Zhishulo closed this Oct 24, 2026
ranxianglei pushed a commit that referenced this pull request Oct 24, 2026
ranxianglei pushed a commit that referenced this pull request Oct 24, 2026
Inherited unused-exports red from master 146b34f (same one-word fix as
#4606 commit 1 / #4603); zero external references repo-wide. Drop this
commit when rebasing once #4606 lands.
ranxianglei pushed a commit that referenced this pull request Oct 24, 2026
…aster-red #4599, same one-liner as #4603)

Master-born red since #4545 landed: 0fe7589 removed the non-dsh lanes'
consumers of ClientBuildCheck (owner decision: keep the note to the dsh lane),
leaving the type referenced only inside client-build-note.ts itself, and the
4d34abf de-export sweep missed it. Every PR rebased onto tip inherits the
unused-exports failure (tracked in #4599; fix PR #4603 pending merge). This
branch carries the identical one-line fix as its own labeled commit per the
few-line-fix discipline (duplicate fixes across PRs are acceptable).
@github-actions github-actions Bot mentioned this pull request Oct 27, 2026
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.

fix(ci): master unused-exports is red — ClientBuildCheck is exported but only used inside its own file

1 participant