-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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(x/group): use core migrations api #19423
Conversation
WalkthroughThe recent updates aim to enhance context handling and migration processes across specific modules. Changes involve transitioning from Changes
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.
Review Status
Actionable comments generated: 0
Configuration used: .coderabbit.yml
Files selected for processing (4)
- x/group/keeper/migrations.go (2 hunks)
- x/group/migrations/v2/migrate.go (2 hunks)
- x/group/module/module.go (3 hunks)
- x/slashing/module.go (1 hunks)
Additional comments: 9
x/group/keeper/migrations.go (2)
- 4-4: LGTM!
- 20-20: LGTM!
x/group/migrations/v2/migrate.go (2)
- 4-4: LGTM!
- 28-28: LGTM!
x/group/module/module.go (4)
- 10-10: LGTM!
- 38-39: LGTM!
- 129-135: LGTM!
- 137-143: LGTM!
x/slashing/module.go (1)
- 121-132: 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.
Review Status
Actionable comments generated: 2
Configuration used: .coderabbit.yml
Files selected for processing (7)
- runtime/app.go (2 hunks)
- runtime/module.go (1 hunks)
- runtime/services.go (1 hunks)
- runtime/services/autocli.go (1 hunks)
- simapp/app.go (2 hunks)
- types/module/configurator.go (1 hunks)
- x/accounts/module.go (3 hunks)
Files skipped from review due to trivial changes (1)
- runtime/services/autocli.go
Additional comments: 8
runtime/services.go (1)
- 11-11: The deprecation warning comment is correctly placed. Ensure to plan for the removal of deprecated elements in future versions.
x/accounts/module.go (3)
- 9-9: Correctly added
google.golang.org/grpc
import for updated service registration methods.- 36-37: Correctly updated
AppModule
to implementHasServices
for compliance with updated interfaces.- 64-68: Updated
RegisterServices
function signature to usegrpc.ServiceRegistrar
correctly aligns with the updated service registration methods.types/module/configurator.go (1)
- 17-22: > 📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [10-10]
The deprecation notice for the
Configurator
interface is correctly documented, providing clear guidance on using core services for future developments.runtime/app.go (2)
- 44-44: Correctly updated the
configurator
field type tomodule.Configurator
with an appropriate deprecation note.- 236-236: Correctly updated the
Configurator
method signature to returnmodule.Configurator
with an appropriate deprecation note.runtime/module.go (1)
- 39-39: The deprecation warning comment is correctly placed for the
RegisterServices
method. Ensure to plan for the removal of deprecated elements in future versions.
@@ -177,7 +177,7 @@ type SimApp struct { | |||
sm *module.SimulationManager | |||
|
|||
// module configurator | |||
configurator module.Configurator | |||
configurator module.Configurator // nolint:staticcheck // SA1019: Configurator is deprecated but still used in runtime v1. |
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 change to the configurator
field's type to module.Configurator
aligns with the PR's objective to utilize the latest migration API. However, the use of nolint:staticcheck
to suppress the deprecation warning SA1019
should be accompanied by a comment explaining why this deprecated feature is still being used and any plans for future migration away from it.
- configurator module.Configurator // nolint:staticcheck // SA1019: Configurator is deprecated but still used in runtime v1.
+ configurator module.Configurator // nolint:staticcheck // SA1019: Configurator is deprecated but still used in runtime v1. Explain why and future plans.
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
configurator module.Configurator // nolint:staticcheck // SA1019: Configurator is deprecated but still used in runtime v1. | |
configurator module.Configurator // nolint:staticcheck // SA1019: Configurator is deprecated but still used in runtime v1. Explain why and future plans. |
@@ -651,7 +651,7 @@ | |||
return app.ModuleManager.EndBlock(ctx) | |||
} | |||
|
|||
func (a *SimApp) Configurator() module.Configurator { | |||
func (a *SimApp) Configurator() module.Configurator { // nolint:staticcheck // SA1019: Configurator is deprecated but still used in runtime v1. |
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 method Configurator()
correctly returns the module.Configurator
type, consistent with the changes made to the configurator
field. The suppression of the deprecation warning SA1019
is noted. As with the field change, it's important to document the rationale behind continuing to use a deprecated feature and any intended migration strategy.
- func (a *SimApp) Configurator() module.Configurator { // nolint:staticcheck // SA1019: Configurator is deprecated but still used in runtime v1.
+ func (a *SimApp) Configurator() module.Configurator { // nolint:staticcheck // SA1019: Configurator is deprecated but still used in runtime v1. Document why and future plans.
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
func (a *SimApp) Configurator() module.Configurator { // nolint:staticcheck // SA1019: Configurator is deprecated but still used in runtime v1. | |
func (a *SimApp) Configurator() module.Configurator { // nolint:staticcheck // SA1019: Configurator is deprecated but still used in runtime v1. Document why and future plans. |
Description
Follow-up of #19410 to make core use the latest migration api now that it is possible.
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.
I have...
Summary by CodeRabbit
sdk.Context
tocontext.Context
in migration functions, aligning with broader context handling practices.