Repository navigation
Run the non-Unix worktree removal refusal on Windows CI - #2192
Conversation
The Windows job does not build the dim-app-server lib test target, so the non-Unix refusal branch had no test that CI executed. Move the assertion into app_server_flow, which the windows-cli job runs, and drive it through worktree.remove over the local transport: an unregistered directory under the managed root must be refused without --force and removed with it. Name the test in scripts/test-windows-native.mjs and add its file and worktrees.rs to the windows_native paths, so the Windows step runs when either changes.
The Windows-native selection covers the worktree removal refusal in `crates/dim-app-server/src/worktrees.rs` and its flow in `crates/dim-app-server/tests/worktree_removal_flow.rs`. Add the worktree-removal paths and `worktree_removal_flow` to the CI descriptions so a change to that path is documented as selecting the `windows-cli` job.
Both sides edited docs/release/README.md: main rewrote the static-checks sentence, this branch extended the Windows-native path list. The merged paragraph keeps main's static-checks wording and adds the worktree-removal paths.
zerob13
left a comment
There was a problem hiding this comment.
The exact Windows CI run exercises the previously unrun non-Unix worktree-removal refusal. The test verifies that refusal preserves the directory and that explicitly authorized removal succeeds separately. Windows job selection and script tests passed. No production behavior change or review blocker; the remaining CI gates are independent.
eric8810
left a comment
There was a problem hiding this comment.
This exercises the product RPC rather than a Windows-only test binary CI never selected. The exact Windows job lists and passes the new test: refusal leaves the directory in place, and a separate explicit force request removes it. The scripts job also passed. Linux and the final CI gate were still pending at review time.
Non-blocking: bound the pipe reply and shutdown waits like the existing cases in named_pipe_flow.rs. A regression that stops replying should fail at this fixture rather than wait for the whole Windows job timeout.
Run the non-Unix worktree removal refusal on Windows CI
What changed
crates/dim-app-server/tests/worktree_removal_flow.rs(new,#[cfg(not(unix))]) starts a product-profile server on a disposable home and callsworktree.removeover the local named pipe for an unregistered directory under the managed root: without--forceit must answerworktree_in_useand leave the directory in place, and with--forceit must remove it.crates/dim-app-server/tests/app_server_flow.rsincludes the module.crates/dim-app-server/src/worktrees.rs: delete the lib testa_path_based_removal_refuses_an_unregistered_directory. No CI job builds that test target on Windows, so the assertion never ran. The two tests narrowed to#[cfg(unix)]in #2133 keep their assertions and are unchanged; the helper and module import they share are now#[cfg(unix)]too because every remaining test in the module is Unix-only.scripts/test-windows-native.mjsnames the new test in theapp_server_flowflow, andscripts/ci-changes.mjsaddscrates/dim-app-server/src/worktrees.rsand the new flow file to thewindows_nativepaths. Thewindows-clijob runscargo test --locked -p dim-cli --lib, then, when thewindows_nativegroup is selected,node scripts/test-windows-native.mjs. That script lists thedim-app-serverapp_server_flowtarget, checks that every named test exists in the compiled binary, and runs it with--exact. The new case runs there.The CI descriptions in
docs/architecture/build.md,docs/architecture/tui-e2e.mdanddocs/release/README.mdnow name the worktree-removal paths andworktree_removal_flow, so a change to the worktree removal path is documented as selecting thewindows-clijob and running the flow there.Why
The non-Unix branch refuses the non-force removal of an unregistered directory because deleting by path cannot prove the directory being deleted is the one that was checked. #2133 added the branch and an assertion for it, but the assertion sat in a lib test target that the Windows job does not build. A refusal that no CI job exercises can be removed or inverted without a failure.
Verification
cargo fmt --all -- --check --config error_on_line_overflow=truecargo test --locked -p dim-app-server --lib worktrees(4 passed)cargo test --locked -p dim-app-server --test app_server_flow prompt_settings_flow(the target builds and runs; the new module is compiled out on Unix)cargo clippy --locked -p dim-app-server --all-targets -- -D warningscargo check --locked -p dim-app-server --tests --target x86_64-pc-windows-gnu(the Windows-only test compiles for a Windows target)cargo run --locked -p xtask -- checknode --test scripts/ci-changes.test.mjs scripts/test-windows-native.test.mjsThe Windows job is the run of the refusal itself; a Unix host cannot execute that branch.