-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(server/v2): remove dup commands + reduce api surface #20810
Conversation
WalkthroughWalkthroughThe changes primarily involve refactoring and organizing command-related functionalities for improved code maintainability. Key modifications include moving specific CLI commands between categories, breaking down larger functions into more specialized ones, and optimizing command addition processes by removing duplications. Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
@julienrbrt your pull request is missing a changelog! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
Files selected for processing (4)
- server/v2/cometbft/server.go (1 hunks)
- server/v2/commands.go (5 hunks)
- server/v2/server.go (1 hunks)
- simapp/v2/simdv2/cmd/commands.go (2 hunks)
Files skipped from review due to trivial changes (1)
- server/v2/commands.go
Additional context used
Path-based instructions (3)
server/v2/server.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.simapp/v2/simdv2/cmd/commands.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.server/v2/cometbft/server.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.
Additional comments not posted (3)
server/v2/server.go (1)
139-151
: Optimization of command addition based on non-empty checks.The changes ensure that only non-empty command sets are appended, which helps in maintaining a cleaner and more efficient command structure. This aligns well with the PR's goal to reduce the API surface.
simapp/v2/simdv2/cmd/commands.go (1)
102-111
: Consolidation of command additions in initRootCmd.The changes effectively remove duplicate additions of commands, which helps in simplifying the command structure and aligns with the PR's goal to reduce the API surface.
server/v2/cometbft/server.go (1)
198-201
: Reclassification of commands to queries.Moving
ResetAllCmd
andResetStateCmd
fromCommands
toQueries
could be beneficial for clarity and organization, assuming these operations are more query-like in nature. It's important to ensure that this reclassification aligns with the expected use cases and functionality of these commands.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tACK
simapp/v2/simdv2/cmd/commands.go
Outdated
@@ -99,6 +99,16 @@ func initRootCmd[AppT serverv2.AppI[T], T transaction.Tx]( | |||
panic(fmt.Sprintf("failed to create logger: %v", err)) | |||
} | |||
|
|||
// add keybase, auxiliary RPC, query, genesis, and tx child commands | |||
rootCmd.AddCommand( | |||
server.StatusCommand(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should remove this command since having comet status command
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
Files selected for processing (1)
- simapp/v2/simdv2/cmd/commands.go (2 hunks)
Files skipped from review as they are similar to previous changes (1)
- simapp/v2/simdv2/cmd/commands.go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you
Description
Closes: #XXXX
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
in the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
Please see Pull Request Reviewer section in the contributing guide for more information on how to review a pull request.
I have...
Summary by CodeRabbit
Refactor
initRootCmd
function to eliminate duplicates and streamline child command additions.CLICommands
method to ensure only non-empty sets of commands, transactions, and queries are included.Bug Fixes