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(accounts): move multisig into its own go.mod #20928

Merged
merged 6 commits into from
Jul 10, 2024

Conversation

facundomedica
Copy link
Member

@facundomedica facundomedica commented Jul 10, 2024

Description

Closes: #20899


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, you can find examples of the prefixes below:
  • confirmed ! in 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
  • reviewed "Files changed" and left comments if necessary
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • updated the relevant documentation or specification, including comments for documenting Go code
  • 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.

Please see Pull Request Reviewer section in the contributing guide for more information on how to review a pull request.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic, API design and naming, documentation is accurate, tests and test coverage

Summary by CodeRabbit

  • Chores
    • Updated module dependencies across various components to include support for cosmossdk.io/x/accounts/defaults/multisig.

@facundomedica facundomedica requested a review from a team as a code owner July 10, 2024 08:12
Copy link
Contributor

coderabbitai bot commented Jul 10, 2024

Walkthrough

Walkthrough

The changes introduce a new go.mod file for the cosmossdk.io/x/accounts/defaults/multisig module to isolate its dependencies and prevent the x/bank module from leaking into x/accounts. This includes updating the require and replace sections in various go.mod files across the project to reflect this new module addition.

Changes

File Path Change Summary
simapp/go.mod Added cosmossdk.io/x/accounts/defaults/multisig in require and replace sections.
simapp/v2/go.mod Added cosmossdk.io/x/accounts/defaults/multisig as an indirect dependency and updated the replace directive to point to the local path.
tests/go.mod Added cosmossdk.io/x/accounts/defaults/multisig in require and replace sections.
x/accounts/go.mod Added cosmossdk.io/x/accounts/defaults/multisig as a dependency and referenced github.com/cosmos/cosmos-proto as an indirect dependency.
x/accounts/defaults/multisig/go.mod Introduced module dependencies and replacements for various packages.
x/group/go.mod Added cosmossdk.io/x/accounts/defaults/multisig as an indirect dependency and updated the module replacement.

Assessment against linked issues

Objective Addressed Explanation
Create separate go.mod for multisig in order to avoid x/bank leaking into x/accounts (#20899)

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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • 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/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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.

Actionable comments posted: 0

Review details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between ee11965 and 445db7c.

Files selected for processing (5)
  • simapp/go.mod (2 hunks)
  • simapp/v2/go.mod (2 hunks)
  • tests/go.mod (2 hunks)
  • x/accounts/go.mod (3 hunks)
  • x/group/go.mod (2 hunks)
Files skipped from review due to trivial changes (2)
  • simapp/go.mod
  • tests/go.mod
Additional comments not posted (6)
x/accounts/go.mod (2)

11-11: Update placeholder version for cosmossdk.io/x/accounts/defaults/multisig.

The version v0.0.0-00010101000000-000000000000 is a placeholder and should be updated to a valid version before release.


189-189: LGTM!

The replace directive for cosmossdk.io/x/accounts/defaults/multisig correctly points to ./defaults/multisig.

x/group/go.mod (2)

48-48: Update placeholder version for cosmossdk.io/x/accounts/defaults/multisig.

The version v0.0.0-00010101000000-000000000000 is a placeholder and should be updated to a valid version before release.


194-194: LGTM!

The replace directive for cosmossdk.io/x/accounts/defaults/multisig correctly points to ../accounts/defaults/multisig.

simapp/v2/go.mod (2)

70-70: Update placeholder version for cosmossdk.io/x/accounts/defaults/multisig.

The version v0.0.0-00010101000000-000000000000 is a placeholder and should be updated to a valid version before release.


259-259: LGTM!

The replace directive for cosmossdk.io/x/accounts/defaults/multisig correctly points to ../../x/accounts/defaults/multisig.

Copy link
Contributor

@testinginprod testinginprod left a comment

Choose a reason for hiding this comment

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

lgtm!

@facundomedica facundomedica enabled auto-merge July 10, 2024 09:44
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.

Actionable comments posted: 0

Review details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 445db7c and f332b66.

Files ignored due to path filters (1)
  • x/accounts/defaults/multisig/go.sum is excluded by !**/*.sum
Files selected for processing (6)
  • simapp/go.mod (2 hunks)
  • simapp/v2/go.mod (2 hunks)
  • tests/go.mod (2 hunks)
  • x/accounts/defaults/multisig/go.mod (1 hunks)
  • x/accounts/go.mod (3 hunks)
  • x/group/go.mod (2 hunks)
Files skipped from review as they are similar to previous changes (5)
  • simapp/go.mod
  • simapp/v2/go.mod
  • tests/go.mod
  • x/accounts/go.mod
  • x/group/go.mod
Additional comments not posted (4)
x/accounts/defaults/multisig/go.mod (4)

1-3: Module declaration looks good.

The module name and Go version are appropriately specified.


5-16: Required dependencies are specified correctly.

The dependencies are listed with appropriate versions. Ensure that the versions are consistent with the rest of the codebase.

Verification successful

Required dependencies are specified correctly.

The dependencies listed in x/accounts/defaults/multisig/go.mod are consistent with the versions found in other go.mod files across the codebase.

  • cosmossdk.io/collections v0.4.0
  • cosmossdk.io/core v0.12.1-0.20231114100755-569e3ff6a0d7
  • cosmossdk.io/math v1.3.0
  • cosmossdk.io/x/accounts v0.0.0-00010101000000-000000000000
  • cosmossdk.io/x/bank v0.0.0-20240226161501-23359a0b6d91
  • github.com/cosmos/cosmos-proto v1.0.0-beta.5
  • github.com/cosmos/cosmos-sdk v0.51.0
  • github.com/cosmos/gogoproto v1.5.0
  • github.com/stretchr/testify v1.9.0
  • google.golang.org/protobuf v1.34.2
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the consistency of listed dependencies across the codebase.

# Test: Search for dependency versions in go.mod files. Expect: Consistent versions.
rg --type go.mod -A 5 $'require ('

Length of output: 104


Script:

#!/bin/bash
# Description: Verify the consistency of listed dependencies across the codebase.

# Test: Search for dependency versions in go.mod files. Expect: Consistent versions.
rg --type go.mod -A 10 '^require \('

Length of output: 69


Script:

#!/bin/bash
# Description: Verify the consistency of listed dependencies across the codebase.

# Test: Search for dependency versions in go.mod files. Expect: Consistent versions.
rg -t go -g 'go.mod' -A 10 '^require \('

Length of output: 68044


173-191: Replacement directives look good.

The replacement directives are specified with appropriate paths. Ensure that the paths are correct and consistent with the rest of the codebase.


18-171: Indirect dependencies are specified correctly.

The indirect dependencies are listed with appropriate versions. Ensure that the versions are consistent with the rest of the codebase.

Verification successful

Indirect dependencies are specified correctly.

The versions of indirect dependencies in the file x/accounts/defaults/multisig/go.mod are consistent with the versions found in other go.mod files across the codebase.

  • buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.34.2-20240701160653-fedbb9acfd2f.2
  • buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.34.2-20240130113600-88ef6483f90f.2
  • cosmossdk.io/api v0.7.5
  • cosmossdk.io/core/testing v0.0.0-00010101000000-000000000000
  • cosmossdk.io/depinject v1.0.0-alpha.4
  • cosmossdk.io/errors v1.0.1
  • cosmossdk.io/log v1.3.1
  • cosmossdk.io/schema v0.1.1
  • cosmossdk.io/store v1.1.1-0.20240418092142-896cdf1971bc
  • cosmossdk.io/x/auth v0.0.0-00010101000000-000000000000
  • cosmossdk.io/x/consensus v0.0.0-00010101000000-000000000000
  • cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000
  • cosmossdk.io/x/tx v0.13.3
  • filippo.io/edwards25519 v1.1.0
  • github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4
  • github.com/99designs/keyring v1.2.2
  • github.com/DataDog/datadog-go v4.8.3+incompatible
  • github.com/DataDog/zstd v1.5.5
  • github.com/Microsoft/go-winio v0.6.1
  • github.com/beorn7/perks v1.0.1
  • github.com/bgentry/speakeasy v0.2.0
  • github.com/btcsuite/btcd/btcec/v2 v2.3.3
  • github.com/cespare/xxhash/v2 v2.3.0
  • github.com/cockroachdb/errors v1.11.1
  • github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b
  • github.com/cockroachdb/pebble v1.1.0
  • github.com/cockroachdb/redact v1.1.5
  • github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06
  • github.com/cometbft/cometbft v1.0.0-rc1
  • github.com/cometbft/cometbft-db v0.12.0
  • github.com/cometbft/cometbft/api v1.0.0-rc.1
  • github.com/cosmos/btcutil v1.0.5
  • github.com/cosmos/cosmos-db v1.0.2
  • github.com/cosmos/crypto v0.1.1
  • github.com/cosmos/go-bip39 v1.0.0
  • github.com/cosmos/gogogateway v1.2.0
  • github.com/cosmos/iavl v1.2.0
  • github.com/cosmos/ics23/go v0.10.0
  • github.com/cosmos/ledger-cosmos-go v0.13.3
  • github.com/danieljoos/wincred v1.2.1
  • github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc
  • github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0
  • github.com/dgraph-io/badger/v4 v4.2.0
  • github.com/dgraph-io/ristretto v0.1.1
  • github.com/dustin/go-humanize v1.0.1
  • github.com/dvsekhvalnov/jose2go v1.6.0
  • github.com/emicklei/dot v1.6.2
  • github.com/fatih/color v1.17.0
  • github.com/felixge/httpsnoop v1.0.4
  • github.com/fsnotify/fsnotify v1.7.0
  • github.com/getsentry/sentry-go v0.27.0
  • github.com/go-kit/kit v0.13.0
  • github.com/go-kit/log v0.2.1
  • github.com/go-logfmt/logfmt v0.6.0
  • github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2
  • github.com/gofrs/uuid v4.4.0+incompatible
  • github.com/gogo/googleapis v1.4.1
  • github.com/gogo/protobuf v1.3.2
  • github.com/golang/glog v1.2.0
  • github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da
  • github.com/golang/protobuf v1.5.4
  • github.com/golang/snappy v0.0.4
  • github.com/google/btree v1.1.2
  • github.com/google/flatbuffers v2.0.8+incompatible
  • github.com/google/go-cmp v0.6.0
  • github.com/google/orderedcode v0.0.1
  • github.com/gorilla/handlers v1.5.2
  • github.com/gorilla/mux v1.8.1
  • github.com/gorilla/websocket v1.5.3
  • github.com/grpc-ecosystem/go-grpc-middleware v1.4.0
  • github.com/grpc-ecosystem/grpc-gateway v1.16.0
  • github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c
  • github.com/hashicorp/go-hclog v1.6.3
  • github.com/hashicorp/go-immutable-radix v1.3.1
  • github.com/hashicorp/go-metrics v0.5.3
  • github.com/hashicorp/go-plugin v1.6.1
  • github.com/hashicorp/golang-lru v1.0.2
  • github.com/hashicorp/golang-lru/v2 v2.0.7
  • github.com/hashicorp/hcl v1.0.0
  • github.com/hashicorp/yamux v0.1.1
  • github.com/hdevalence/ed25519consensus v0.2.0
  • github.com/huandu/skiplist v1.2.0
  • github.com/iancoleman/strcase v0.3.0
  • github.com/inconshreveable/mousetrap v1.1.0
  • github.com/jmhodges/levigo v1.0.0
  • github.com/klauspost/compress v1.17.8
  • github.com/kr/pretty v0.3.1
  • github.com/kr/text v0.2.0
  • github.com/lib/pq v1.10.9
  • github.com/libp2p/go-buffer-pool v0.1.0
  • github.com/linxGnu/grocksdb v1.8.14
  • github.com/magiconair/properties v1.8.7
  • github.com/mattn/go-colorable v0.1.13
  • github.com/mattn/go-isatty v0.0.20
  • github.com/minio/highwayhash v1.0.2
  • github.com/mitchellh/go-testing-interface v1.14.1
  • github.com/mitchellh/mapstructure v1.5.0
  • github.com/mtibben/percent v0.2.1
  • github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822
  • github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a
  • github.com/oklog/run v1.1.0
  • github.com/pelletier/go-toml/v2 v2.2.2
  • github.com/petermattis/goid v0.0.0-20240327183114-c42a807a84ba
  • github.com/pkg/errors v0.9.1
  • github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2
  • github.com/prometheus/client_golang v1.19.1
  • github.com/prometheus/client_model v0.6.1
  • github.com/prometheus/common v0.55.0
  • github.com/prometheus/procfs v0.15.1
  • github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475
  • github.com/rogpeppe/go-internal v1.12.0
  • github.com/rs/cors v1.11.0
  • github.com/rs/zerolog v1.33.0
  • github.com/sagikazarmark/locafero v0.4.0
  • github.com/sagikazarmark/slog-shim v0.1.0
  • github.com/sasha-s/go-deadlock v0.3.1
  • github.com/sourcegraph/conc v0.3.0
  • github.com/spf13/afero v1.11.0
  • github.com/spf13/cast v1.6.0
  • github.com/spf13/cobra v1.8.1
  • github.com/spf13/pflag v1.0.5
  • github.com/spf13/viper v1.19.0
  • github.com/subosito/gotenv v1.6.0
  • github.com/supranational/blst v0.3.12
  • github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d
  • github.com/tendermint/go-amino v0.16.0
  • github.com/tidwall/btree v1.7.0
  • github.com/zondax/hid v0.9.2
  • github.com/zondax/ledger-go v0.14.3
  • gitlab.com/yawning/secp256k1-voi v0.0.0-20230925100816-f2616030848b
  • gitlab.com/yawning/tuplehash v0.0.0-20230713102510-df83abbf9a02
  • go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5
  • go.opencensus.io v0.24.0
  • go.uber.org/multierr v1.11.0
  • golang.org/x/crypto v0.25.0
  • golang.org/x/exp v0.0.0-20240531132922-fd00a4e0eefc
  • golang.org/x/mod v0.17.0
  • golang.org/x/net v0.27.0
  • golang.org/x/sync v0.7.0
  • golang.org/x/sys v0.22.0
  • golang.org/x/term v0.22.0
  • golang.org/x/text v0.16.0
  • golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d
  • google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de
  • google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237
  • google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5
  • google.golang.org/grpc v1.64.1
  • gopkg.in/ini.v1 v1.67.0
  • gopkg.in/yaml.v3 v3.0.1
  • gotest.tools/v3 v3.5.1
  • pgregory.net/rapid v1.1.0
  • sigs.k8s.io/yaml v1.4.0
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the consistency of listed indirect dependencies across the codebase.

# Test: Search for indirect dependency versions in go.mod files. Expect: Consistent versions.
rg --type go.mod -A 5 $'require ('

Length of output: 104


Script:

#!/bin/bash
# Description: Verify the consistency of listed indirect dependencies across the codebase.

# Test: Search for indirect dependency versions in go.mod files. Expect: Consistent versions.
rg --type go.mod -A 5 'require \('

Length of output: 67


Script:

#!/bin/bash
# Description: Verify the consistency of listed indirect dependencies across the codebase.

# Locate all go.mod files and search for the 'require (' pattern within them.
fd --type f --name go.mod --exec rg 'require \(' {}

Length of output: 306


Script:

#!/bin/bash
# Description: Verify the consistency of listed indirect dependencies across the codebase.

# Locate all go.mod files and search for the 'require (' pattern within them.
fd --type f --extension mod --exec rg 'require \(' {}

Length of output: 1117


Script:

#!/bin/bash
# Description: Verify the consistency of listed indirect dependencies across the codebase.

# Locate all go.mod files and search for the 'require (' pattern within them, including filenames and context lines.
fd --type f --extension mod --exec rg -H -A 10 'require \(' {}

Length of output: 70135

@facundomedica facundomedica added this pull request to the merge queue Jul 10, 2024
Merged via the queue into main with commit ab6400f Jul 10, 2024
68 checks passed
@facundomedica facundomedica deleted the facu/multisig-gomod branch July 10, 2024 10:02
@julienrbrt
Copy link
Member

You need to follow this as well https://github.com/cosmos/cosmos-sdk/blob/main/CONTRIBUTING.md#gomod
Otherwise no tests will run for that go.mod. Additionally we need the vanity url to be created otherwise it breaks go get go.mod:255:2: unrecognized import path "cosmossdk.io/x/accounts/defaults/multisig": reading https://cosmossdk.io/x/accounts/defaults/multisig?go-get=1: 404 Not Found

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.

refactor(accounts/multisig): create separate go.mod
4 participants