Mola-maker opened a new pull request, #9085:
URL: https://github.com/apache/opendal/pull/9085

   # Which issue does this PR close?
   
   Closes #9084.
   
   # Rationale for this change
   
   cacache, compfs, monoiofs, persy, redb, sled and hf3fs ignore the URI host, 
so `sled://tmp/data` silently uses `/data`. #9042 fixed this for `fs`.
   
   # What changes are included in this PR?
   
   - In each of these services' `from_uri`, return `ConfigInvalid` when the URI 
has a host other than `localhost` and the matching path option is not set 
explicitly. The option is `datadir` for cacache, redb and sled; `datafile` for 
persy; and `root` for compfs, monoiofs and hf3fs. The wording matches `fs`.
   - compfs and monoiofs now use `entry().or_insert_with`, so an explicit 
`root` option takes precedence over the URI path, as in `fs`.
   - Add a test to each crate: a host is rejected, `localhost` is accepted, and 
an explicit option wins. hf3fs gets its first test module.
   
   rocksdb and foundationdb have the same pattern. They are left out because 
they need native libraries I cannot build here.
   
   Verification (Windows 11, rustc 1.99.1):
   
   - `cargo test --lib` for cacache, compfs, persy, redb and sled: all pass, 
except compfs's `test_read_directory_returns_is_a_directory`, which already 
fails the same way on main on Windows.
   - The sled test fails on main.
   - hf3fs and monoiofs only build on Linux, so I only ran `cargo clippy 
--target x86_64-unknown-linux-gnu --all-targets -- -D warnings` for them 
(clean). CI will run their tests.
   - `cargo clippy --all-targets -- -D warnings` for the other five crates: 
clean.
   
   # Are there any user-facing changes?
   
   Yes. URIs for these services that include a host other than `localhost` now 
fail with `ConfigInvalid`, unless the path option is passed explicitly. Before, 
they silently used the path without the host. For compfs and monoiofs, an 
explicit `root` option now wins over the URI path.
   
   # Breaking changes
   
   # AI Usage Statement
   
   - Harness: Claude Code
   - Model: Anthropic Claude
   - Effort: default
   - Role: Found the pattern by auditing every service's `from_uri` after 
#9042, wrote the fix and the tests, and ran the checks above. A separate review 
pass checked the option key each service writes, hf3fs's host usage and the RFC 
5444 examples.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to