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

refactor(mint): new go module #18283

Merged
merged 2 commits into from
Oct 28, 2023
Merged

refactor(mint): new go module #18283

merged 2 commits into from
Oct 28, 2023

Conversation

tac0turtle
Copy link
Member

@tac0turtle tac0turtle commented Oct 27, 2023

Description

Closes: #17813
ref #11899

spinout mint to its own go module

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

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • run make lint and make test
  • confirmed all CI checks have passed

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

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

Summary by CodeRabbit

  • Refactor: The 'mint' module has been restructured and moved to its own 'go.mod' file, improving the modularity and maintainability of the codebase. This change also includes updates to import paths across various files to align with the new module structure.
  • New Feature: A new job "test-x-mint" has been added to the workflow, enhancing the testing process by running tests and generating a coverage report for the 'mint' package whenever changes are detected.
  • Chore: SonarCloud analysis is now set up for the 'mint' module, improving code quality tracking and ensuring adherence to coding standards.
  • Documentation: An initial template for a changelog file has been added to the 'mint' module, providing a structured way to document changes and updates in the future.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 27, 2023

Walkthrough

The changes primarily involve the migration of the mint module from the github.com/cosmos/cosmos-sdk repository to its own repository at cosmossdk.io/x/mint. This includes updates to import paths across multiple files, addition of a new GitHub workflow job, and SonarQube configuration for the new module.

Changes

Files Summary
.github/workflows/test.yml Added a new job "test-x-mint" to the workflow.
CHANGELOG.md, UPGRADING.md Documented the migration of the mint module to its own go.mod file.
baseapp/*, simapp/*, tests/*, x/* Updated import paths from github.com/cosmos/cosmos-sdk/x/mint to cosmossdk.io/x/mint.
contrib/images/simd-env/Dockerfile Added the x/mint module to the project and downloaded its dependencies.
proto/cosmos/mint/* Updated the go_package option in protobuf files to reflect the new import path.
x/mint/sonar-project.properties Added SonarQube configuration for the new mint module.

"In the land of code, where logic is king, 🐇
A module was moved, a simple thing. 📦
From one place to another, it took flight, 🚀
Making our codebase a more delightful sight. 👀
So here's to the mint, in its new home, 🏠
May it prosper wherever its functions roam!" 🌐


Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • If you reply to a review comment from CodeRabbit, the bot will automatically respond.
  • To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment
  • Note: Review comments are made on code diffs or files, not on the PR overview.
  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

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 a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai help to get help.

Note: For conversation with the bot, please use the review comments on code diffs or files.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • 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/coderabbit-overrides.json

@tac0turtle tac0turtle marked this pull request as ready for review October 27, 2023 13:07
@tac0turtle tac0turtle requested a review from a team as a code owner October 27, 2023 13:07
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 UI

Commits Files that changed from the base of the PR and between 21e69ba and c25b875.
Files ignored due to filter (21)
  • client/v2/go.mod
  • go.mod
  • simapp/go.mod
  • tests/go.mod
  • tests/starship/tests/go.mod
  • x/authz/go.mod
  • x/bank/go.mod
  • x/circuit/go.mod
  • x/distribution/go.mod
  • x/evidence/go.mod
  • x/feegrant/go.mod
  • x/gov/go.mod
  • x/group/go.mod
  • x/mint/go.mod
  • x/mint/go.sum
  • x/nft/go.mod
  • x/params/go.mod
  • x/protocolpool/go.mod
  • x/slashing/go.mod
  • x/staking/go.mod
  • x/upgrade/go.mod
Files selected for processing (57)
  • .github/workflows/test.yml (1} hunks)
  • CHANGELOG.md (1} hunks)
  • UPGRADING.md (1} hunks)
  • baseapp/block_gas_test.go (2} hunks)
  • baseapp/utils_test.go (2} hunks)
  • contrib/images/simd-env/Dockerfile (1} hunks)
  • proto/cosmos/mint/module/v1/module.proto (1} hunks)
  • proto/cosmos/mint/v1beta1/genesis.proto (1} hunks)
  • proto/cosmos/mint/v1beta1/mint.proto (1} hunks)
  • proto/cosmos/mint/v1beta1/query.proto (1} hunks)
  • proto/cosmos/mint/v1beta1/tx.proto (1} hunks)
  • simapp/app.go (2} hunks)
  • simapp/app_config.go (2} hunks)
  • simapp/app_test.go (2} hunks)
  • simapp/app_v2.go (2} hunks)
  • simapp/simd/cmd/testnet_test.go (2} hunks)
  • simapp/test_helpers.go (2} hunks)
  • tests/e2e/mint/grpc.go (1} hunks)
  • tests/e2e/mint/suite.go (1} hunks)
  • tests/integration/bank/keeper/deterministic_test.go (2} hunks)
  • tests/integration/evidence/keeper/infraction_test.go (2} hunks)
  • tests/integration/gov/keeper/keeper_test.go (2} hunks)
  • tests/integration/gov/module_test.go (1} hunks)
  • tests/integration/rapidgen/rapidgen.go (2} hunks)
  • tests/integration/slashing/keeper/keeper_test.go (2} hunks)
  • tests/integration/staking/keeper/common_test.go (2} hunks)
  • tests/integration/staking/keeper/deterministic_test.go (2} hunks)
  • tests/integration/staking/simulation/operations_test.go (2} hunks)
  • tests/integration/tx/aminojson/aminojson_test.go (2} hunks)
  • tests/integration/tx/decode_test.go (2} hunks)
  • testutil/configurator/configurator.go (1} hunks)
  • testutil/integration/example_test.go (2} hunks)
  • testutil/sims/address_helpers.go (1} hunks)
  • x/authz/testutil/app_config.go (1} hunks)
  • x/distribution/client/cli/tx_test.go (2} hunks)
  • x/distribution/testutil/app_config.go (2} hunks)
  • x/feegrant/simulation/operations_test.go (2} hunks)
  • x/group/keeper/keeper_test.go (2} hunks)
  • x/group/keeper/msg_server_test.go (1} hunks)
  • x/group/testutil/app_config.go (1} hunks)
  • x/mint/CHANGELOG.md (1} hunks)
  • x/mint/abci.go (1} hunks)
  • x/mint/keeper/genesis.go (1} hunks)
  • x/mint/keeper/genesis_test.go (1} hunks)
  • x/mint/keeper/grpc_query.go (1} hunks)
  • x/mint/keeper/grpc_query_test.go (1} hunks)
  • x/mint/keeper/keeper.go (1} hunks)
  • x/mint/keeper/keeper_test.go (1} hunks)
  • x/mint/keeper/msg_server.go (1} hunks)
  • x/mint/keeper/msg_server_test.go (1} hunks)
  • x/mint/module.go (1} hunks)
  • x/mint/module_test.go (1} hunks)
  • x/mint/simulation/genesis.go (1} hunks)
  • x/mint/simulation/genesis_test.go (1} hunks)
  • x/mint/simulation/proposals.go (1} hunks)
  • x/mint/simulation/proposals_test.go (1} hunks)
  • x/mint/sonar-project.properties (1} hunks)
Files not processed due to max files limit (6)
  • x/mint/testutil/app_config.go
  • x/nft/testutil/app_config.go
  • x/protocolpool/testutil/app_config.go
  • x/slashing/simulation/operations_test.go
  • x/slashing/testutil/app_config.go
  • x/staking/testutil/app_config.go
Files skipped from review due to trivial changes (52)
  • .github/workflows/test.yml
  • CHANGELOG.md
  • UPGRADING.md
  • baseapp/block_gas_test.go
  • baseapp/utils_test.go
  • proto/cosmos/mint/module/v1/module.proto
  • proto/cosmos/mint/v1beta1/genesis.proto
  • proto/cosmos/mint/v1beta1/mint.proto
  • proto/cosmos/mint/v1beta1/query.proto
  • proto/cosmos/mint/v1beta1/tx.proto
  • simapp/app.go
  • simapp/app_v2.go
  • simapp/simd/cmd/testnet_test.go
  • simapp/test_helpers.go
  • tests/e2e/mint/grpc.go
  • tests/e2e/mint/suite.go
  • tests/integration/bank/keeper/deterministic_test.go
  • tests/integration/evidence/keeper/infraction_test.go
  • tests/integration/gov/keeper/keeper_test.go
  • tests/integration/gov/module_test.go
  • tests/integration/rapidgen/rapidgen.go
  • tests/integration/slashing/keeper/keeper_test.go
  • tests/integration/staking/keeper/common_test.go
  • tests/integration/staking/keeper/deterministic_test.go
  • tests/integration/staking/simulation/operations_test.go
  • tests/integration/tx/aminojson/aminojson_test.go
  • tests/integration/tx/decode_test.go
  • testutil/configurator/configurator.go
  • testutil/integration/example_test.go
  • testutil/sims/address_helpers.go
  • x/authz/testutil/app_config.go
  • x/distribution/client/cli/tx_test.go
  • x/feegrant/simulation/operations_test.go
  • x/group/keeper/keeper_test.go
  • x/group/keeper/msg_server_test.go
  • x/group/testutil/app_config.go
  • x/mint/CHANGELOG.md
  • x/mint/abci.go
  • x/mint/keeper/genesis.go
  • x/mint/keeper/genesis_test.go
  • x/mint/keeper/grpc_query.go
  • x/mint/keeper/grpc_query_test.go
  • x/mint/keeper/keeper.go
  • x/mint/keeper/keeper_test.go
  • x/mint/keeper/msg_server.go
  • x/mint/keeper/msg_server_test.go
  • x/mint/module.go
  • x/mint/module_test.go
  • x/mint/simulation/genesis.go
  • x/mint/simulation/genesis_test.go
  • x/mint/simulation/proposals_test.go
  • x/mint/sonar-project.properties
Additional comments: 8
x/mint/simulation/proposals.go (1)
  • 7-7: The import path for the mint module has been updated from github.com/cosmos/cosmos-sdk/x/mint/types to cosmossdk.io/x/mint/types. Ensure that the new import path is correct and the module is available at the new location.
contrib/images/simd-env/Dockerfile (1)
  • 23-23: The addition of the mint module's go.mod and go.sum files to the Dockerfile is consistent with the changes described in the PR summary. This ensures that the mint module's dependencies are downloaded and available in the Docker image.
x/distribution/testutil/app_config.go (2)
  • 6-6: The import path for the mint module has been updated from github.com/cosmos/cosmos-sdk/x/mint to cosmossdk.io/x/mint. Ensure that the new import path is correctly configured and accessible. Also, verify that all references to the mint module in the codebase have been updated to use the new import path.

  • 12-15: The import statement for the mint module has been removed from this section. This change is consistent with the update in the import path for the mint module.

simapp/app_test.go (2)
  • 27-27: The import path for the mint module has been updated from github.com/cosmos/cosmos-sdk/x/mint to cosmossdk.io/x/mint. Ensure that all references to the mint module in the codebase have been updated to use the new import path.

  • 41-44: The import statement for the mint module has been removed from this section. This change is consistent with the update to the import path for the mint module.

simapp/app_config.go (2)
  • 49-50: The import path for the mint module has been updated from github.com/cosmos/cosmos-sdk/x/mint to cosmossdk.io/x/mint. Ensure that the new import path is correct and accessible. Also, verify that the side-effects caused by this import are still valid and necessary in the new context.

  • 71-74: The old import statements for the mint module have been removed. This is consistent with the change in the import path for the mint module. Ensure that there are no remaining references to the old import path in the codebase.

@julienrbrt julienrbrt changed the title refactor(mint):new go module refactor(mint): new go module Oct 27, 2023
Copy link
Member

@julienrbrt julienrbrt left a comment

Choose a reason for hiding this comment

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

I didn't expect mint to be imported in the SDK in tests. The dep cleaning is going to be something 😅

x/mint/sonar-project.properties Show resolved Hide resolved
@tac0turtle tac0turtle added this pull request to the merge queue Oct 28, 2023
Merged via the queue into main with commit 7bef022 Oct 28, 2023
61 of 64 checks passed
@tac0turtle tac0turtle deleted the marko/spinout_mint branch October 28, 2023 07:13
atheeshp pushed a commit that referenced this pull request Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Extract x/mint to its own go.mod
4 participants