Skip to content

refactor(fuse): generate mount CLI overrides from FuseConf (#1619) - #1624

Merged
szbr00 merged 2 commits into
CurvineIO:mainfrom
lzjqsdd:unified-conf-p4
Aug 31, 2026
Merged

refactor(fuse): generate mount CLI overrides from FuseConf (#1619)#1624
szbr00 merged 2 commits into
CurvineIO:mainfrom
lzjqsdd:unified-conf-p4

Conversation

@lzjqsdd

@lzjqsdd lzjqsdd commented Aug 25, 2026

Copy link
Copy Markdown
Member

Summary

Fourth PR of the stacked series for #1619 (4/7). Generates the curvine-fuse mount CLI overrides from FuseConf via the existing ClientCliArgs derive (opt-in mode), replacing ~30 hand-written if let Some(...) branches so the CLI surface cannot drift from the config struct.

Issue Describe / Design

Related to #1619 (partial). Depends on the stack #1620 -> #1622 -> #1623.

  • Derive macro extended with an alias option.
  • 27 historically tunable [fuse] fields annotated once; FuseConfCliOverrides is generated.
  • Hand-written args remain only where no 1:1 scalar mapping exists: --debug/--readonly (SetTrue), --options list, --master-addrs.
  • Deprecated --mnt-per-task spelling preserved as a clap alias; --meta-cache-ttl maps to meta_cache_timeout.

Changes

Module / File Change Impact on existing behavior
crates/common/curvine-macros/src/client_cli.rs Add alias support to generated #[arg]s None for existing users
crates/common/curvine-config/src/fuse_conf.rs Derive + opt-in annotations; export FuseConfCliOverrides None
curvine-fuse/src/cli/mount_args.rs Replace manual override branches with one apply_to call Known trade-off: generated flags lose per-flag help strings (restoration tracked as follow-up)
curvine-fuse/src/cli/fuse_cli.rs Test accessors updated (args.mount.fuse.*) Test-only

Test verified

Test case Result Notes
cargo test -p curvine-fuse --lib cli PASS (35) Includes legacy-alias and unset-flag-keeps-config-value cases
cargo test -p curvine-macros PASS

Dependencies

Comment thread crates/common/curvine-macros/src/client_cli.rs
Comment thread curvine-fuse/src/cli/mount_args.rs
@lzjqsdd
lzjqsdd changed the base branch from unified-conf-p3 to main August 28, 2026 09:50
Copilot AI lite review requested due to automatic review settings August 28, 2026 09:51

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

This PR refactors curvine-fuse mount to generate most [fuse] CLI override flags directly from FuseConf via the existing ClientCliArgs derive (opt-in), reducing manual override branches and keeping the CLI surface aligned with the config struct. It also extends the derive macro to support clap alias for deprecated flag spellings.

Changes:

  • Add alias support to the ClientCliArgs derive so generated clap args can keep deprecated flag names working.
  • Annotate historically tunable FuseConf fields (opt-in) and export FuseConfCliOverrides from curvine-config.
  • Replace ~30 hand-written FUSE override branches in mount_args with a single generated apply_to call; update CLI tests to access args.mount.fuse.*.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
curvine-fuse/src/cli/mount_args.rs Flatten generated FuseConfCliOverrides into mount args and apply overrides via one apply_to call; adjust tests accordingly.
curvine-fuse/src/cli/fuse_cli.rs Update CLI tests to reference generated mount overrides under args.mount.fuse.*.
crates/common/curvine-macros/src/lib.rs Document new #[client_cli(alias = \"...\")] field attribute.
crates/common/curvine-macros/src/client_cli.rs Implement alias parsing and emit #[arg(alias = ...)] on generated clap fields.
crates/common/curvine-config/src/lib.rs Re-export FuseConfCliOverrides alongside FuseConf.
crates/common/curvine-config/src/fuse_conf.rs Derive ClientCliArgs (opt-in) and annotate fields to generate FuseConfCliOverrides; preserve legacy flag alias mappings.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread crates/common/curvine-config/src/fuse_conf.rs
Comment thread curvine-fuse/src/cli/mount_args.rs
@lzjqsdd
lzjqsdd requested a review from szbr00 August 29, 2026 03:53
@szbr00
szbr00 merged commit e01cf91 into CurvineIO:main Aug 31, 2026
3 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