test(node): cover the component walk in validated_repo_disk_path (#411) - #441
test(node): cover the component walk in validated_repo_disk_path (#411)#441beardthelion wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Essentials Run ID: 📒 Files selected for processing (1)
Included review availability: 3 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour. 📝 WalkthroughWalkthroughThe change adds tests for ChangesRepository path validation
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~5 minutes Change: Other Suggested reviewers: Merge Risk: ⚪ Minimal · up to The tests provide the intended component-walk coverage, including current-directory rejection, parent-directory rejection, and clean-path acceptance. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Greptile SummaryThis PR adds focused regression coverage for the component walk in
Confidence Score: 5/5The PR appears safe to merge; the added tests directly cover the intended component-walk branches without changing production behavior. Both malformed
|
| Filename | Overview |
|---|---|
| crates/gitlawb-node/src/git/repo_store.rs | Adds sound positive and negative tests that directly exercise the previously uncovered Component::ParentDir and Component::CurDir validation branches. |
Reviews (1): Last reviewed commit: "test(node): cover the component walk in ..." | Re-trigger Greptile
Summary
Closes #411.
validated_repo_disk_pathhas three layers and the existing tests only exercised the first: every traversal input goes throughowner_did/repo_name, whichvalidate_path_componentsrefuses before thestarts_withcheck and theComponentwalk run. The walk was unfalsifiable; the issue demonstrated that emptying theParentDirarm left the suite green.The walk is reachable through
repos_diritself: the allowlist never sees it,PathBuf::joindoes not normalize it, and the component-wisestarts_withstill matches the unnormalized prefix, soParentDir/CurDirland on the walk. Three tests:repos_dircontaining..is rejected by theParentDirarm, a relativerepos_dirstarting with.is rejected by theCurDirarm (interior.segments are dropped bycomponents()and never reach the walk, so the leading-dot relative path is the shape that covers it), and a cleanrepos_dirresolves.Test plan
cargo test -p gitlawb-node repo_storepasses, including the three new tests.cargo test --workspacegreen (one unrelated coalesced-push announce test flaked under concurrent-suite load and passed on an isolated rerun).cargo clippy --workspace --all-targets -- -D warningsclean via the pre-push gate.Notes
make_store's signature and touches this tests module at different anchors; these tests callvalidated_repo_disk_pathdirectly, so no compile dependency and no shared lines. The test-module addition in feat(node): per-IP write-surface rate brake + purge-spam admin tool #196 sits on a different base at a different anchor; adjacency risk only.Summary by CodeRabbit