Repository navigation
fix(files): restore .rgignore precedence and re-attach test modules unreferenced since #6713 - #6994
Merged
Merged
Conversation
a75113d removed the `mod tests;` declarations for these files without removing the files, so none of their tests have been compiled or run since. Restore the declarations. Each module compiles against current code and all 22 of its tests pass. Also delete products/maka/cli/src/acp/tests/{protocol, provider}.rs, whose parent tests.rs and sibling modules no longer exist. Not restored: workspace-files files/tests.rs (one test fails on current code, see the pull request), workspace-computer browser_handoff_test.rs and cli baseline/tests.rs (no longer compile). Co-Authored-By: Claude Opus 5.5 <[email protected]> Generated-by: Claude Code
4d4a450 (#6974) merged the per-source ignore matchers into one GitignoreBuilder and added them as .rgignore, .ignore, .gitignore. The ignore crate lets the last matching rule win, so the priority was reversed: .gitignore overrode .rgignore, and `!keep.cache` in .rgignore no longer rescued a file excluded by `*.cache` in .gitignore. Add the sources weakest first: .git/info/exclude, .gitignore, .ignore, .rgignore. The regression went unnoticed because files/tests.rs had been unreferenced since #6713. Re-attach it; the test that covers this now passes and fails without the fix. Also restore the test-only template()/flat() helpers that #6713 removed together with baseline/tests.rs, and re-attach that module. Co-Authored-By: Claude Opus 5.5 <[email protected]> Generated-by: Claude Code
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
a75113d8b(#6713) removed 93mod tests;declarations and deleted 367 test files. For 13 files it removed the declaration but left the file, so their tests have not been compiled or run since 11-10. The commit says it was merged before the full CI run completed.Restoring them paid off immediately: one of the restored tests catches a regression that landed after #6713. This PR restores the tests and fixes that regression, so the change closes on its own.
1. Fix:
.rgignoreand.ignoreno longer override.gitignore(fix(files))4d4a45099(#6974, 11-17) merged the per-source ignore matchers inworkspace-filesinto oneGitignoreBuilderand added them as.rgignore,.ignore,.gitignore. In theignorecrate the last matching rule wins, so the priority was reversed. Before #6974 they were separate matchers and.rgignorewon. Now!keep.cachein.rgignorecan no longer rescue a file excluded by*.cachein.gitignore, so file-reference search misses it.Candidate search checks .rgignore, .ignore, .gitignore and .git/info/exclude in that order across the active directory chain. Within each source, the closest matching file wins.
2. Restore unreferenced test modules (
test)capabilitiesfilesystem/read/scopedcomputer-usebrowser/downloads/testsnative-desktopcomputer-usebrowser/filechooser/testsnative-desktophost-runtimehttp/teststool-catalogcatalog/testsdecisions-apidecision/testsdecisions-apisettings/patch/concurrencyworkspace-filesscoped/testsworkspace-filesfiles/testsmaka-cliapplication/product/baseline/teststemplate()andflat()helpers that #6713 removed with itAlso deleted:
products/maka/cli/src/acp/tests/{protocol,provider}.rs. Theirtests.rs,support.rsandpublic_client.rsno longer exist, so nothing can include them.Not included
plugins/workspace/workspace-computer/native/src/evaluate/browser_handoff_test.rsstays as it is. It no longer compiles: it importsbrowser_access::tests::Fixture, an 855-line inline test module that #6713 deleted. It is a hardware smoke test (#[ignore], needs a real browser and a connected ChatGPT extension) driven byscripts/rust/browser-handoff-smoke.py, and CI never ran it. I cannot verify a port without that hardware, so I did not attempt one. Consequence to know about: that script cannot run until the test is ported.Verification
Local, macOS aarch64, stable 1.99.1:
cargo nextest runonmaka-fs-toolsandmaka-cli(lib and bins): 95 passed, 0 failed.cargo nextest run --libonmaka-capabilities,maka-computer-use(native-desktop),maka-host-runtime,maka-tool-catalog,maka-decisions-api,maka-fs-tools: 226 passed, 0 failed, 4 skipped (before thebaselineandfilesadditions).candidates.rsmakeslisting_keeps_hidden_raw_names_...fail again (4 passed, 1 failed); with the fix 5 of 5 pass.cargo check --locked --workspace --all-targets: finished, 24 warnings, same as before.rustfmt --checkon touched files: clean.Not run locally: Windows and Linux builds, the full integration suites.
Review focus
audit(npm picomatch advisory),nsh(3nsh-baserich-editor tests),root-tests rest-1 slice 1/2(models_settings_unifies_sources_without_inline_layout_jumps), andnative-macos/native-windows(desktop_composer_previews_markdown_and_sends_its_source). Each fails identically on recentrust-previewpush builds.AI use
Tool(s) and scope: Claude Code found the unreferenced files from git history, restored the declarations, ran the tests, traced the failure to #6974 and wrote the fix. Commits carry
Generated-by: Claude Code. Maka added and verified the cross-directory fix and regression test.Checklist
Does this PR entail a change in behavior?
中文
概要:#6713 摘掉了 93 条
mod tests;并删了 367 个测试文件,其中 13 个文件只摘了声明、文件留了下来,所以它们的测试自 11-10 起没有被编译或运行过。恢复它们后立刻发现了一个后来引入的回归,所以本 PR 把"恢复测试"和"修它暴露的回归"放在一起,自成闭环。1. 修复:#6974(11-17)把
workspace-files里各忽略文件的匹配器合并进同一个GitignoreBuilder,加入顺序是.rgignore、.ignore、.gitignore。ignorecrate 里后加入的规则优先,优先级被反转,.rgignore里的!keep.cache不再能救回.gitignore里*.cache排除的文件。修复后,搜索依次检查 .rgignore、.ignore、.gitignore、.git/info/exclude。同一来源内,较深目录的匹配规则优先。2. 恢复 10 个测试模块(共 30 个测试,见上表),并删除
acp/tests/{protocol,provider}.rs两个残骸。未包含:
browser_handoff_test.rs不动。它依赖被 #6713 删除的 855 行内联夹具,是需要真实浏览器和 ChatGPT 扩展的硬件冒烟测试(#[ignore],CI 从不运行),由scripts/rust/browser-handoff-smoke.py手动驱动。没有硬件我无法验证移植,所以没有尝试;代价是该脚本在测试被移植前无法运行。验证:
maka-fs-tools和maka-cli测试 95 个通过;仅撤回candidates.rs修复时测试重新失败(4 通过 1 失败),修复后 5/5 通过;全 workspace--all-targets编译通过,警告数 24 与改动前一致;格式检查通过。未在本地跑 Windows/Linux 和完整集成测试。评审重点:
audit、nsh(3 个编辑器测试)、root-tests rest-1(1 个 workbench 布局测试)、native-macos/native-windows(同一个 desktop markdown 预览测试)。它们在近期rust-preview的 push 构建上同样失败。🤖 Generated with Claude Code