Skip to content

[ISSUE #6498]♻️Remove redundant _commands suffix from submodule names under commands/#6501

Merged
mxsm merged 1 commit intomxsm:mainfrom
WaterWhisperer:refactor-6498
Feb 24, 2026
Merged

[ISSUE #6498]♻️Remove redundant _commands suffix from submodule names under commands/#6501
mxsm merged 1 commit intomxsm:mainfrom
WaterWhisperer:refactor-6498

Conversation

@WaterWhisperer
Copy link
Contributor

@WaterWhisperer WaterWhisperer commented Feb 24, 2026

Which Issue(s) This PR Fixes(Closes)

Brief Description

How Did You Test This Change?

Summary by CodeRabbit

  • Refactor
    • Simplified internal module structure by reorganizing command module paths for improved code organization and maintainability across auth, broker, cluster, connection, consumer, controller, export, HA, nameserver, and topic commands.

@rocketmq-rust-bot
Copy link
Collaborator

🔊@WaterWhisperer 🚀Thanks for your contribution🎉!

💡CodeRabbit(AI) will review your code first🔥!

Note

🚨The code review suggestions from CodeRabbit are to be used as a reference only, and the PR submitter can decide whether to make changes based on their own judgment. Ultimately, the project management personnel will conduct the final code review💥.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 24, 2026

Walkthrough

Removes the redundant _commands suffix from 10 command submodules (auth, broker, cluster, connection, consumer, controller, export, ha, namesrv, topic) under src/commands/, updating all public module declarations, enum variants, and import paths throughout corresponding files.

Changes

Cohort / File(s) Summary
Core Commands Module
rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands.rs
Renamed 10 public module declarations from *_commands to * (e.g., auth_commandsauth); updated all enum variants and match arms in CommandExecute to reference new module paths.
Auth Submodule
rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/auth.rs, auth/get_acl_sub_command.rs, auth/get_user_sub_command.rs, auth/list_acl_sub_command.rs, auth/list_users_sub_command.rs, auth/update_acl_sub_command.rs
Updated import paths from crate::commands::auth_commands::... to crate::commands::auth::... across module file and all subcommand files; test imports adjusted accordingly.
Broker Submodule
rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/broker.rs
Updated 15 import paths from crate::commands::broker_commands::... to crate::commands::broker::....
Cluster Submodule
rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/cluster.rs
Updated 2 import paths from crate::commands::cluster_commands::... to crate::commands::cluster::....
Connection Submodule
rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/connection.rs
Updated 2 import paths from crate::commands::connection_commands::... to crate::commands::connection::....
Consumer Submodule
rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/consumer.rs, consumer/update_sub_group_sub_command.rs
Updated 7 import paths from crate::commands::consumer_commands::... to crate::commands::consumer::...; test import adjusted in subcommand file.
Controller Submodule
rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/controller.rs
Updated 4 import paths from crate::commands::controller_commands::... to crate::commands::controller::....
Export Submodule
rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/export.rs
Updated 1 import path from crate::commands::export_commands::... to crate::commands::export::....
HA Submodule
rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/ha.rs
Updated 2 import paths from crate::commands::ha_commands::... to crate::commands::ha::....
Namesrv Submodule
rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/namesrv.rs
Updated 6 import paths from crate::commands::namesrv_commands::... to crate::commands::namesrv::....
Topic Submodule
rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/topic.rs, topic/update_order_conf_sub_command.rs
Updated 12 import paths from crate::commands::topic_commands::... to crate::commands::topic::...; test import adjusted in subcommand file.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 Hops of joy! The _commands suffix now takes flight,
Commands nestled cleaner, no redundant blight—
From auth_commands to auth so neat,
Ten modules renamed, the refactor's complete!
Rust conventions praised, the code feels light. ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: removing redundant _commands suffix from submodule names, which aligns with the primary objective of the changeset.
Linked Issues check ✅ Passed All changes in the PR directly implement the proposed refactoring from issue #6498: renaming modules from *_commands to * and updating all import paths accordingly throughout the codebase.
Out of Scope Changes check ✅ Passed All changes are directly scoped to the issue objective: updating module names and import paths. No unrelated modifications were introduced.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/controller.rs (1)

1-1: ⚠️ Potential issue | 🟡 Minor

Update header year to 2023.

This file header should use the standardized 2023 year.

🛠️ Proposed fix
-// Copyright 2026 The RocketMQ Rust Authors
+// Copyright 2023 The RocketMQ Rust Authors

Based on learnings: In Rust source files (*.rs) across the rocketmq-rust repository, enforce using "Copyright 2023" as the year in the header instead of the current calendar year. Audit and update existing headers to follow this convention and ensure all new files include the 2023 year.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/controller.rs`
at line 1, Update the file header copyright year from "2026" to "2023": locate
the top-of-file copyright comment line that currently reads "Copyright 2026 The
RocketMQ Rust Authors" and replace the year with "2023" so it reads "Copyright
2023 The RocketMQ Rust Authors"; apply the same change to any other Rust source
file headers that still use the current calendar year to enforce the
standardized 2023 header convention.
rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/auth.rs (1)

1-1: ⚠️ Potential issue | 🟡 Minor

Update header year to 2023.

This file header should use the standardized 2023 year.

🛠️ Proposed fix
-// Copyright 2026 The RocketMQ Rust Authors
+// Copyright 2023 The RocketMQ Rust Authors

Based on learnings: In Rust source files (*.rs) across the rocketmq-rust repository, enforce using "Copyright 2023" as the year in the header instead of the current calendar year. Audit and update existing headers to follow this convention and ensure all new files include the 2023 year.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/auth.rs` at
line 1, The file header in auth.rs uses the current year; update the top comment
line to "Copyright 2023 The RocketMQ Rust Authors" (replace the existing year)
and then audit other .rs files to ensure their headers match the standardized
"Copyright 2023" format so new and existing Rust sources consistently use 2023.
rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/consumer.rs (1)

1-1: ⚠️ Potential issue | 🟡 Minor

Update header year to 2023.

This file header should use the standardized 2023 year.

🛠️ Proposed fix
-// Copyright 2026 The RocketMQ Rust Authors
+// Copyright 2023 The RocketMQ Rust Authors

Based on learnings: In Rust source files (*.rs) across the rocketmq-rust repository, enforce using "Copyright 2023" as the year in the header instead of the current calendar year. Audit and update existing headers to follow this convention and ensure all new files include the 2023 year.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/consumer.rs`
at line 1, Update the top-of-file header comment in consumer.rs to use
"Copyright 2023" instead of the current year; locate the header comment at the
very beginning of rocketmq-admin-core/src/commands/consumer.rs (the file-level
copyright comment) and replace the year token with 2023 to match the repository
convention.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/auth.rs`:
- Line 1: The file header in auth.rs uses the current year; update the top
comment line to "Copyright 2023 The RocketMQ Rust Authors" (replace the existing
year) and then audit other .rs files to ensure their headers match the
standardized "Copyright 2023" format so new and existing Rust sources
consistently use 2023.

In `@rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/consumer.rs`:
- Line 1: Update the top-of-file header comment in consumer.rs to use "Copyright
2023" instead of the current year; locate the header comment at the very
beginning of rocketmq-admin-core/src/commands/consumer.rs (the file-level
copyright comment) and replace the year token with 2023 to match the repository
convention.

In
`@rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/controller.rs`:
- Line 1: Update the file header copyright year from "2026" to "2023": locate
the top-of-file copyright comment line that currently reads "Copyright 2026 The
RocketMQ Rust Authors" and replace the year with "2023" so it reads "Copyright
2023 The RocketMQ Rust Authors"; apply the same change to any other Rust source
file headers that still use the current calendar year to enforce the
standardized 2023 header convention.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 51c7663 and bc22ced.

📒 Files selected for processing (74)
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/auth.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/auth/copy_acl_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/auth/copy_users_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/auth/create_acl_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/auth/create_user_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/auth/delete_acl_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/auth/delete_user_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/auth/get_acl_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/auth/get_user_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/auth/list_acl_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/auth/list_users_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/auth/update_acl_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/auth/update_user_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/broker.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/broker/broker_consume_stats_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/broker/broker_status_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/broker/clean_expired_cq_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/broker/clean_unused_topic_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/broker/commit_log_set_read_ahead_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/broker/delete_expired_commit_log_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/broker/get_broker_config_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/broker/get_broker_epoch_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/broker/get_cold_data_flow_ctr_info_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/broker/remove_cold_data_flow_ctr_group_config_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/broker/reset_master_flush_offset_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/broker/send_msg_status_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/broker/switch_timer_engine_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/broker/update_broker_config_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/broker/update_cold_data_flow_ctr_group_config_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/cluster.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/cluster/cluster_list_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/cluster/cluster_send_msg_rt_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/connection.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/connection/consumer_connection_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/connection/producer_connection_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/consumer.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/consumer/consumer_status_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/consumer/consumer_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/consumer/delete_subscription_group_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/consumer/set_consume_mode_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/consumer/start_monitoring_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/consumer/update_sub_group_list_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/consumer/update_sub_group_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/controller.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/controller/clean_broker_metadata_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/controller/get_controller_config_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/controller/get_controller_metadata_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/controller/update_controller_config_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/export.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/export/export_metadata_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/ha.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/ha/get_sync_state_set_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/ha/ha_status_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/namesrv.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/namesrv/add_write_perm_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/namesrv/delete_kv_config_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/namesrv/get_namesrv_config_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/namesrv/update_kv_config_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/namesrv/update_namesrv_config_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/namesrv/wipe_write_perm_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/topic.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/topic/allocate_mq_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/topic/delete_topic_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/topic/remapping_static_topic_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/topic/topic_cluster_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/topic/topic_list_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/topic/topic_route_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/topic/topic_status_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/topic/update_order_conf_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/topic/update_static_topic_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/topic/update_topic_list_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/topic/update_topic_perm_sub_command.rs
  • rocketmq-tools/rocketmq-admin/rocketmq-admin-core/src/commands/topic/update_topic_sub_command.rs

@codecov
Copy link

codecov bot commented Feb 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 42.18%. Comparing base (2e3661b) to head (bc22ced).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6501   +/-   ##
=======================================
  Coverage   42.18%   42.18%           
=======================================
  Files         942      942           
  Lines      131786   131785    -1     
=======================================
  Hits        55595    55595           
+ Misses      76191    76190    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Collaborator

@rocketmq-rust-bot rocketmq-rust-bot left a comment

Choose a reason for hiding this comment

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

LGTM - All CI checks passed ✅

Copy link
Owner

@mxsm mxsm left a comment

Choose a reason for hiding this comment

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

LGTM

@mxsm mxsm merged commit 33efdf4 into mxsm:main Feb 24, 2026
12 of 21 checks passed
@rocketmq-rust-bot rocketmq-rust-bot added approved PR has approved and removed ready to review waiting-review waiting review this PR labels Feb 24, 2026
@WaterWhisperer WaterWhisperer deleted the refactor-6498 branch February 24, 2026 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI review first Ai review pr first approved PR has approved auto merge refactor♻️ refactor code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Refactor♻️] Remove redundant _commands suffix from submodule names under commands/

4 participants