Repository navigation
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed October 1, 2026, 9:23 AM ET / 13:23 UTC. ClawSweeper reviewWhat this changesThe PR shares native test fixture helpers and parameterizes archive codec, cancellation, and descriptor-rejection cases while preserving their assertions. Merge readiness✅ Ready for maintainer review Keep open: this is a useful, bounded test refactor that is not already on main. Inspection of all introduced hunks found no actionable correctness defect. Likely related people: steipete and Jason (Json), suggested from recent merged native-code history. Priority: P3 Review scores
Verification
How this fits togetherThe native Rust layer implements filesystem and archive operations for fs-safe's Node.js API. Its tests construct temporary filesystem fixtures and exercise platform-specific safety checks. flowchart TD
A[Native test cases] --> B[Shared fixture helpers]
B --> C[Temporary files and directories]
A --> D[Codec and descriptor cases]
C --> E[Native filesystem and archive operations]
D --> E
E --> F[Safety assertions and cleanup]
Before mergeNone. Agent review detailsSecurityNone. Review metrics
Technical reviewBest possible solution: Keep fixture construction shared while retaining platform-specific roots, permissions, handle flags, assertions, and cleanup ownership. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR consolidates existing tests rather than reporting a runtime defect; source comparison preserves the exercised cases. Is this the best way to solve the issue? Yes: test-only helpers remove repetition while leaving platform setup and safety assertions with their existing callers. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 167673bc7724. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
…ptor cases (#806) Share one cfg(test) temp-path builder and the Windows test directory opener across 20 native test modules, replace six TAR codec fixture arrays with one helper, and parameterize the cancellation and descriptor-rejection twins. All 188 Rust test names are unchanged; Rust test code only, net -247 lines.
…ptor cases (#806) Share one cfg(test) temp-path builder and the Windows test directory opener across 20 native test modules, replace six TAR codec fixture arrays with one helper, and parameterize the cancellation and descriptor-rejection twins. All 188 Rust test names are unchanged; Rust test code only, net -247 lines.
What Problem This Solves
The native crate's inline test modules (8,200 of its 20,500 lines) re-implemented the same fixture utilities: 34 copies of a unique temp-path builder across 20 files, five copies of a Windows test directory opener, six identical TAR codec fixture arrays, four single-purpose cancellation wrappers, and source/target twins of the same descriptor-rejection checks.
User Impact
No user-visible change; Rust test code only (production Rust and TypeScript unchanged).
Why This Change Was Made
native/src/test_support.rs(cfg(test)) providesunique_path_in/temp_pathwith one naming implementation and the existing Windowsdirectoryopener, used only at call sites with identical access, sharing, and backup-semantics flags. Each caller keeps its own base directory (includingFS_SAFE_CLONE_TEST_ROOT), ACL setup, ownership, and cleanup timing.encoded_tar_variantshelper replaces six codec arrays in their original order; the four raw-refill cancellation tests stay separately named through a small matrix that keeps real file-backed execution.i32::MAXdescriptor rejections run from one parameterized body, with the isolated subprocess cases unchanged.Net -247 lines.
Evidence
cargo test --workspace --locked: 188 passed;-- --listnames identical before and after (native 138, archive-core 50). Per-file all-cfg case counts are unchanged, including Windows- and Linux-only modules.No new clippy diagnostics.
Windows-only test code is compiled and run by the
Native check (windows-latest)job (local cross-check stops atzstd-sysC headers on macOS).Codex autoreview (P0-P2): clean.
Tests added or updated when behavior changed
Security and compatibility impact considered
CHANGELOG.mdupdated when release-relevantNo credentials, private paths, private hosts, or sensitive contents included