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

docs: reword upgrading.md #19900

Merged
merged 3 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ There is no longer a need for the Cosmos SDK to host these protos for itself and
That package containing proto v2 generated code, but the SDK now uses [buf generated go SDK instead](https://buf.build/docs/bsr/generated-sdks/go).
If you were depending on `cosmossdk.io/api/tendermint`, please use the buf generated go SDK instead, or ask CometBFT host the generated proto v2 code.

The `codectypes.Any` has move to `github.com/cosmos/gogoproto/types/any`. Module developers can update the `buf.gen.gogo.yaml` configuration files by adjusting the corresponding `opt` option to `Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any` for directly mapping the`Any` type to its new location. This change is optional as `codectypes.Any` is aliased to `gogoproto.Any` in the SDK.
julienrbrt marked this conversation as resolved.
Show resolved Hide resolved

### Modules

#### `**all**`
julienrbrt marked this conversation as resolved.
Show resolved Hide resolved
Expand Down Expand Up @@ -440,10 +442,7 @@ With the deprecation of the Amino JSON codec defined in [cosmos/gogoproto](https

For core SDK types equivalence is asserted by generative testing of [SignableTypes](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-beta.0/tests/integration/rapidgen/rapidgen.go#L102) in [TestAminoJSON_Equivalence](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-beta.0/tests/integration/tx/aminojson/aminojson_test.go#L94).

Due to the `Any` type moving to the `github.com/cosmos/gogoproto/types/any` repository, module developers must update the `buf.gen.gogo.yaml` configuration files by adjusting the corresponding `opt` option to `Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any` for correct mapping to the new `Any` type location.


**TODO: summarize proto annotation requirements.**
Read more about the available annotations [here](https://docs.cosmos.network/v0.50/build/building-modules/protobuf-annotations).

#### Stringer

Expand Down
2 changes: 1 addition & 1 deletion scripts/go-mod-tidy-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ done
# automatically.
cd simapp
if command -v nix &> /dev/null
nix develop .. -c gomod2nix
then
nix develop .. -c gomod2nix
if ! command -v gomod2nix &> /dev/null
then
echo "gomod2nix could not be found in PATH, installing..."
Copy link
Contributor

Choose a reason for hiding this comment

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

📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [5-5]

Consider using a while read loop or find -exec for more robust handling of filenames, especially those containing spaces or newlines. For example:

find . -name go.mod -exec sh -c 'echo "Updating $1"; DIR=$(dirname "$1"); (cd "$DIR"; go mod tidy)' _ {} \;

📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [7-7]

Variables should be double-quoted to prevent globbing and word splitting. This is particularly important for paths that might contain spaces. For example:

DIR=$(dirname "$modfile")

📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [8-8]

To ensure the script handles directory paths correctly, especially those with spaces, wrap $DIR in double quotes:

(cd "$DIR"; go mod tidy)

Expand Down
Loading