refactor(deps): remove orpc facade from client trees - #1459
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors client/CLI/minimal SDK dependency paths to avoid the top-level orpc facade by switching imports/manifests to the split crates (orpc-error, orpc-runtime, orpc-net, orpc-rpc, plus curvine-io / curvine-sys). This aligns with the crate split and helps prevent unintended heavyweight/native deps from leaking into lightweight client artifacts (per #1243).
Changes:
- Replaced
orpc::*imports across CLI, SDK, and client crates with explicit split-crate imports. - Moved/shared error/result helper macros into
orpc-errorand updated call sites to useorpc_error::*. - Added an RPC test helper (
SimpleServer) underorpc-rpc::testfor crates needing RPC wiring in tests without the facade.
Reviewed changes
Copilot reviewed 134 out of 135 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| curvine-common/macros/src/client_cli.rs | Derive output now targets orpc_error result/error helpers instead of orpc. |
| curvine-common/macros/Cargo.toml | Dev-deps updated to use orpc-error instead of orpc. |
| curvine-cli/src/util.rs | Switches CommonResult/err_box imports to orpc_error. |
| curvine-cli/src/main.rs | Replaces orpc facade imports with split crates (orpc_error, orpc_net, orpc_runtime). |
| curvine-cli/src/cmds/umount.rs | Switches CommonResult to orpc_error. |
| curvine-cli/src/cmds/transfer.rs | Switches CommonResult/err_box to orpc_error. |
| curvine-cli/src/cmds/report.rs | Switches CommonResult to orpc_error. |
| curvine-cli/src/cmds/node.rs | Splits ByteUnit to orpc_runtime and errors to orpc_error. |
| curvine-cli/src/cmds/mount.rs | Splits ByteUnit/DurationUnit to orpc_runtime and errors to orpc_error. |
| curvine-cli/src/cmds/load.rs | Switches CommonResult/err_box to orpc_error. |
| curvine-cli/src/cmds/load_status.rs | Switches CommonResult to orpc_error. |
| curvine-cli/src/cmds/load_cancel.rs | Switches CommonResult to orpc_error. |
| curvine-cli/src/cmds/fs/touch.rs | Switches CommonResult to orpc_error. |
| curvine-cli/src/cmds/fs/stat.rs | Splits units to orpc_runtime and errors to orpc_error. |
| curvine-cli/src/cmds/fs/rm.rs | Switches CommonResult to orpc_error. |
| curvine-cli/src/cmds/fs/put.rs | Switches CommonResult to orpc_error. |
| curvine-cli/src/cmds/fs/mv.rs | Switches CommonResult to orpc_error. |
| curvine-cli/src/cmds/fs/mkdir.rs | Moves sys calls from orpc::sys to curvine_sys; errors to orpc_error. |
| curvine-cli/src/cmds/fs/ls.rs | Moves sys calls to curvine_sys; units to orpc_runtime; errors to orpc_error. |
| curvine-cli/src/cmds/fs/get.rs | Switches CommonResult to orpc_error. |
| curvine-cli/src/cmds/fs/free.rs | Moves ByteUnit to orpc_runtime; errors to orpc_error. |
| curvine-cli/src/cmds/fs/du.rs | Switches CommonResult to orpc_error. |
| curvine-cli/src/cmds/fs/df.rs | Switches CommonResult to orpc_error. |
| curvine-cli/src/cmds/fs/count.rs | Switches CommonResult to orpc_error. |
| curvine-cli/src/cmds/fs/common.rs | Switches CommonResult to orpc_error. |
| curvine-cli/src/cmds/fs/commands.rs | Switches CommonResult to orpc_error. |
| curvine-cli/src/cmds/fs/chown.rs | Switches CommonResult to orpc_error. |
| curvine-cli/src/cmds/fs/chmod.rs | Switches CommonResult to orpc_error. |
| curvine-cli/src/cmds/fs/cat.rs | Switches CommonResult to orpc_error. |
| curvine-cli/src/cmds/fs/blocks.rs | Moves ByteUnit to orpc_runtime; errors to orpc_error. |
| curvine-cli/src/cmds/export.rs | Switches CommonResult/err_box to orpc_error. |
| curvine-cli/src/cmds/bench/output.rs | Moves ByteUnit to orpc_runtime. |
| curvine-cli/src/cmds/bench.rs | Moves ByteUnit to orpc_runtime; errors to orpc_error. |
| curvine-cli/Cargo.toml | Replaces orpc dependency with explicit split-crate deps + curvine-sys. |
| crates/sdk/curvine-sdk-core/src/lib_fs_writer.rs | Moves DataSlice to curvine_io, RPC/Runtime to split crates, errors to orpc_error. |
| crates/sdk/curvine-sdk-core/src/lib_fs_reader.rs | Moves DataSlice to curvine_io, runtime to orpc_runtime. |
| crates/sdk/curvine-sdk-core/src/lib_curvine.rs | Switches builder errors to orpc_error::err_box!. |
| crates/sdk/curvine-sdk-core/src/filesystem_conf.rs | Moves log/net/error helpers to split crates. |
| crates/sdk/curvine-sdk-core/src/core/session.rs | Moves Logger/Runtime imports to orpc_runtime. |
| crates/sdk/curvine-sdk-core/src/core/master.rs | Moves RpcRuntime import to orpc_runtime. |
| crates/sdk/curvine-sdk-core/src/core/job.rs | Moves RpcRuntime import to orpc_runtime. |
| crates/sdk/curvine-sdk-core/src/core/filesystem.rs | Moves RpcRuntime and runtime type to orpc_runtime. |
| crates/sdk/curvine-sdk-core/Cargo.toml | Replaces orpc with explicit split crates + adds curvine-io. |
| crates/sdk/curvine-libsdk-python/src/python/python_abi.rs | Moves FFI + slice types from orpc::sys to curvine_sys/curvine_io. |
| crates/sdk/curvine-libsdk-python/Cargo.toml | Replaces orpc with curvine-io + curvine-sys. |
| crates/sdk/curvine-libsdk-java/src/java/java_utils.rs | Switches CommonResult to orpc_error. |
| crates/sdk/curvine-libsdk-java/src/java/java_filesystem.rs | Switches error helpers to orpc_error. |
| crates/sdk/curvine-libsdk-java/src/java/java_abi.rs | Moves FFIUtils to curvine_sys. |
| crates/sdk/curvine-libsdk-java/Cargo.toml | Replaces orpc with orpc-error + adds curvine-sys. |
| crates/infra/orpc-rpc/src/test/simple_server.rs | Adds SimpleServer RPC test helper and handler implementation. |
| crates/infra/orpc-rpc/src/test/mod.rs | Exposes the new SimpleServer from the orpc_rpc::test module. |
| crates/infra/orpc-rpc/src/lib.rs | Exports new test module from orpc-rpc. |
| crates/infra/orpc-error/src/lib.rs | Adds exported error/result helper macros previously accessed via facade. |
| crates/common/curvine-ufs-api/src/lib.rs | Re-exports orpc_error and updates err_ufs! to resolve via $crate. |
| crates/common/curvine-ufs-api/src/fs/channel_transfer.rs | Moves async channel types to orpc_runtime::sync::channel. |
| crates/common/curvine-ufs-api/src/conf.rs | Moves duration units to orpc_runtime; errors to orpc_error. |
| crates/common/curvine-ufs-api/Cargo.toml | Replaces orpc with orpc-error + orpc-runtime. |
| crates/common/curvine-model/src/worker_info.rs | Moves LocalTime to orpc_runtime. |
| crates/common/curvine-model/src/worker_address.rs | Moves InetAddr to orpc_net. |
| crates/common/curvine-model/src/ttl_action.rs | Moves error helpers to orpc_error. |
| crates/common/curvine-model/src/transfer.rs | Moves Utils to orpc_runtime. |
| crates/common/curvine-model/src/storage_info.rs | Moves error helpers to orpc_error. |
| crates/common/curvine-model/src/proto_utils.rs | Moves try_err/CommonResult to orpc_error. |
| crates/common/curvine-model/src/opts.rs | Moves sys module to curvine_sys and units to orpc_runtime. |
| crates/common/curvine-model/src/mount.rs | Moves duration units to orpc_runtime and results/errors to orpc_error. |
| crates/common/curvine-model/src/lib.rs | Updates public trait signature to return orpc_error::CommonResult. |
| crates/common/curvine-model/src/job.rs | Moves ByteUnit to orpc_runtime (including tests). |
| crates/common/curvine-model/src/file_status.rs | Moves LocalTime to orpc_runtime and ternary! to orpc_error. |
| crates/common/curvine-model/src/file_alloc.rs | Moves error helper macros to orpc_error. |
| crates/common/curvine-model/src/block_info.rs | Moves FastHashMap/ByteUnit to orpc_runtime and errors to orpc_error. |
| crates/common/curvine-model/Cargo.toml | Replaces orpc with split crates + adds curvine-sys. |
| crates/common/curvine-fs-api/src/writer.rs | Moves DataSlice to curvine_io and runtime/errors to split crates. |
| crates/common/curvine-fs-api/src/reader.rs | Moves DataSlice to curvine_io and runtime to orpc_runtime. |
| crates/common/curvine-fs-api/src/path.rs | Switches CommonResult to orpc_error (including tests). |
| crates/common/curvine-fs-api/src/local/mod.rs | Moves LocalFile to curvine_io. |
| crates/common/curvine-fs-api/src/local/local_writer.rs | Moves IO types to curvine_io, errors to orpc_error, utils to orpc_runtime. |
| crates/common/curvine-fs-api/src/local/local_reader.rs | Moves IO types to curvine_io. |
| crates/common/curvine-fs-api/src/local/local_filesystem.rs | Switches err_box to orpc_error. |
| crates/common/curvine-fs-api/src/lib.rs | Updates CurvinePath impl to return orpc_error::CommonResult. |
| crates/common/curvine-fs-api/src/filesystem.rs | Switches err_box to orpc_error. |
| crates/common/curvine-fs-api/Cargo.toml | Replaces orpc with split crates + adds curvine-io. |
| crates/common/curvine-error/src/fs_error.rs | Moves error traits/types to orpc_error and IO error type to curvine_io. |
| crates/common/curvine-error/Cargo.toml | Replaces orpc with orpc-error + curvine-io. |
| crates/common/curvine-config/src/transfer_conf.rs | Moves ServerConf to orpc_rpc and units to orpc_runtime. |
| crates/common/curvine-config/src/job_conf.rs | Moves err_box to orpc_error and units to orpc_runtime. |
| crates/common/curvine-config/src/fuse_conf.rs | Moves sys/ffi to curvine_sys; errors to orpc_error; utils to orpc_runtime. |
| crates/common/curvine-config/src/cluster_conf.rs | Moves net/retry/rpc/runtime/log/error helpers to split crates. |
| crates/common/curvine-config/src/client_conf.rs | Moves rpc/net/utils/results to split crates. |
| crates/common/curvine-config/src/cli_conf.rs | Moves LogConf to orpc_runtime. |
| crates/common/curvine-config/Cargo.toml | Replaces orpc with split crates + adds curvine-sys. |
| crates/client/curvine-unified-fs/src/unified/unified_filesystem.rs | Moves runtime/time utils to orpc_runtime and errors to orpc_error. |
| crates/client/curvine-unified-fs/src/unified/mount_cache.rs | Moves maps/time/runtime/sync primitives to split crates. |
| crates/client/curvine-unified-fs/src/unified/mod.rs | Switches err_box to orpc_error. |
| crates/client/curvine-unified-fs/src/unified/macros.rs | Updates generated types from orpc::sys::DataSlice/runtime to curvine_io + orpc_runtime. |
| crates/client/curvine-unified-fs/src/unified/fallback_fs_reader.rs | Moves DataSlice to curvine_io and error trait import to orpc_error. |
| crates/client/curvine-unified-fs/Cargo.toml | Drops orpc, adds curvine-io + orpc-error + orpc-runtime. |
| crates/client/curvine-job-client/src/transfer_client.rs | Moves RPC client types to orpc_rpc and runtime to orpc_runtime. |
| crates/client/curvine-job-client/src/lib.rs | Moves TimeSpent to orpc_runtime and err_box to orpc_error. |
| crates/client/curvine-job-client/Cargo.toml | Replaces orpc with split crates. |
| crates/client/curvine-client-core/tests/block_client_pool_test.rs | Uses orpc_rpc::test::SimpleServer + runtime from orpc_runtime. |
| crates/client/curvine-client-core/src/lib.rs | Moves DataSlice to curvine_io. |
| crates/client/curvine-client-core/src/file/fs_writer.rs | Moves DataSlice to curvine_io, errors to orpc_error, units to orpc_runtime. |
| crates/client/curvine-client-core/src/file/fs_writer_buffer.rs | Moves IO types to curvine_io and runtime/sync to orpc_runtime. |
| crates/client/curvine-client-core/src/file/fs_writer_base.rs | Moves DataSlice to curvine_io and runtime/collections to split crates. |
| crates/client/curvine-client-core/src/file/fs_reader.rs | Moves DataSlice to curvine_io, errors to orpc_error, units to orpc_runtime. |
| crates/client/curvine-client-core/src/file/fs_reader_parallel.rs | Switches err_box to orpc_error. |
| crates/client/curvine-client-core/src/file/fs_reader_buffer.rs | Moves runtime/sync to orpc_runtime and errors to orpc_error. |
| crates/client/curvine-client-core/src/file/fs_reader_base.rs | Moves DataSlice to curvine_io, runtime to orpc_runtime, errors to orpc_error. |
| crates/client/curvine-client-core/src/file/fs_context.rs | Moves IO/cache to curvine_io and RPC/net/runtime to split crates. |
| crates/client/curvine-client-core/src/file/fs_client.rs | Moves message/client to orpc_rpc, runtime to orpc_runtime, errors to orpc_error. |
| crates/client/curvine-client-core/src/file/curvine_filesystem.rs | Moves RPC client conf to orpc_rpc, runtime to orpc_runtime, errors to orpc_error. |
| crates/client/curvine-client-core/src/client_metrics.rs | Moves metrics/time/maps to orpc_runtime and CommonResult to orpc_error. |
| crates/client/curvine-client-core/src/block/block_writer.rs | Moves error traits to orpc_error and runtime to orpc_runtime; DataSlice to curvine_io. |
| crates/client/curvine-client-core/src/block/block_writer_remote.rs | Moves Utils to orpc_runtime, errors to orpc_error, DataSlice to curvine_io. |
| crates/client/curvine-client-core/src/block/block_writer_local.rs | Moves IO/sys primitives to curvine_io/curvine_sys and runtime/errors to split crates. |
| crates/client/curvine-client-core/src/block/block_reader.rs | Moves error traits/results to orpc_error, runtime to orpc_runtime, DataSlice to curvine_io. |
| crates/client/curvine-client-core/src/block/block_reader_remote.rs | Moves Utils to orpc_runtime, errors to orpc_error, DataSlice to curvine_io. |
| crates/client/curvine-client-core/src/block/block_reader_local.rs | Moves IO/sys primitives to curvine_io/curvine_sys and runtime/errors to split crates. |
| crates/client/curvine-client-core/src/block/block_reader_hole.rs | Moves DataSlice to curvine_io, errors to orpc_error. |
| crates/client/curvine-client-core/src/block/block_client.rs | Moves RPC/message to orpc_rpc, time to orpc_runtime, errors/helpers to orpc_error, DataSlice to curvine_io. |
| crates/client/curvine-client-core/src/block/block_client_pool.rs | Moves time/sync to orpc_runtime and IOResult to curvine_io. |
| crates/client/curvine-client-core/src/block/batch_block_writer.rs | Switches err_box to orpc_error. |
| crates/client/curvine-client-core/src/block/batch_block_writer_remote.rs | Moves Utils to orpc_runtime, errors to orpc_error. |
| crates/client/curvine-client-core/src/block/batch_block_writer_local.rs | Moves IO/sys primitives to curvine_io/curvine_sys and runtime to orpc_runtime. |
| crates/client/curvine-client-core/Cargo.toml | Replaces orpc with split crates + adds curvine-io/curvine-sys. |
| crates/client/curvine-bench/src/workload.rs | Switches error helpers/results to orpc_error. |
| crates/client/curvine-bench/src/suites.rs | Switches CommonResult to orpc_error. |
| crates/client/curvine-bench/src/seed.rs | Switches CommonResult to orpc_error. |
| crates/client/curvine-bench/src/runner.rs | Switches error helpers/results to orpc_error. |
| crates/client/curvine-bench/src/paths.rs | Switches error helpers/results to orpc_error. |
| crates/client/curvine-bench/src/ops.rs | Switches CommonResult to orpc_error. |
| crates/client/curvine-bench/src/config.rs | Switches error helpers/results to orpc_error. |
| crates/client/curvine-bench/src/backend.rs | Switches error helpers/results to orpc_error. |
| crates/client/curvine-bench/Cargo.toml | Replaces orpc with orpc-error. |
| Cargo.lock | Updates resolved dependency graph to reflect split-crate dependencies. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
18
to
+22
| pub mod client; | ||
| pub mod handler; | ||
| pub mod message; | ||
| pub mod server; | ||
| pub mod test; |
Comment on lines
+37
to
+41
| let id = msg.req_id(); | ||
| if self.mock && !self.call_map.contains_key(&id) { | ||
| self.call_map.insert(id, 1); | ||
| return orpc_error::err_box!("please retry"); | ||
| } |
| Some(bytes) => String::from_utf8_lossy(bytes).to_string(), | ||
| }; | ||
|
|
||
| let rep_str = req_str.to_uppercase().to_string(); |
jlon
approved these changes
Aug 3, 2026
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
Remove the top-level
orpcfacade from the lightweight client, CLI, and minimal SDK dependency paths. The affected crates now depend on the splitorpc-*,curvine-io, andcurvine-syscrates directly. This also avoids reading local OS user/group information as a fallback for CLIlsoutput, which keeps CodeQL from treating the output path as sensitive cleartext logging.Issue Describe / Design
Related to #1243
Root cause: after the crate split, lightweight client-side crates still used the
orpcfacade for error helpers, runtime/common utilities, RPC types, net types, sys primitives, and I/O primitives. That keptorpcincurvine-cliand minimal SDK dependency trees even though direct split crates were already available.CodeQL root cause: when file owner/group metadata was empty,
curvine-clifell back to the local process user and group names before printinglsoutput. CodeQL flagged that local username flow as cleartext logging of sensitive information.Fix approach:
orpc-error.orpcimports to explicit split crates.SimpleServertest helper toorpc-rpc::testso client-core tests no longer need the facade.err_ufs!macro resolveorpc-errorthroughcurvine-ufs-apiitself.-placeholder for missing CLIlsowner/group metadata instead of reading local OS user/group information.Changes
crates/infra/orpc-errororpc.crates/common/curvine-*orpcdependencies withorpc-error,orpc-runtime,orpc-net,orpc-rpc,curvine-io, andcurvine-sysas needed.crates/client/*,curvine-cliorpcimports and manifests with explicit split crates.curvine-clino longer includesorpcin its normal dependency tree.curvine-cli/src/cmds/fs/ls.rs-when owner/group metadata is absent, instead of falling back to the local OS user/group.lsoutput.crates/sdk/*orpcusage in SDK core, Java binding, and Python binding paths.orpc.crates/infra/orpc-rpc/src/testSimpleServertest helper for crates that need RPC test wiring without depending on the facade.crates/common/curvine-ufs-apierr_ufs!resolveorpc-errorvia$crate.Test verified
make formatcargo metadata --format-version 1 --no-depsscripts/check-deps.sh --mode reportcurvine-cli-final-tree,curvine-libsdk-java-min-final-tree, andcurvine-libsdk-python-min-final-treeare OK; remaining warnings are server/fuse/adapter facade debt.cargo check -p curvine-cli -p curvine-libsdk --no-default-features --features java-sdk,python-sdkcargo check -p curvine-client-core -p orpc-rpc --all-targetscargo check -p curvine-cli --all-targetscargo check -p curvine-libsdk --all-targets --no-default-features --features java-sdk,python-sdkcargo check -p curvine-common-macros --all-targets::orpc.cargo check -p curvine-error -p curvine-model -p curvine-fs-api -p curvine-config -p curvine-ufs-api -p curvine-bench -p curvine-job-client -p curvine-unified-fs --all-targetscargo check -p curvine-ufs-opendalerr_ufs!macro from downstream adapter usage.git diff --checkDependencies