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

chore(proto): fix comments #20679

Merged
merged 2 commits into from
Jun 17, 2024
Merged

chore(proto): fix comments #20679

merged 2 commits into from
Jun 17, 2024

Conversation

winniehere
Copy link
Contributor

@winniehere winniehere commented Jun 16, 2024

Description

fix type/message names in comments.

Summary by CodeRabbit

  • Refactor
    • Renamed several response types for clarity: QueryConfigRequest to QueryConfigResponse and Historical to HistoricalRecord.

@winniehere winniehere requested a review from a team as a code owner June 16, 2024 08:38
Copy link
Contributor

coderabbitai bot commented Jun 16, 2024

Walkthrough

The changes primarily involve renaming and correcting message types in Cosmos SDK's API and protocol buffer files. The affected components are related to querying configuration details and managing historical staking records. Specifically, the QueryConfigRequest type is renamed to QueryConfigResponse, and the Historical struct is renamed to HistoricalRecord. These updates aim to improve clarity and accuracy in the codebase.

Changes

File Path Change Summary
api/cosmos/app/v1alpha1/query.pulsar.go Renamed QueryConfigRequest to QueryConfigResponse.
proto/cosmos/app/v1alpha1/query.proto Updated QueryConfigRequest to QueryConfigResponse in protocol buffers.
api/cosmos/staking/v1beta1/staking.pulsar.go Renamed Historical to HistoricalRecord.
x/staking/proto/cosmos/staking/v1beta1/staking.proto Renamed Historical to HistoricalRecord in protocol buffers.

Sequence Diagrams

No sequence diagrams are generated as the changes are limited to renaming types and classes, without introducing new features or altering control flows.


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.
    • @coderabbitai help me debug CodeRabbit configuration file.

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 an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @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.

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: 2

Review details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between d21620d and 8ca8462.

Files ignored due to path filters (1)
  • x/staking/types/staking.pb.go is excluded by !**/*.pb.go
Files selected for processing (4)
  • api/cosmos/app/v1alpha1/query.pulsar.go (1 hunks)
  • api/cosmos/staking/v1beta1/staking.pulsar.go (1 hunks)
  • proto/cosmos/app/v1alpha1/query.proto (1 hunks)
  • x/staking/proto/cosmos/staking/v1beta1/staking.proto (1 hunks)
Files skipped from review due to trivial changes (1)
  • x/staking/proto/cosmos/staking/v1beta1/staking.proto
Additional context used
Path-based instructions (2)
api/cosmos/app/v1alpha1/query.pulsar.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

api/cosmos/staking/v1beta1/staking.pulsar.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

Additional comments not posted (1)
api/cosmos/staking/v1beta1/staking.pulsar.go (1)

14687-14687: The updated comment clearly describes the purpose and usage of HistoricalRecord. Good job on improving clarity and consistency in documentation.

@@ -18,7 +18,7 @@ service Query {
// QueryConfigRequest is the Query/Config request type.
message QueryConfigRequest {}

// QueryConfigRequest is the Query/Config response type.
// QueryConfigResponse is the Query/Config response type.
Copy link
Contributor

Choose a reason for hiding this comment

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

Tip

Codebase Verification

The renaming of QueryConfigRequest to QueryConfigResponse is incomplete. The old type name QueryConfigRequest still exists in the following locations:

  • proto/cosmos/app/v1alpha1/query.proto: rpc Config(QueryConfigRequest) returns (QueryConfigResponse) {
  • proto/cosmos/app/v1alpha1/query.proto:// QueryConfigRequest is the Query/Config request type.
  • proto/cosmos/app/v1alpha1/query.proto:message QueryConfigRequest {}

Please update these occurrences to ensure consistency.

Analysis chain

Renaming of QueryConfigRequest to QueryConfigResponse correctly reflects its usage as a response type.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify that all occurrences of the old type name `QueryConfigRequest` have been updated.

# Test: Search for the old type name. Expect: No occurrences of the old type name.
rg --type proto "QueryConfigRequest"

Length of output: 66



Script:

#!/bin/bash
# Description: Verify that all occurrences of the old type name `QueryConfigRequest` have been updated.

# Test: Search for the old type name in .proto files. Expect: No occurrences of the old type name.
rg "QueryConfigRequest" --glob "*.proto"

Length of output: 305

@@ -843,7 +843,7 @@ func (*QueryConfigRequest) Descriptor() ([]byte, []int) {
return file_cosmos_app_v1alpha1_query_proto_rawDescGZIP(), []int{0}
}

// QueryConfigRequest is the Query/Config response type.
// QueryConfigResponse is the Query/Config response type.
Copy link
Contributor

Choose a reason for hiding this comment

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

Tip

Codebase Verification

The renaming of QueryConfigRequest to QueryConfigResponse was not fully implemented. The occurrences of QueryConfigRequest in both query_grpc.pb.go and query.pulsar.go indicate that the type still exists and is used in several places. This suggests that QueryConfigRequest and QueryConfigResponse are distinct types, and the renaming might have been a misunderstanding.

  • api/cosmos/app/v1alpha1/query_grpc.pb.go: The QueryConfigRequest type is used in the Config method as an input parameter, while QueryConfigResponse is used as the output.
  • api/cosmos/app/v1alpha1/query.pulsar.go: The QueryConfigRequest type is defined and used in various reflection and protobuf-related functions.

You need to review the context and ensure that the renaming was intended and correctly applied. If QueryConfigRequest should have been renamed to QueryConfigResponse, then all these occurrences need to be updated. Otherwise, the current state might be correct, and both types are indeed required.

Please verify the intended changes and update the code accordingly.

  • api/cosmos/app/v1alpha1/query_grpc.pb.go
  • api/cosmos/app/v1alpha1/query.pulsar.go
Analysis chain

Renaming of QueryConfigRequest to QueryConfigResponse in the generated Go code is consistent with the changes in the proto file and correctly reflects its usage as a response type.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify that all occurrences of the old type name `QueryConfigRequest` have been updated in the Go code.

# Test: Search for the old type name. Expect: No occurrences of the old type name.
rg --type go "QueryConfigRequest"

Length of output: 8736



Script:

#!/bin/bash
# Extract relevant portions of `query_grpc.pb.go` where `QueryConfigRequest` is mentioned.
rg --type go --context 5 "QueryConfigRequest" api/cosmos/app/v1alpha1/query_grpc.pb.go

# Extract relevant portions of `query.pulsar.go` where `QueryConfigRequest` is mentioned.
rg --type go --context 5 "QueryConfigRequest" api/cosmos/app/v1alpha1/query.pulsar.go

Length of output: 15521

@julienrbrt julienrbrt changed the title chore: (x/staking, api): fix comments chore(x/staking): fix comments Jun 16, 2024
@julienrbrt julienrbrt changed the title chore(x/staking): fix comments chore(proto): fix comments Jun 16, 2024
@sontrinh16 sontrinh16 added this pull request to the merge queue Jun 17, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 17, 2024
@julienrbrt julienrbrt added this pull request to the merge queue Jun 17, 2024
Merged via the queue into cosmos:main with commit 1ed018a Jun 17, 2024
66 of 67 checks passed
alpe added a commit that referenced this pull request Jun 17, 2024
* main:
  feat(tx): port simappv2 changes (#20648)
  build(deps): Bump github.com/spf13/cobra from 1.8.0 to 1.8.1 (#20682)
  chore(proto): fix comments (#20679)
  (serverv2/cometbft) Commands support both json and yaml output (#20670)
  fix(x/staking,x/auth):  regenerate mock to fix test (#20684)
  docs: ADR 074: Msg v2 (#20618)
  fix: nested multisig signatures using CLI (#20438)
  chore: fix spelling errors (#20674)
  fix: align Dockerfile for build-push-action (#20672)
  fix: avoid build fail when make localnet-build-env (#20671)
  build(deps): Bump bufbuild/buf-setup-action from 1.32.2 to 1.33.0 (#20669)
  chore: make function comment match function names (#20666)
  chore(consensus): add cometInfo to consensus  (#20615)
  chore: fix typos (#20662)
  fix: Properly parse json in the wait-tx command. (#20631)
  fix(sims): check before sending RotateConsPubKey (#20659)
  test(types/address): add unit tests for the file types/address.go  (#20237)
@winniehere winniehere deleted the chore/comment branch September 5, 2024 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants