Skip to content

chore(desktop): 把 gen/schemas「该不该跟踪」从猜测改成实测结论——readiness 门禁要求目录存在+含 desktop/windows-schema.json+git 干净,取消跟踪即红(0 文件取消跟踪、0 条新规则,仅 +5 行注释) - #2293

Merged
DeliciousBuding merged 1 commit into
masterfrom
chore/untrack-generated
Sep 3, 2026

Conversation

@DeliciousBuding

Copy link
Copy Markdown
Collaborator

一句话

round-71「不该跟踪的构建生成物」消融批的否定结论落盘app/desktop/src-tauri/gen/schemas/ 那 7 个被跟踪的生成物(共 ~830KB)不是零消费者,取消跟踪会直接打红 release-readiness 门禁;本 PR 只把 .gitignore 里原本那句猜测式注释("keep tracked only if CI/capabilities need them")换成实测答案,0 条新 ignore 规则、0 个文件取消跟踪(+5 行注释)。

为什么值得占一个 PR

上一个批次的任务书把 gen/** 当作「构建生成物、应取消跟踪」的候选,并假设「删掉会有 path-filtered 的 desktop 打包 job 兜底」。实测两条都不成立:

  1. 这些文件有硬消费者(见下),删掉不是"由打包 job 兜底",而是裸 checkout 上的静态门禁立刻红
  2. checks.ymldesktop-linux-buildif: github.event_name == 'workflow_dispatch'release.ymlbuild-desktop* 只在 push tags: v* 触发——PR 上 app/desktop/** 只跑 frontend-desktop(vitest/lint,无 tauri build)。也就是说没有 PR 级打包兜底,误删只会在 release 时才炸。

把这 5 行写进 .gitignore 就地留证,是为了让下一个 agent 不必再花一整条 lane 重新推一遍。

消费者证据(主机独立复核,非仅采信 lane 报告)

消费者 位置 实测
assert_generated_schema_clean()main 无条件调用) scripts/release/verify-tauri-package-readiness.py:87-105,569 要求 gen/schemas 目录存在 + 含 ≥1 个 .json + desktop-schema.json/windows-schema.json 存在 + assert_git_path_clean 目录级 git 干净
release-readiness workflow(裸 checkout,无 tauri build 预处理 .github/workflows/release-readiness.yml:53
package dry 门禁构建前/后各调一次 scripts/release/verify-tauri-package-dry.py:199,338
authored capabilities 的 $schema 引用 app/desktop/src-tauri/capabilities/default.json:2"../gen/schemas/desktop-schema.json" 主机 head -4 复核命中

文件名级零消费者扫描(acl-manifests / android-schema / linux-schema / mobile-schema / capabilities(no hits))看似可删,但被目录级门禁覆盖:assert_git_path_clean 对该目录跑 git status --porcelain,任何 ??/ D 都算红。

门禁与暗卷(本机 huawei-dev 实跑)

明卷:

命令 结果
python3 scripts/release/verify-tauri-package-readiness.py --RepoRoot .(本分支 worktree) rc=0,Tauri package readiness policy OK
bash /tmp/run-validate.sh <worktree>(61 条 CI validate 命令) PASS=61 FAIL=0 SKIP(merge-ref)=1
bash scripts/verify/verify-commit-messages.sh origin/master HEAD rc=0(1 commit)
git diff --check origin/master...HEAD rc=0
bash scripts/verify/check-secrets.sh --range "origin/master...HEAD" rc=0(Secret guard passed.
git status --short 空(0 个取消跟踪、0 个 D 行)
pnpm --dir app/desktop typecheck rc=0(lane 内离线装依赖后实跑;依赖用后已删)

暗卷(主机独立重跑):

  1. git rm --cached app/desktop/src-tauri/gen/schemas/linux-schema.json(挑一个文件名级零命中的文件,工作区文件保留)→ readiness rc=1FAIL: Tauri generated schemas has untracked generated changes: ?? app/desktop/src-tauri/gen/schemas/linux-schema.jsongit reset 还原后 rc=0。⇒ 「取消跟踪即红」不是推断,是实测。
  2. git check-ignore -vgen/android/Foo.java → 命中 .gitignore:84(rc=0,仍被忽略);gen/schemas/desktop-schema.json → rc=1(没有被新注释或既有规则误吞)。

未验证 / 边界(如实)

  • 本机未跑 cargo/tauri 打包:huawei-dev 4C8G ARM、磁盘 96%(49G 用 44G),按纪律不跑重型打包。"pnpm tauri dev/tauri build 会重新生成 gen/schemas/*" 依据的是 Tauri CLI 既有行为 + CI 内已存在的命令(checks.yml:1244--no-bundle),本批未实跑验证
  • 结论不受该缺口影响:真正的阻断点是裸 checkout 上的静态门禁,与打包是否会重新生成无关。
  • 本 PR 不改任何 ignore 规则语义,只加注释,因此不产生构建/打包行为变化。

只报未做(需改构建配置或属设计决策,本批不动)

  • 字节级重复大文件:app/web/public/fonts/material-symbols-outlined.woff2app/desktop/public/fonts/…woff2 各 1,127,988B、sha256 相同;app/web/public/agenthub-icon-rounded-512.pngapp/mobile-rn/assets/agenthub-splash-icon.png 83,605B 相同;两份 LICENSE-Apache-2.0.txt 11,358B 相同。去重要改构建/打包配置,属另一批。
  • gen/schemas 内部 desktop=linux=windows-schema.json(151,660B 三者逐字节相同)、android=mobile-schema.json(144,500B 相同)——Tauri 生成拓扑决定,勿人工去重
  • gen/schemas/capabilities.json(592B)是 CLI 对 src-tauri/capabilities/default.json 的生成式解析快照(≠ authored 文件),按同一目录级门禁保留。
  • 其它被跟踪构建产物:git ls-files 内无 dist/target/coverage/.next/、其它 gen/ 目录。

@coderabbitai

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: 0210ac2b-7324-457c-a8b0-f8d4d6103e1f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@DeliciousBuding
DeliciousBuding enabled auto-merge (squash) September 3, 2026 14:53
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