Skip to content

修复 ChangeList 工作树测试的异步投影 - #1704

Merged
1lck merged 1 commit into
previewfrom
codex/issue-1662-changelist-ci
Nov 4, 2026
Merged

1lck merged 1 commit into
previewfrom
codex/issue-1662-changelist-ci

Conversation

@1lck

@1lck 1lck commented Nov 4, 2026 •

Copy link
Copy Markdown
Owner

问题与修复

#1697 合入后 macOS CI 的 Swift 测试失败:工作树 ChangeList 改为异步投影后,部分测试在投影完成前触发提交或回滚;另有测试仍假定未纳入当前工作树投影的文件属于默认列表。

  • 在提交、回滚和原生工作树界面测试中等待实际的投影任务完成,再验证操作和交互。
  • 验证另一个工作树未投影文件的归属保持未知,不能静默进入当前提交范围。
  • 最新 preview 已由 修复 IDE 快捷键导入与终端切换 #1695 修正独立的快捷键数量基线。

验证

  • 重现 GIT-07 统一 ChangeList 归属与提交范围 #1697 CI 中的 4 组失败,并补充全量套件发现的真实 Git 工作树场景;相关 8 个测试及参数化场景均通过。
  • 通过测试稳定性、运行时 bundle 不变性和共享 i18n 检查。
  • 完整 macOS 测试:4392 项、497 个测试套件通过。

@ghfind-review ghfind-review Bot added the review: high ghfind author score; see https://ghfind.com label Nov 4, 2026
@1lck
1lck force-pushed the codex/issue-1662-changelist-ci branch from 4514eaa to 748a512 Compare November 4, 2026 02:59
@1lck
1lck marked this pull request as ready for review November 4, 2026 03:02
@lithe-code-review

lithe-code-review Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Lithe Review

结论: ⚠️ 有建议
范围: preview ← codex/issue-1662-changelist-ci · head: 748a512

未发现需要阻塞合并的问题。

Findings

  1. [P2] 为新增投影等待设置本地截止时间
    macos/Tests/LitheGitModuleTests/GitModuleTests.swift:476

    • 实际影响:新增的直接 await changelistProjectionTask?.value 没有超时;投影不返回时,测试无法及时失败,也无法进入后续清理,只能依赖外层 watchdog。其余两个修改文件中的新增等待存在相同问题。
    • 触发条件:工作树投影任务未结束。底层 GitService.read 等待 detached task,仅转发取消信号,没有截止时间。
    • 复现步骤:使用现有 changelistProjectionHandler 注入点,让初始刷新正常完成,在创建 scoped 模型后保持该次投影挂起;测试会停在此行,无法到达后面的两秒闸门检查。此处清理 defer 也在等待之后才注册。
    • 来源:本次引入。新增等待把投影完成变成了没有本地期限的前置条件,不符合测试稳定性规则。

Scope Check

  • 未找到可验证的关联 Issue;按 PR 描述核对测试修复范围。
  • 已检查完整的三个变更文件:提交、回滚及原生界面测试等待投影,另一个工作树的未投影文件断言为未知归属。
  • 归属断言符合现有实现;提交范围、主工作树及嵌套仓库保护断言仍保留。
  • 继续复用现有模型和 Rust reducer,未新增生产逻辑或改变共享契约。
  • Finding 属于本次新增测试同步的职责范围。

Suggestions

  1. 为所有新增投影等待使用能按单调截止时间返回的就绪检查,超时时输出诊断并使测试失败;在等待之前注册取消、重置等清理。仅取消一个仍在等待 Task.value 的任务不能保证按时返回。

Summary

改动与异步投影语义一致,未发现生产行为回归;主要建议是补齐新增等待的失败期限。

Verification

  • 静态检查了指定 ced0422...748a512 的全部差异,并追踪 commitFeature、投影发布、GitService.read、成员归属和相关测试清理路径。
  • 作者报告相关场景及完整 macOS 测试通过(4392 项、497 个套件),并报告稳定性、bundle 不变性和 i18n 检查通过;本次未独立验证这些结果。
  • 提供的 head 检查记录中,CI tooling tests 成功;Swift tests 有 queued/skipped 记录,尚无成功结果。
  • 本次仅做只读静态审查,未运行代码、测试或应用,未访问网络;macOS 运行结果仍需后续 CI 确认。

@lithe-code-review

Copy link
Copy Markdown

Lithe 运行验收

版本:748a512c615e585f31c3eb944beec64badbba862;状态:partial。
本报告独立于代码审查;只报告实际执行的场景,不代表所有问题均已修复。

对照:共同祖先 ced042289b5fbf9b6562eacd8da1f15428b5849d → PR head;当前目标分支合并适用性:未运行。

  • 条件不足,未验证:Validate the changed module tests' synchronization with actual asynchronous projection, unknown membership for files outside the scoped checkout, commit-scope protection and local mutation publication.
    • Requires macOS and the pinned Swift 6.3.3/Xcode 26.6 toolchain, unavailable in this Windows inventory. Windows frontend mocks or Rust-only probes cannot execute the changed Swift tests. Intermittent CI stability also requires a prespecified repetition and failure-classification protocol; two runs alone cannot establish reliability.
  • 条件不足,未验证:Validate projection readiness before real rollback, scoped commit and post-staging commit, preserving primary-worktree and independent nested-repository isolation.
    • Requires the macOS Swift application test target, Rust bridge and its native dependencies. The available Git executable can construct fixtures but cannot exercise GitFeatureModel or these changed tests on Windows. A Git-only recreation would not validate the PR.
  • 条件不足,未验证:Validate the native worktree interface test's projection prerequisite and retained rollback, diff-navigation, draft and layout behavior.
    • This macOS-only AppKit/SwiftUI workflow requires a macOS desktop, WindowServer and the pinned application toolchain. The supplied environment has no interactive desktop. DOM tests, mock hosts and Windows automation cannot establish native panel, responder-chain or appearance behavior.

未覆盖:

  • Runtime confirmation that the changed tests wait for projection before commit preparation, rollback selection and post-staging commit.
  • Runtime confirmation of unknown sibling-file membership, wrong-list commit rejection and linked-only commit scope.
  • All four local-mutation variants: publication before workspace drain, sibling preservation and absence of sibling scans.
  • Real Git linked-worktree rollback and composer isolation, plus nested-repository protection for both checkout variants and staging entry points.
  • Native light/dark control readiness, rollback presentation and cancellation, selected-worktree diff navigation, draft retention and width-dependent layout.
  • The review suggestion remains unverified: local monotonic deadlines and cleanup registered before every added projection wait, including a stalled-projection failure path. Direct Task.value waits are present in the supplied head.
  • Intermittent failure elimination: no prespecified statistical protocol was supplied. Passing the required two attempts per revision would not establish flake removal.
  • The reported full macOS suite, per-test timing, stability checks, bundle immutability and i18n checks were not independently verified. The shortcut-count correction belongs to the separate PR identified in the description.

工作副本与运行状态已清理;可复用编译缓存按 12 GiB / 7 天预算保留。
详细步骤和原始证据保存在服务器受限目录(14 天、总计不超过 1 GiB);当前没有公开下载链接。

@1lck
1lck merged commit e8ec35d into preview Nov 4, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review: high ghfind author score; see https://ghfind.com

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant