-
Notifications
You must be signed in to change notification settings - Fork 133
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
[CORE-538] Integrate AutoCLI as part of Cosmos 0.47 -> 0.50 upgrade and re-add a few standalone commands that changed packages #932
Conversation
WalkthroughThe update to the codebase primarily encompasses the enhancement of the command-line interface (CLI). Key changes include the importation of new libraries, refinement of the root command setup, the inclusion of a new 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's AI:
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 (
|
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.
Review Status
Actionable comments generated: 2
Configuration used: CodeRabbit UI
Files ignored due to filter (2)
- protocol/go.mod
- protocol/go.sum
Files selected for processing (1)
- protocol/cmd/dydxprotocold/cmd/root.go (9 hunks)
Additional comments: 5
protocol/cmd/dydxprotocold/cmd/root.go (5)
47-47: The addition of
github.com/spf13/viper
is not mentioned in the PR overview or AI-generated summary. Ensure that this new dependency is indeed required and properly integrated into the application.185-185: The addition of
confixcmd.ConfigCommand()
is consistent with the PR objectives to expand theconfig
command into multiple sub-commands. This change appears to be correctly implemented.216-251: The
autoCliOpts
function is a new addition and central to the AutoCLI integration. Ensure that the instantiation of the application and the enumeration of modules are efficient and do not introduce unnecessary overhead, especially since the created app instance is discarded.272-272: The addition of
server.QueryBlockCmd()
to thequeryCommand
function is consistent with the PR objectives to reorganize and expand command functionalities. This change appears to be correctly implemented.314-314: The
newApp
function has been converted from a method on theappCreator
struct to a standalone function, which aligns with the PR objectives to remove theappCreator
struct and streamline the command initialization process.
if err := autoCliOpts(encodingConfig, initClientCtx).EnhanceRootCommand(rootCmd); err != nil { | ||
panic(err) |
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.
Using panic
for error handling in the autoCliOpts
function is not ideal for production code. Consider handling the error gracefully or documenting why a panic is necessary in this context.
@@ -335,7 +384,7 @@ func (a appCreator) newApp( | |||
// | |||
// Deprecated: this feature relies on the use of known unstable, legacy export functionality | |||
// from cosmos. | |||
func (a appCreator) appExport( | |||
func appExport( |
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.
The appExport
function is marked as deprecated and has been converted from a method on the appCreator
struct to a standalone function. Ensure that the deprecation is clearly documented and communicated to developers, and that any necessary migration paths or alternatives are provided.
Changelist
Integrate AutoCLI (using upgrade guide recommendations) and re-add a few standalone commands that changed packages. Notably the change requires instantiating an instance of the app to get the list of modules for AutoCLI to query.
The 3.0.0 command list (with top-level subcommands) is:
The 4.0.0 (current) command list (with top-level subcommands) is:
Notable differences are:
config
broken out into several sub-commandsquery account
is now underquery auth ...
tendermint
tocomet
(note thattendermint
is still a valid alias).query tendermint-validator-set
toquery comet-validator-set
(note thattendermint-validator-set
is still a valid alias).validate-genesis
tovalidate
(note thatvalidate-genesis
is still a valid alias).query consensus
,tx consensus
,keys import-hex
.Test Plan
Validated list of commands that are part of the binary manually and existing tests pass.
Author/Reviewer Checklist
state-breaking
label.indexer-postgres-breaking
label.PrepareProposal
orProcessProposal
, manually add the labelproposal-breaking
.feature:[feature-name]
.backport/[branch-name]
.refactor
,chore
,bug
.