-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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(collections): add HasCollections interface #20537
Conversation
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThe recent update introduces the Changes
Sequence Diagram(s) (Beta)sequenceDiagram
participant Module
participant HasCollections
participant CollectionSchema
Module->>HasCollections: Implements HasCollections interface
HasCollections->>Module: Requires CollectionsSchema() method
Module->>CollectionSchema: Returns collection schema via CollectionsSchema()
This diagram illustrates the interaction where a module implements the 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 (
|
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: 1
Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
Files selected for processing (2)
- collections/CHANGELOG.md (1 hunks)
- collections/schema.go (1 hunks)
Additional context used
Path-based instructions (2)
collections/CHANGELOG.md (1)
Pattern
**/*.md
: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"collections/schema.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.
LanguageTool
collections/CHANGELOG.md
[uncategorized] ~37-~37: Possible missing comma found. (AI_HYDRA_LEO_MISSING_COMMA)
Context: ...sic wrapping of the standard Map methods but is not iterable. * [#17656](https://git...
[uncategorized] ~73-~73: Possible missing comma found. (AI_HYDRA_LEO_MISSING_COMMA)
Context: ...s/cosmos-sdk/pull/16127) In theWalk
method the call back function being passed is ...
golangci-lint
collections/schema.go
130-130: undefined: Collection (typecheck)
131-131: undefined: Collection (typecheck)
86-86: undefined: Collection (typecheck)
287-287: undefined: Collection (typecheck)
295-295: undefined: Collection (typecheck)
27-27: undefined: Collection (typecheck)
28-28: undefined: Collection (typecheck)
159-159: undefined: Collection (typecheck)
160-160: undefined: Collection (typecheck)
296-296: undefined: Collection (typecheck)
Additional comments not posted (1)
collections/CHANGELOG.md (1)
40-40
: The changelog entry is clear and follows the established format. However, consider adding a comma after "methods" for better readability.- ...Map methods but is not iterable. + ...Map methods, but is not iterable.Likely invalid or redundant comment.
// HasCollections is an interface that should be implemented by modules that | ||
// use collections so that their state can be indexed. | ||
// | ||
// Normally any module type implementing this should also implement appmodule.AppModule | ||
// or an earlier version of the AppModule interface. | ||
type HasCollections interface { | ||
// CollectionsSchema returns the schema for the collections used by the module. | ||
CollectionsSchema() Schema | ||
} |
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 HasCollections
interface is well-defined and aligns with the PR's objectives. Ensure that the Collection
type is defined or imported correctly, as it is referenced throughout the file but not defined in the provided code.
+ import "path/to/collection"
Committable suggestion was skipped due to low confidence.
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.
LGTM
Let's document it in the readme though
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.
+1 for docs updates
Let's keep this in draft until the implementation is more fleshed out. Thanks for taking a look everyone! |
Description
Defines a mechanism by which modules using collections can expose their schema to indexers (see #20532).
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