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

Cli module query params #8504

Merged
merged 6 commits into from
Jul 26, 2024
Merged

Conversation

najeal
Copy link
Contributor

@najeal najeal commented Jul 11, 2024

Closes: #8460

What is the purpose of the change

This pull request add missing params query for modules used in osmosisd q

Testing and Verifying

This change added tests and can be verified as follows:

  • Added unit test that validates : incentives params request result

Documentation and Release Note

  • Does this pull request introduce a new feature or user-facing behavior changes?
  • Changelog entry added to Unreleased section of CHANGELOG.md?

Where is the change documented?

  • Specification (x/{module}/README.md)
  • Osmosis documentation site
  • Code comments?
  • N/A

@najeal
Copy link
Contributor Author

najeal commented Jul 11, 2024

@czarcas7ic This is a draft of what I have understand about the issue. If it is mostly about you are expecting I'll continue to add params queries for the other modules.

@czarcas7ic
Copy link
Member

I'm on mobile but at glance this looks like what is desired, thanks!

@github-actions github-actions bot added the C:x/twap Changes to the twap module label Jul 12, 2024
@github-actions github-actions bot added the C:x/gamm Changes, features and bugs related to the gamm module. label Jul 13, 2024
@najeal najeal marked this pull request as ready for review July 13, 2024 11:32
Copy link
Contributor

coderabbitai bot commented Jul 13, 2024

Walkthrough

The changes introduce a new function CmdListQueries to list available modules' queries and integrate it into the root command, update file permission checks, and modify the declaration of DefaultOsmosisMempoolConfig. Additionally, the changes involve restructuring and moving the Params message from genesis.proto to a new params.proto, and updating associated gRPC services, CLI commands, and tests to ensure parameters can be queried across various modules including gamm, incentives, and twap.

Changes

File Change Summary
cmd/osmosisd/cmd/root.go Updated file permissions, modified DefaultOsmosisMempoolConfig declaration, and added CmdListQueries.
proto/.../genesis.proto Removed Params message definition and imported params.proto.
proto/.../params.proto Defined Params message with pool_creation_fee field.
proto/.../query.proto Added RPC method Params in Query service and associated messages ParamsRequest and ParamsResponse.
x/gamm/client/cli/query.go Added command to GetQueryCmd utilizing osmocli.GetParams for querying parameters.
x/gamm/keeper/grpc_query.go Added Params method to Querier struct for handling parameters retrieval.
x/gamm/keeper/grpc_query_test.go Added test TestParams to KeeperTestSuite for verifying parameter retrieval functionality.
x/incentives/client/cli/query.go Added command to GetQueryCmd using osmocli.GetParams for querying parameters.
x/incentives/keeper/grpc_query.go Added Params function to Querier struct for handling parameter requests.
x/incentives/keeper/grpc_query_test.go Added TestGRPCParams for testing parameter queries via gRPC.
x/twap/client/cli/query.go Added command to GetQueryCmd for querying parameters using osmocli.GetParams.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CLI
    participant gRPC Server
    participant Keeper

    User->>CLI: Run 'osmosisd q gamm params'
    CLI->>gRPC Server: Send ParamsRequest
    gRPC Server->>Keeper: Fetch Params
    Keeper-->>gRPC Server: Return Params
    gRPC Server-->>CLI: Send ParamsResponse
    CLI-->>User: Display Params

    User->>CLI: Run 'osmosisd q list-queries'
    CLI->>gRPC Server: Send ListQueriesRequest
    gRPC Server->>Keeper: Fetch available queries
    Keeper-->>gRPC Server: Return query list
    gRPC Server-->>CLI: Send ListQueriesResponse
    CLI-->>User: Display available queries
Loading

Assessment against linked issues

Objective (Issue #) Addressed Explanation
Add missing module params query to CLI (#8460)
Add top level query that lists all module queries (#8460)

Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between f1ae7e2 and 7589c0e.

Files ignored due to path filters (1)
  • x/gamm/types/query.pb.go is excluded by !**/*.pb.go, !**/*.pb.go
Files selected for processing (2)
  • CHANGELOG.md (1 hunks)
  • proto/osmosis/gamm/v1beta1/query.proto (2 hunks)
Files skipped from review as they are similar to previous changes (2)
  • CHANGELOG.md
  • proto/osmosis/gamm/v1beta1/query.proto

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

@mattverse mattverse closed this Jul 15, 2024
@mattverse mattverse reopened this Jul 15, 2024
@najeal
Copy link
Contributor Author

najeal commented Jul 15, 2024

@mattverse I see you have closed and reopened the PR. Did I do something wrong?

Changelog does not pass -> I let you decide if a new line must be added or not.
protobuf and e2e tests fail -> it is caused by docker and git authentication. I assume it is because you must trigger if manually.

@czarcas7ic
Copy link
Member

No, we do it to trigger our CI when it gets stuck

Copy link
Member

@mattverse mattverse left a comment

Choose a reason for hiding this comment

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

I like this! LGTM

@mattverse
Copy link
Member

@najeal Can you add changelog entry please? 🙏

@najeal
Copy link
Contributor Author

najeal commented Jul 17, 2024

@mattverse I added new entry into Unreleased -> State Compatible

@mattverse
Copy link
Member

Thanks @najeal seems like there is a merge conflict to resolve as well, can you go ahead and fix it?

@najeal
Copy link
Contributor Author

najeal commented Jul 22, 2024

@mattverse conflict resolution has been done 👍

@mattverse mattverse closed this Jul 23, 2024
@mattverse mattverse reopened this Jul 23, 2024
@mattverse mattverse merged commit ff70b4d into osmosis-labs:main Jul 26, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:CLI C:x/gamm Changes, features and bugs related to the gamm module. C:x/incentives C:x/twap Changes to the twap module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add missing module params query to CLI
3 participants