Skip to content
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

feat(client/v2): override short description in generated command #20266

Merged
merged 6 commits into from
May 3, 2024

Conversation

johnletey
Copy link
Contributor

@johnletey johnletey commented May 3, 2024

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...

  • included the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • reviewed "Files changed" and left comments if necessary
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • updated the relevant documentation or specification, including comments for documenting Go code
  • confirmed all CI checks have passed

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.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic, API design and naming, documentation is accurate, tests and test coverage

Summary by CodeRabbit

  • New Features

    • Enhanced command descriptions for query and message functionalities, automatically providing custom short descriptions when none are provided.
    • Introduced the ability to override short descriptions in AutoCLI-generated top-level commands for improved customization.
  • Improvements

    • Updated logic for assigning short descriptions to sub-commands in both query and message services, ensuring clarity and consistency across commands.
  • Documentation

    • Introduced an optional 'short' parameter in the ServiceCommandDescriptor to facilitate clearer command descriptions.

@johnletey johnletey requested a review from a team as a code owner May 3, 2024 12:02
Copy link
Contributor

coderabbitai bot commented May 3, 2024

Walkthrough

Walkthrough

The recent updates aim to enhance command descriptions within the autocli module, providing clearer user guidance. Changes include setting default short descriptions for query and message commands, updating logic in Go files to handle missing descriptions, and introducing an optional 'short' parameter in the proto definition. These adjustments improve the clarity and informativeness of command interfaces in the application.

Changes

File Path Change Summary
client/v2/autocli/common.go Updated logic in enhanceQuery and enhanceMsg to set custom short descriptions if not provided.
client/v2/autocli/msg.go Modified logic to assign default short descriptions when creating sub-commands if absent.
client/v2/autocli/query.go Adjusted assignment of short variable for empty cmdDescriptor.Short in query commands.
proto/cosmos/autocli/v1/... Added optional short parameter to ServiceCommandDescriptor for improved command descriptions.

Recent Review Details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits Files that changed from the base of the PR and between 53c0fec and 75cb23b.
Files selected for processing (1)
  • client/v2/CHANGELOG.md (1 hunks)
Additional Context Used
LanguageTool (29)
client/v2/CHANGELOG.md (29)

Near line 43: Unpaired symbol: ‘[’ seems to be missing
Context: ...tic version --> ### Features * [#18626](https://github.com/cosmos/cosmos-sdk/pu...


Near line 44: Unpaired symbol: ‘[’ seems to be missing
Context: ...ng and verification of a file. * [#18461](https://github.com/cosmos/cosmos-sdk/pu...


Near line 45: Unpaired symbol: ‘[’ seems to be missing
Context: ... Support governance proposals. * [#19039](https://github.com/cosmos/cosmos-sdk/pu...


Near line 45: Possible spelling mistake found.
Context: .../cosmos-sdk/pull/19039) Add support for pubkey in autocli. * [#20266](https://github.c...


Near line 45: Possible spelling mistake found.
Context: ...k/pull/19039) Add support for pubkey in autocli. * [#20266](https://github.com/cosmos/c...


Near line 46: Unpaired symbol: ‘[’ seems to be missing
Context: ...support for pubkey in autocli. * [#20266](https://github.com/cosmos/cosmos-sdk/pu...


Near line 46: Possible spelling mistake found.
Context: ...ty to override the short description in AutoCLI-generated top-level commands. ### Improvements ...


Near line 50: Unpaired symbol: ‘[’ seems to be missing
Context: ...l commands. ### Improvements * [#20083](https://github.com/cosmos/cosmos-sdk/pu...


Near line 51: Unpaired symbol: ‘[’ seems to be missing
Context: ...and improve version filtering. * [#19618](https://github.com/cosmos/cosmos-sdk/pu...


Near line 51: Possible spelling mistake found.
Context: ...m//pull/19618) Marshal enum as string in queries. * [#19060](https:...


Near line 52: Unpaired symbol: ‘[’ seems to be missing
Context: ...hal enum as string in queries. * [#19060](https://github.com/cosmos/cosmos-sdk/pu...


Near line 52: Possible spelling mistake found.
Context: ...text from root (or enhanced) command in autocli commands. * Note, the given command m...


Near line 53: Add a space between sentences.
Context: ... * Note, the given command must have a client.Context in its context. * [#19216](https://git...


Near line 54: Unpaired symbol: ‘[’ seems to be missing
Context: ...lient.Context` in its context. * [#19216](https://github.com/cosmos/cosmos-sdk/pu...


Near line 54: Possible spelling mistake found.
Context: ...cosmos-sdk/pull/19216) Do not overwrite TxConfig, use directly the one provided in conte...


Near line 54: Possible spelling mistake found.
Context: ...e directly the one provided in context. TxConfig should always be set in the `client.Con...


Near line 54: Add a space between sentences.
Context: ...t. TxConfig should always be set in the client.Context in root.go of an app. ### Bug Fixes...


Near line 58: Unpaired symbol: ‘[’ seems to be missing
Context: ...go` of an app. ### Bug Fixes * [#19976](https://github.com/cosmos/cosmos-sdk/pu...


Near line 58: Add a space between sentences.
Context: .../cosmos-sdk/pull/19976) Add encoder for cosmos.base.v1beta1.DecCoin. * [#19377](https://github.com/cosmos/...


Near line 59: Unpaired symbol: ‘[’ seems to be missing
Context: ...cosmos.base.v1beta1.DecCoin. * [#19377](https://github.com/cosmos/cosmos-sdk/pu...


Near line 59: Possible spelling mistake found.
Context: ...ll/19377) Partly fix comment parsing in autocli. * [#19060](https://github.com/cosmos/c...


Near line 60: Unpaired symbol: ‘[’ seems to be missing
Context: ...ix comment parsing in autocli. * [#19060](https://github.com/cosmos/cosmos-sdk/pu...


Near line 61: Unpaired symbol: ‘[’ seems to be missing
Context: ...parsing logic in flag handler. * [#20033](https://github.com/cosmos/cosmos-sdk/pu...


Near line 61: Possible spelling mistake found.
Context: ...0033) Respect output format from client ctx. ### API Breaking Changes * [#17709](...


Near line 65: Unpaired symbol: ‘[’ seems to be missing
Context: ...tx. ### API Breaking Changes * [#17709](https://github.com/cosmos/cosmos-sdk/pu...


Near line 65: Add a space between sentences.
Context: ...) Address codecs have been removed from autocli.AppOptions and flag.Builder. Instead client/v2 ...


Near line 65: Add a space between sentences.
Context: ...n removed from autocli.AppOptions and flag.Builder. Instead client/v2 uses the address co...


Near line 65: A comma may be missing after the conjunctive/linking adverb ‘Instead’.
Context: ...autocli.AppOptionsandflag.Builder`. Instead client/v2 uses the address codecs prese...


Near line 70: Possible spelling mistake found.
Context: ...os SDK v0.50 release and fully supports AutoCLI.

Path-based Instructions (1)
client/v2/CHANGELOG.md (1)

Pattern **/*.md: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"


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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added the C:CLI label May 3, 2024
@johnletey
Copy link
Contributor Author

Would be great to get this backported to v0.50.x! @julienrbrt I think this requires a new API tag to be cut?

@julienrbrt julienrbrt self-assigned this May 3, 2024
@julienrbrt
Copy link
Member

julienrbrt commented May 3, 2024

Would be great to get this backported to v0.50.x! @julienrbrt I think this requires a new API tag to be cut?

Yes, we can add this in the next client/v2 release (ref #19530)

CHANGELOG.md Outdated Show resolved Hide resolved
@julienrbrt julienrbrt added the backport/v0.50.x PR scheduled for inclusion in the v0.50's next stable release label May 3, 2024
CHANGELOG.md Outdated Show resolved Hide resolved
@johnletey johnletey requested a review from julienrbrt May 3, 2024 13:49
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.

Actionable comments posted: 1

Out of diff range and nitpick comments (3)
client/v2/CHANGELOG.md (3)

Line range hint 52-52: Add a space after the comma for better readability.

- * Note, the given command must have a `client.Context` in its context.
+ * Note, the given command must have a `client.Context` in its context.

Line range hint 54-54: Add a space after the period for better readability.

- TxConfig should always be set in the `client.Context` in `root.go` of an app.
+ TxConfig should always be set in the `client.Context` in `root.go` of an app.

Line range hint 65-65: Add a comma after 'Instead' for grammatical correctness.

- Instead client/v2 uses the address codecs present in the context
+ Instead, client/v2 uses the address codecs present in the context

client/v2/CHANGELOG.md Outdated Show resolved Hide resolved
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
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.

Actionable comments posted: 1

@@ -43,6 +43,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* [#18626](https://github.com/cosmos/cosmos-sdk/pull/18626) Support for off-chain signing and verification of a file.
* [#18461](https://github.com/cosmos/cosmos-sdk/pull/18461) Support governance proposals.
* [#19039](https://github.com/cosmos/cosmos-sdk/pull/19039) Add support for pubkey in autocli.
* [#20266](https://github.com/cosmos/cosmos-sdk/pull/20266) Ability to override the short description in AutoCLI-generated top-level commands.
Copy link
Contributor

Choose a reason for hiding this comment

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

Ensure consistency in the description of the feature.

- Ability to override the short description in AutoCLI-generated top-level commands.
+ Ability to override short descriptions in AutoCLI-generated top-level commands.

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
* [#20266](https://github.com/cosmos/cosmos-sdk/pull/20266) Ability to override the short description in AutoCLI-generated top-level commands.
* [#20266](https://github.com/cosmos/cosmos-sdk/pull/20266) Ability to override short descriptions in AutoCLI-generated top-level commands.

@julienrbrt julienrbrt changed the title feat: override short description in generated command feat(client/v2): override short description in generated command May 3, 2024
@julienrbrt julienrbrt enabled auto-merge May 3, 2024 13:57
@julienrbrt julienrbrt added this pull request to the merge queue May 3, 2024
Merged via the queue into cosmos:main with commit 7a505ad May 3, 2024
64 of 65 checks passed
mergify bot pushed a commit that referenced this pull request May 3, 2024
)

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
(cherry picked from commit 7a505ad)

# Conflicts:
#	api/cosmos/autocli/v1/options.pulsar.go
#	client/v2/CHANGELOG.md
#	proto/cosmos/autocli/v1/options.proto
@johnletey johnletey deleted the autocli/short-override branch May 3, 2024 14:10
julienrbrt added a commit that referenced this pull request May 9, 2024
…kport #20266) (#20269)

Co-authored-by: John Letey <j@letey.de>
Co-authored-by: Julien Robert <julien@rbrt.fr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/v0.50.x PR scheduled for inclusion in the v0.50's next stable release C:CLI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants