Skip to content

Commit

Permalink
Merge branch 'main' into son/audit_auth
Browse files Browse the repository at this point in the history
  • Loading branch information
sontrinh16 authored Aug 8, 2024
2 parents 7faddfe + 8400d9b commit 44f6a42
Show file tree
Hide file tree
Showing 420 changed files with 12,958 additions and 6,067 deletions.
57 changes: 57 additions & 0 deletions .github/scripts/check-compat.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#!/bin/bash

if [ $# -lt 3 ]; then
echo "Usage: check-compat.sh <branch> <simapp_version> [<go_mod_name1> <go_mod_name2> ...]"
exit 1
fi

dir="tmp"
branch=$1
simapp_version=$2
shift 3
go_mod_names=("$@")

# clone cosmos-sdk
export FILTER_BRANCH_SQUELCH_WARNING=1
git clone -b $branch --depth 1 https://github.com/cosmos/cosmos-sdk $dir

# save last commit branch commit
COMMIT=$(git rev-parse HEAD)
# save the last main commit
latest_commit=$(git ls-remote https://github.com/cosmos/cosmos-sdk.git refs/heads/main | cut -f1 || "main")

# if simapp_version is v2 then use simapp/v2
if [ $simapp_version == "v2" ]; then
cd $dir/simapp/v2
else
cd $dir/simapp
fi

# bump all cosmos-sdk packages to latest branch commit
VERSIONS=$(go mod edit -json | jq -r '.Replace[].Old.Path')

# Initialize variables for different types of replaces
BRANCH_REPLACES=""
MAIN_REPLACES=""
REQUIRES=""

for version in $VERSIONS; do
if [[ " ${go_mod_names[@]} " =~ " ${version} " ]]; then
MAIN_REPLACES+=" -replace $version=$version@$latest_commit"
continue
elif [[ $version == "github.com/cosmos/cosmos-sdk"* || $version == "cosmossdk.io/"* ]]; then
BRANCH_REPLACES+=" -replace $version=$version@$COMMIT"
fi
done

for mod in ${go_mod_names[@]}; do
REQUIRES+=" -require $mod@$latest_commit"
done

# Apply the replaces
go mod edit $BRANCH_REPLACES $MAIN_REPLACES $REQUIRES

go mod tidy

# Test SimApp
go test -mod=readonly -v ./...
4 changes: 2 additions & 2 deletions .github/workflows/proto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: bufbuild/buf-setup-action@v1.35.1
- uses: bufbuild/buf-setup-action@v1.36.0
- uses: bufbuild/buf-lint-action@v1
with:
input: "proto"
Expand All @@ -24,7 +24,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: bufbuild/buf-setup-action@v1.35.1
- uses: bufbuild/buf-setup-action@v1.36.0
- uses: bufbuild/buf-breaking-action@v1
with:
input: "proto"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Create release
uses: goreleaser/goreleaser-action@v3
with:
args: release --rm-dist --release-notes ./RELEASE_NOTES.md
args: release --clean --release-notes ./RELEASE_NOTES.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down
75 changes: 75 additions & 0 deletions .github/workflows/software-compat-v052.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: SimApp (v2) v0.52 Integration with Main
on:
push:
branches:
- main
workflow_dispatch:
jobs:
compat:
name: Software Compat
runs-on: ubuntu-latest
steps:
- name: Check out source
uses: actions/checkout@v4
with:
sparse-checkout: |
.github/scripts/check-compat.sh
sparse-checkout-cone-mode: false
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.22"
check-latest: true
- name: Test v052 with latest main
run: |
.github/scripts/check-compat.sh $BRANCH $SIMAPP_VERSION cosmossdk.io/runtime/v2 cosmossdk.io/server/v2 cosmossdk.io/store/v2 cosmossdk.io/server/v2/stf cosmossdk.io/server/v2/appmanager cosmossdk.io/api cosmossdk.io/store cosmossdk.io/core cosmossdk.io/core/testing
env:
BRANCH: release/v0.52.x
SIMAPP_VERSION: v1
- name: Test v052 v2 with latest main
run: |
.github/scripts/check-compat.sh $BRANCH $SIMAPP_VERSION cosmossdk.io/runtime/v2 cosmossdk.io/server/v2 cosmossdk.io/store/v2 cosmossdk.io/server/v2/stf cosmossdk.io/server/v2/appmanager cosmossdk.io/api cosmossdk.io/store cosmossdk.io/core cosmossdk.io/core/testing
env:
BRANCH: release/v0.52.x
SIMAPP_VERSION: v2
sims-notify-success:
needs: [compat]
runs-on: ubuntu-latest
if: ${{ success() }}
steps:
- uses: actions/checkout@v4
- name: Get previous workflow status
uses: ./.github/actions/last-workflow-status
id: last_status
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Notify Slack on success
if: ${{ steps.last_status.outputs.last_status == 'failure' }}
uses: rtCamp/action-slack-notify@v2.3.0
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_CHANNEL: sdk-sims
SLACK_USERNAME: release/v0.52.x x main compat
SLACK_ICON_EMOJI: ":white_check_mark:"
SLACK_COLOR: good
SLACK_MESSAGE: Latest main x v0.52.x is compatible
SLACK_FOOTER: ""

sims-notify-failure:
permissions:
contents: none
needs: [compat]
runs-on: ubuntu-latest
if: ${{ failure() }}
steps:
- name: Notify Slack on failure
uses: rtCamp/action-slack-notify@v2.3.0
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_CHANNEL: sdk-sims
SLACK_USERNAME: release/v0.52.x x main compat
SLACK_ICON_EMOJI: ":skull:"
SLACK_COLOR: danger
SLACK_MESSAGE: Latest main x v0.52.x is breaking
SLACK_FOOTER: ""
30 changes: 30 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,36 @@ jobs:
with:
projectBaseDir: schema/

test-schema-testing:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.22"
cache: true
cache-dependency-path: schema/testing/go.sum
- uses: technote-space/get-diff-action@v6.1.2
id: git_diff
with:
PATTERNS: |
schema/testing/**/*.go
schema/testing/go.mod
schema/testing/go.sum
- name: tests
if: env.GIT_DIFF
run: |
cd schema
go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic ./...
- name: sonarcloud
if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }}
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
projectBaseDir: schema/testing/

test-indexer-postgres:
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ snapshot:
name_template: SNAPSHOT-{{ .Commit }}

changelog:
skip: false
disable: false
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ Every module contains its own CHANGELOG.md. Please refer to the module you are i
### Improvements

* (codec) [#20122](https://github.com/cosmos/cosmos-sdk/pull/20122) Added a cache to address codec.
* (bank) [#20354](https://github.com/cosmos/cosmos-sdk/pull/20354) Reduce the number of `ValidateDenom` calls in `bank.SendCoins`.
* (types) [#19869](https://github.com/cosmos/cosmos-sdk/pull/19869) Removed `Any` type from `codec/types` and replaced it with an alias for `cosmos/gogoproto/types/any`.
* (server) [#19854](https://github.com/cosmos/cosmos-sdk/pull/19854) Add customizability to start command.
* Add `StartCmdOptions` in `server.AddCommands` instead of `servertypes.ModuleInitFlags`. To set custom flags set them in the `StartCmdOptions` struct on the `AddFlags` field.
Expand Down Expand Up @@ -108,6 +107,7 @@ Every module contains its own CHANGELOG.md. Please refer to the module you are i

### Bug Fixes

* (baseapp) [#21159](https://github.com/cosmos/cosmos-sdk/pull/21159) Return PreBlocker events in FinalizeBlockResponse.
* (baseapp) [#18727](https://github.com/cosmos/cosmos-sdk/pull/18727) Ensure that `BaseApp.Init` firstly returns any errors from a nil commit multistore instead of panicking on nil dereferencing and before sealing the app.
* (client) [#18622](https://github.com/cosmos/cosmos-sdk/pull/18622) Fixed a potential under/overflow from `uint64->int64` when computing gas fees as a LegacyDec.
* (client/keys) [#18562](https://github.com/cosmos/cosmos-sdk/pull/18562) `keys delete` won't terminate when a key is not found.
Expand Down
30 changes: 29 additions & 1 deletion RELEASE_PROCESS.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ v1.0.0-beta1 → v1.0.0-beta2 → ... → v1.0.0-rc1 → v1.0.0-rc2 → ... →
* Tooling is tracked and tested directly on main.
* This does not apply for tooling depending on the SDK (e.g. `confix`)
* Update `Dockerfile` to not use latest go.mod and go.sum files.
* Remove all other components that do not depend on the SDK from the release branch (See [Go Monorepo Branching Strategy](#go-monorepo-branching-strategy)).
* Delete `log`, `core`, `errors`, ... packages
* Update all the remaining `go.mod` files to use the latest released versions (the ones tagged from main) or latest commits from the main branch.
* Create a new annotated git tag for a release candidate (eg: `git tag -a v1.1.0-rc1`) in the release branch.
* from this point we unfreeze main.
* the SDK teams collaborate and do their best to run testnets in order to validate the release.
Expand Down Expand Up @@ -212,7 +215,7 @@ Currently residing Stable Release Managers:
* @tac0turtle - Marko Baricevic
* @julienrbrt - Julien Robert

## Cosmos SDK Modules
## Cosmos SDK Modules Tagging Strategy

The Cosmos SDK repository is a mono-repo where its Go modules have a different release process and cadence than the Cosmos SDK itself.
There are two types of modules:
Expand All @@ -236,3 +239,28 @@ Those modules can be considered as part of the Cosmos SDK, but features and impr
### Modules that do not depend on the Cosmos SDK

Modules that do not depend on the Cosmos SDK can be released at any time from the `main` branch of the Cosmos SDK repository.

## Go Monorepo Branching Strategy

The Cosmos SDK uses a monorepo structure with multiple Go modules. Some components are tagged from the main branch, while others are tagged from release branches, as described above.

Here's the strategy for managing this structure:

All modules that do not depend on the Cosmos SDK and tagged from main in a release branch must be removed from the release branch.

### Rationale

This strategy provides several benefits:

1. Clean separation: Release branches only contain components that are actually released from those branches.
2. Avoid confusion: Prevents having outdated versions of standalone go modules in release branches.
3. Accurate representation: The release branch accurately represents what's being released from that branch.
4. Consistency: Aligns with the tagging strategy - components tagged from main aren't in release branches, and vice versa.

### Additional Considerations

* When backporting changes, be aware that standalone go modules changes will not be present in release branches.
* To reference the full state of the SDK at the time of branching, consider creating a separate tag on main at the point where each release branch is created.
* Ensure thorough testing of the release branch structure to avoid any integration issues.

This branching strategy helps maintain a clear separation between components tagged from main and those tagged from release branches, while ensuring that release branches accurately represent the state of components that depend on the SDK.
41 changes: 30 additions & 11 deletions api/cosmos/accounts/v1/query_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 44f6a42

Please sign in to comment.