Skip to content

test(cli): cover top-level event parser aliases#125

Draft
overtrue wants to merge 1 commit intomainfrom
codex/top-level-event-parser-gap
Draft

test(cli): cover top-level event parser aliases#125
overtrue wants to merge 1 commit intomainfrom
codex/top-level-event-parser-gap

Conversation

@overtrue
Copy link
Copy Markdown
Contributor

Summary

This adds focused parser coverage for the deprecated top-level rc event entrypoints that were rewired through EventArgs in the recent command-surface updates.

The current parser tests cover nested rc bucket event ... forms and one top-level rc event list ... compatibility path, but they do not assert that the top-level add and remove flows still deserialize correctly. That leaves a regression gap around the exact deprecated aliases users may still invoke after the Commands::Event(event::EventArgs) wiring change.

Root cause

Coverage stopped at the list alias. The parser test suite did not exercise the more argument-heavy top-level event add and event remove branches, so a clap wiring regression there could go unnoticed while adjacent tests still passed.

Fix

Add two parser tests in crates/cli/src/commands/mod.rs that verify:

  • rc event add <path> <arn> --event put,delete --force
  • rc event remove <path> <arn> --force

Both assertions confirm the top-level deprecated entrypoint still resolves through EventArgs, preserves the expected positional arguments, and forwards the --force and --event flags.

Validation

I ran these successfully:

  • cargo test -p rustfs-cli cli_accepts_top_level_event_ --lib
  • cargo fmt --all --check
  • cargo clippy --workspace -- -D warnings
  • cargo test --workspace

I also attempted make pre-commit because the automation requires it, but origin/main does not define a pre-commit target, so make exits with No rule to make target 'pre-commit'.

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.

1 participant