Skip to content

refactor(deps): remove orpc facade from client trees - #1459

Merged
jlon merged 2 commits into
mainfrom
feat/facade-dependency-cleanup
Aug 3, 2026
Merged

refactor(deps): remove orpc facade from client trees#1459
jlon merged 2 commits into
mainfrom
feat/facade-dependency-cleanup

Conversation

@lzjqsdd

@lzjqsdd lzjqsdd commented Aug 2, 2026

Copy link
Copy Markdown
Member

Summary

Remove the top-level orpc facade from the lightweight client, CLI, and minimal SDK dependency paths. The affected crates now depend on the split orpc-*, curvine-io, and curvine-sys crates directly. This also avoids reading local OS user/group information as a fallback for CLI ls output, 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 orpc facade for error helpers, runtime/common utilities, RPC types, net types, sys primitives, and I/O primitives. That kept orpc in curvine-cli and minimal SDK dependency trees even though direct split crates were already available.

CodeQL root cause: when file owner/group metadata was empty, curvine-cli fell back to the local process user and group names before printing ls output. CodeQL flagged that local username flow as cleartext logging of sensitive information.

Fix approach:

  • Move shared error/result helper macros to orpc-error.
  • Switch common/API, client-core, job-client, unified-fs, bench, CLI, and SDK crates from orpc imports to explicit split crates.
  • Move the lightweight SimpleServer test helper to orpc-rpc::test so client-core tests no longer need the facade.
  • Make the exported err_ufs! macro resolve orpc-error through curvine-ufs-api itself.
  • Use a fixed - placeholder for missing CLI ls owner/group metadata instead of reading local OS user/group information.

Changes

Module / File Change Impact on existing behavior
crates/infra/orpc-error Adds exported error/result helper macros previously reached through orpc. No runtime behavior change; enables direct imports from the split error crate.
crates/common/curvine-* Replaces orpc dependencies with orpc-error, orpc-runtime, orpc-net, orpc-rpc, curvine-io, and curvine-sys as needed. Keeps public types and behavior intact while removing the facade from light API trees.
crates/client/*, curvine-cli Replaces orpc imports and manifests with explicit split crates. curvine-cli no longer includes orpc in its normal dependency tree.
curvine-cli/src/cmds/fs/ls.rs Prints - when owner/group metadata is absent, instead of falling back to the local OS user/group. Behavior change: missing owner/group values no longer expose the local process user or group in ls output.
crates/sdk/* Replaces orpc usage in SDK core, Java binding, and Python binding paths. Minimal Java/Python SDK trees no longer include orpc.
crates/infra/orpc-rpc/src/test Adds SimpleServer test helper for crates that need RPC test wiring without depending on the facade. Test-only support path; production behavior unchanged.
crates/common/curvine-ufs-api Makes err_ufs! resolve orpc-error via $crate. Downstream adapter crates do not need a new macro-only dependency.

Test verified

Test case Result Notes
make format PASS Runs clippy fix, cargo fmt, and release clippy all-targets.
cargo metadata --format-version 1 --no-deps PASS Workspace metadata resolves.
scripts/check-deps.sh --mode report PASS curvine-cli-final-tree, curvine-libsdk-java-min-final-tree, and curvine-libsdk-python-min-final-tree are OK; remaining warnings are server/fuse/adapter facade debt.
cargo check -p curvine-cli -p curvine-libsdk --no-default-features --features java-sdk,python-sdk PASS Key CLI and minimal SDK paths.
cargo check -p curvine-client-core -p orpc-rpc --all-targets PASS Covers migrated RPC test helper.
cargo check -p curvine-cli --all-targets PASS CLI targets, rerun after the CodeQL follow-up fix.
cargo check -p curvine-libsdk --all-targets --no-default-features --features java-sdk,python-sdk PASS Minimal SDK all targets.
cargo check -p curvine-common-macros --all-targets PASS Derive macro no longer expands to ::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-targets PASS Common/API/client crates touched by the migration.
cargo check -p curvine-ufs-opendal PASS Verifies exported err_ufs! macro from downstream adapter usage.
`rg -n 'get_username_by_uid get_groupname_by_gid curvine_sys::get_uid
git diff --check PASS No whitespace errors.

Dependencies

@lzjqsdd
lzjqsdd marked this pull request as ready for review August 2, 2026 13:01
Copilot AI review requested due to automatic review settings August 2, 2026 13:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-error and updated call sites to use orpc_error::*.
  • Added an RPC test helper (SimpleServer) under orpc-rpc::test for 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
jlon merged commit ab26099 into main Aug 3, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants