fix(webdav): preserve canonical DavPath transforms - #28
Conversation
|
Warning Review limit reached
Next review available in: 46 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (8)
📝 WalkthroughWalkthroughChangesWebDAV 路径转换现在区分编码请求输入与解码后的规范路径。新增 WebDAV 规范路径转换
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related issues
Possibly related PRs
Suggested labels: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Downstream AsterDrive migration follow-up: AsterCommunity/AsterDrive#468 |
7fc22aa to
3bd03ab
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
crates/aster_forge_webdav/src/path.rs (1)
177-177: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win明确根路径的返回值。
parent是公共 API。文档应明确:当self是 mount root 时,该方法返回None。As per coding guidelines,公共 Rust API 必须有明确边界。
建议修改
- /// Returns the canonical parent collection without reparsing decoded path data. + /// Returns the canonical parent collection without reparsing decoded path data. + /// + /// Returns `None` when this path is the `WebDAV` mount root.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@crates/aster_forge_webdav/src/path.rs` at line 177, Update the documentation for the public parent method to explicitly state that it returns None when self is the mount root, while retaining the existing description of returning the canonical parent collection without reparsing decoded path data.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/aster_forge_webdav/tests/guard.rs`:
- Line 699: Update the test around the directories assertion and metadata lookup
so the literal-percent path is tested independently: use a TestFileSystem
containing only "/folder%2F/" (or capture and assert the metadata query path),
ensuring an erroneous decode to "/folder/" cannot still return Ok(()). Preserve
the existing behavior assertions for the canonical "/folder%2F/" path.
---
Nitpick comments:
In `@crates/aster_forge_webdav/src/path.rs`:
- Line 177: Update the documentation for the public parent method to explicitly
state that it returns None when self is the mount root, while retaining the
existing description of returning the canonical parent collection without
reparsing decoded path data.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: c94ae4e3-3dae-4666-8be8-ef45f1b4a244
📒 Files selected for processing (8)
crates/aster_forge_webdav/src/lock.rscrates/aster_forge_webdav/src/mutation.rscrates/aster_forge_webdav/src/path.rscrates/aster_forge_webdav/src/resource.rscrates/aster_forge_webdav/tests/guard.rscrates/aster_forge_webdav/tests/mutation.rscrates/aster_forge_webdav/tests/protocol.rsdocs/crates/aster_forge_webdav.md
|
Addressed both current review findings in e1ee9fd:
Validation:
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Summary
DavPath::parentandDavPath::join_childtransformations%,%FF,%2F,%5C, and%2E%2Ebackend names with stable collection trailing-slash semanticsBoundary
DavPath::newanddecode_relative_pathremain the encoded request-input boundary. Canonical parent and decoded backend child transformations constructDavPathvalues directly and never percent-decode canonical data again.Validation
cargo test -p aster_forge_webdavcargo test -p aster_forge_webdav --features actixcargo clippy -p aster_forge_webdav --all-targets --all-features -- -D warningscargo check --workspacecargo fmt --all -- --checkperl scripts/check-lint-attributes.plgit diff --checkCloses #27
Summary by CodeRabbit
功能改进
%、%2F、%5C和%2E%2E的文件及目录名称。.、..及包含路径分隔符的非法子名称,提升路径安全性。文档
测试