-
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
chore: prepare depinject 1.0.0 #21001
Conversation
WalkthroughWalkthroughThe recent changes involve a significant restructuring and enhancement of the Cosmos SDK's dependency injection and configuration capabilities. The transition to version 1.0.0 reflects improved module organization, expanded support for various proto message types, and the introduction of features for automatic command-line interface (CLI) generation. These updates enhance flexibility, usability, and integration, particularly for the counter module, while clarifying the codebase’s structure. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant CLI
participant CounterModule
participant AppConfig
User->>CLI: Input command
CLI->>CounterModule: Parse command options
CounterModule->>AppConfig: Retrieve configurations
AppConfig->>CounterModule: Return configurations
CounterModule->>User: Output result
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 Configuration 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
Outside diff range, codebase verification and nitpick comments (3)
testutil/x/counter/proto/cosmos/counter/module/v1/module.proto (1)
7-7
: Add a brief comment explaining the purpose of thego_package
option.The
go_package
option specifies the Go package path for the generated code. Adding a comment will help maintainers understand its purpose.+ // Specifies the Go package path for the generated code. option go_package = "github.com/cosmos/cosmos-sdk/testutil/x/counter/types";
testutil/x/counter/autocli.go (1)
1-6
: Conform to the Uber Go Style Guide for imports.Group standard library, third-party, and local imports separately.
import ( autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" counterv1 "cosmossdk.io/api/cosmos/counter/v1" ) +import ( + "fmt" + "strings" +)simapp/app_config.go (1)
72-73
: Conform to the Uber Go Style Guide for imports.Group standard library, third-party, and local imports separately.
import ( "time" "google.golang.org/protobuf/types/known/durationpb" "github.com/cosmos/cosmos-sdk/runtime" _ "github.com/cosmos/cosmos-sdk/testutil/x/counter" // import for side-effects countertypes "github.com/cosmos/cosmos-sdk/testutil/x/counter/types" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" )
Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
Files ignored due to path filters (1)
testutil/x/counter/types/module.pb.go
is excluded by!**/*.pb.go
Files selected for processing (6)
- depinject/CHANGELOG.md (1 hunks)
- depinject/appconfig/config.go (1 hunks)
- simapp/app_config.go (2 hunks)
- testutil/x/counter/autocli.go (1 hunks)
- testutil/x/counter/depinject.go (2 hunks)
- testutil/x/counter/proto/cosmos/counter/module/v1/module.proto (1 hunks)
Additional context used
Path-based instructions (5)
testutil/x/counter/depinject.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.depinject/CHANGELOG.md (1)
Pattern
**/*.md
: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"testutil/x/counter/autocli.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.depinject/appconfig/config.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.simapp/app_config.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.
Additional comments not posted (7)
testutil/x/counter/depinject.go (3)
9-9
: LGTM! The import oftypes
is correct.The import statement for
types
is correct and aligns with the changes made.
19-21
: LGTM! The module registration change is correct.The module registration now uses
&types.Module{}
, which aligns with the updated structure.
27-27
: LGTM! TheModuleInputs
struct change is correct.The
Config
field inModuleInputs
now uses*types.Module
, which aligns with the updated structure.depinject/CHANGELOG.md (2)
25-25
: Ensure the release date is added for version 1.0.0.The release date for version 1.0.0 is missing. Ensure it is added before merging.
27-28
: LGTM! The changelog entries are clear and correct.The changelog entries for version 1.0.0 are clear and correctly formatted.
testutil/x/counter/autocli.go (1)
8-34
: LGTM!The function
AutoCLIOptions
correctly implements theautocli.HasAutoCLIConfig
interface and returns the expected configurations.simapp/app_config.go (1)
284-288
: LGTM!The new module entry for
countertypes.ModuleName
andappconfig.WrapAny(&countertypes.Module{})
is correctly added for testing the depinject module registration.
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
depinject/appconfig/config.go
Outdated
pbz, err := gogoproto.Marshal(cfg) | ||
if err != nil { | ||
panic(err) | ||
} | ||
|
||
return &anypb.Any{ | ||
TypeUrl: "/" + gogoproto.MessageName(cfg), | ||
Value: pbz, | ||
} |
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.
I'm pretty sure the code can be shortened to this snippet because gogoproto 1.5 supports protoreflect too
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.
Updated 👍🏾
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: 0
Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
Files selected for processing (3)
- depinject/appconfig/config.go (2 hunks)
- simapp/app_config.go (2 hunks)
- simapp/upgrades.go (2 hunks)
Files skipped from review due to trivial changes (1)
- simapp/upgrades.go
Files skipped from review as they are similar to previous changes (2)
- depinject/appconfig/config.go
- simapp/app_config.go
I'll tag 1.0.0 once everything here is passing: #21000 as app works but CI isn't happy there. |
* main: (48 commits) build(deps): add missing replaces and remove unnecessary ones (#21033) build(deps): Bump bufbuild/buf-setup-action from 1.34.0 to 1.35.0 (#21028) chore: fix some comments for struct field (#21027) chore(x): replace `fmt.Errorf` without parameters with `errors.New` (#21032) chore: fix errors reported by running `make lint` (#21015) ci: skip spelling check in go.mod/go.sum (#21021) chore(all)!: use gogoproto/any instead of codec/types/any (#21013) chore(server/v2/cometbft): ensure consistent dash-case in app.toml (#21018) docs(server): wrong function comments (#21017) refactor(storev2): update snapshot manager and migration manager tests (#20441) feat(server/v2/cometbft): config (#20989) refactor: set `help` as default target of Makefile (#21011) fix(simapp): duplicated import (#21014) chore(docs): fix functions and struct comments (#21010) fix(simapp/v2): panic with testnet init-files command (#21012) fix: make help won't work (#21005) fix: NewIntegrationApp does not write default genesis to state (#21006) chore(x/staking,x/upgrade): replace `fmt.Errorf` without parameters with `errors.New` (#21004) chore: prepare depinject 1.0.0 (#21001) docs: Fix typos in RFC Creation Process (#20998) ...
Description
Prepare depinject 1.0.0 release.
Tested on v0.50 (#21000) simapp and chain-minimal (app.yaml)
Modified counter to use gogo instead of pulsar module proto
Updated
WrapAny
to support a gogo module so we don't have to regenerate our module.pulsar.go as module.pb.go.(we could do it however if we wanted to, just need to change things in protocgen.sh then)
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
New Features
Bug Fixes
Documentation