-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
refactor: export HasRegisterServices
#23488
Conversation
📝 WalkthroughWalkthroughThe pull request introduces a significant refactoring of module service registration interfaces across multiple files in the Cosmos SDK. The primary change involves replacing the deprecated Changes
Possibly related PRs
Suggested labels
Suggested reviewers
📜 Recent review detailsConfiguration used: .coderabbit.yml 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (5)
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 using PR comments)
Other keywords and placeholders
Documentation and Community
|
HasRegisterServices
HasRegisterServices
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
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
🔭 Outside diff range comments (1)
runtime/app.go (1)
Line range hint
272-272
: Remove unused typehasServicesV1
.The linter has flagged that the
hasServicesV1
type is unused. Since it's been replaced bymodule.HasRegisterServices
, this type definition should be removed.Apply this diff to remove the unused type:
-// hasServicesV1 is the interface for registering service in baseapp Cosmos SDK. -// This API is part of core/appmodule but commented out for dependencies. -type hasServicesV1 interface { - RegisterServices(grpc.ServiceRegistrar) error -}
🧹 Nitpick comments (1)
types/module/module.go (1)
93-94
: Fix typo in deprecation notice.The deprecation notice contains a typo: "instea" should be "instead".
-// Deprecated: use HasRegisterServices and its interface in your modules instea. +// Deprecated: use HasRegisterServices and its interface in your modules instead.
📜 Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
runtime/app.go
(1 hunks)testutil/mock/types_module_module.go
(1 hunks)types/module/core_module_test.go
(14 hunks)types/module/module.go
(2 hunks)types/module/module_test.go
(6 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
types/module/module_test.go (2)
Pattern **/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.
Pattern **/*_test.go
: "Assess the unit test code assessing sufficient code coverage for the changes associated in the pull request"
types/module/module.go (1)
Pattern **/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.
runtime/app.go (1)
Pattern **/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.
types/module/core_module_test.go (2)
Pattern **/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.
Pattern **/*_test.go
: "Assess the unit test code assessing sufficient code coverage for the changes associated in the pull request"
testutil/mock/types_module_module.go (1)
Pattern **/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.
🪛 GitHub Actions: Lint
runtime/app.go
[error] 272-272: type hasServicesV1
is unused (unused)
⏰ Context from checks skipped due to timeout of 90000ms (9)
- GitHub Check: tests (00)
- GitHub Check: test-sim-nondeterminism
- GitHub Check: test-simapp-v2
- GitHub Check: test-integration
- GitHub Check: test-system-v2
- GitHub Check: build (arm64)
- GitHub Check: Analyze
- GitHub Check: build (amd64)
- GitHub Check: Summary
🔇 Additional comments (7)
types/module/core_module_test.go (2)
117-117
: Address the TODO comment about Core API modules.The comment indicates that something is not working for Core API modules. This needs to be clarified and addressed.
Would you like me to help investigate what's not working with Core API modules and propose a solution?
44-44
: LGTM! Consistent renaming ofCoreAppModuleAdaptor
tonewCoreAppModuleAdaptor
.The changes consistently rename the function across all test cases, maintaining the expected behavior.
Also applies to: 74-74, 117-117, 149-149, 181-181, 198-198
runtime/app.go (1)
83-86
: LGTM! Updated type assertion to usemodule.HasRegisterServices
.The change correctly updates the type assertion to use the new interface, maintaining error handling.
testutil/mock/types_module_module.go (1)
279-338
: LGTM! Auto-generated mock implementation.The mock implementation for
HasRegisterServices
has been correctly generated with all necessary methods.types/module/module_test.go (1)
Line range hint
1-600
: LGTM! No direct changes to review.The test file is comprehensive and well-structured.
types/module/module.go (2)
100-102
: LGTM!The new
HasRegisterServices
interface is well-defined and properly embedsappmodulev2.AppModule
.
Line range hint
410-425
: LGTM!The implementation properly handles both interfaces with comprehensive error handling:
- Supports the deprecated
HasServices
interface for backward compatibility- Implements the new
HasRegisterServices
interface with proper error handling- Maintains support for
appmodule.HasMigrations
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.
just want to make sure this doesn't break anyone
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.
✅ looks like you'll need to delete the old hasServicesV1 to appease the linter
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
Plan: Pro
📒 Files selected for processing (2)
CHANGELOG.md
(1 hunks)runtime/app.go
(2 hunks)
✅ Files skipped from review due to trivial changes (1)
- CHANGELOG.md
🧰 Additional context used
📓 Path-based instructions (1)
runtime/app.go (1)
Pattern **/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.
🪛 golangci-lint (1.62.2)
runtime/app.go
13-13: File is not gci
-ed with --skip-generated -s standard -s default -s prefix(cosmossdk.io) -s prefix(github.com/cosmos/cosmos-sdk) --custom-order
(gci)
🪛 GitHub Actions: Lint
runtime/app.go
[error] 7-7: File is not gci
-ed with --skip-generated -s standard -s default -s prefix(cosmossdk.io) -s prefix(github.com/cosmos/cosmos-sdk) --custom-order
[error] 13-13: File is not gci
-ed with --skip-generated -s standard -s default -s prefix(cosmossdk.io) -s prefix(github.com/cosmos/cosmos-sdk) --custom-order
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: tests (00)
- GitHub Check: Analyze
- GitHub Check: test-system-v2
- GitHub Check: Summary
🔇 Additional comments (1)
runtime/app.go (1)
81-84
: LGTM! Clean interface migration.The change from
hasServicesV1
tomodule.HasRegisterServices
is well-structured:
- Maintains backward compatibility
- Includes proper error handling
- Uses a more descriptive interface name
(cherry picked from commit 8493d4f) # Conflicts: # CHANGELOG.md # runtime/app.go # testutil/mock/types_module_module.go
Co-authored-by: Alex | Interchain Labs <[email protected]>
move
hasServicesV1
toHasRegisterServices
and use where needed.Summary by CodeRabbit
Refactor
hasServicesV1
toHasRegisterServices
CoreAppModuleAdaptor
tonewCoreAppModuleAdaptor
Documentation
The changes primarily focus on modernizing the module service registration process and improving interface clarity in the SDK.