From bb37e72816bbb57b1764350e7259e6cfa5039411 Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Fri, 22 Apr 2022 16:11:30 +0200 Subject: [PATCH 1/2] fix: dockerfile for building proto (#11452) (#11703) * fix: dockerfile for building proto (#11452) github.com/regen-network/cosmos-proto/protoc-gen-gocosmos was missing in the Dockerfile * fixed the installation with proto cosmos * updated dependencies * set the go version to 1.17 (latest is already using 1.18) * regenerated proto --- *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](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [ ] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed *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](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) 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) * update dockerfile Co-authored-by: Aleksandr Bezobchuk --- Makefile | 2 +- contrib/devtools/Dockerfile | 25 ++++++++++++++-------- scripts/protocgen.sh | 42 +++++++++++++------------------------ 3 files changed, 32 insertions(+), 37 deletions(-) diff --git a/Makefile b/Makefile index 0c598af97cde..1535c5bc15fe 100644 --- a/Makefile +++ b/Makefile @@ -395,7 +395,7 @@ devdoc-update: ### Protobuf ### ############################################################################### -protoVer=v0.6 +protoVer=v0.7 protoImageName=tendermintdev/sdk-proto-gen:$(protoVer) containerProtoGen=$(PROJECT_NAME)-proto-gen-$(protoVer) containerProtoGenAny=$(PROJECT_NAME)-proto-gen-any-$(protoVer) diff --git a/contrib/devtools/Dockerfile b/contrib/devtools/Dockerfile index f94cd50d8044..05bed5ac81bf 100644 --- a/contrib/devtools/Dockerfile +++ b/contrib/devtools/Dockerfile @@ -1,6 +1,6 @@ ## To test locally: # docker build --pull --rm -f "contrib/devtools/Dockerfile" -t cosmossdk-proto:latest "contrib/devtools" -# docker run -v $(pwd):/workspace --workdir /workspace cosmossdk-proto sh ./scripts/protocgen.sh +# docker run --rm -v $(pwd):/workspace --workdir /workspace cosmossdk-proto sh ./scripts/protocgen.sh FROM bufbuild/buf:1.1.0 as BUILDER @@ -17,15 +17,22 @@ ENV GOLANG_PROTOBUF_VERSION=1.28.0 \ GRPC_GATEWAY_VERSION=1.16.0 -RUN go install github.com/cosmos/cosmos-proto/cmd/protoc-gen-go-pulsar@latest && \ - go install google.golang.org/protobuf/cmd/protoc-gen-go@v${GOLANG_PROTOBUF_VERSION} && \ - go install github.com/gogo/protobuf/protoc-gen-gogo@v${GOGO_PROTOBUF_VERSION} && \ - go install github.com/gogo/protobuf/protoc-gen-gogofast@v${GOGO_PROTOBUF_VERSION} && \ - go install github.com/gogo/protobuf/protoc-gen-gogofaster@v${GOGO_PROTOBUF_VERSION} && \ - go install github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway@v${GRPC_GATEWAY_VERSION} && \ - go install github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger@v${GRPC_GATEWAY_VERSION} && \ - go install github.com/regen-network/cosmos-proto/protoc-gen-gocosmos@latest +RUN go install github.com/cosmos/cosmos-proto/cmd/protoc-gen-go-pulsar@latest +RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@v${GOLANG_PROTOBUF_VERSION} +RUN go install github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway@v${GRPC_GATEWAY_VERSION} \ + github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger@v${GRPC_GATEWAY_VERSION} +# install all gogo protobuf binaries +RUN git clone https://github.com/regen-network/protobuf.git; \ + cd protobuf; \ + go mod download; \ + make install + +# we need to use git clone because we use 'replace' directive in go.mod +# protoc-gen-gocosmos was moved to to in cosmos/gogoproto but pending a migration there. +RUN git clone https://github.com/regen-network/cosmos-proto.git; \ + cd cosmos-proto/protoc-gen-gocosmos; \ + go install . RUN npm install -g swagger-combine diff --git a/scripts/protocgen.sh b/scripts/protocgen.sh index 62048e48ceaa..234b84ae1d86 100755 --- a/scripts/protocgen.sh +++ b/scripts/protocgen.sh @@ -1,36 +1,24 @@ #!/usr/bin/env bash #== Requirements == - # - ## make sure your `go env GOPATH` is in the `$PATH` - ## Install: - ## + latest buf (v1.0.0-rc11 or later) - ## + protobuf v3 - # - ## All protoc dependencies must be installed not in the module scope - ## currently we must use grpc-gateway v1 - # cd ~ - # go install google.golang.org/protobuf/cmd/protoc-gen-go@latest - # go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest - # go install github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway@v1.16.0 - # go install github.com/cosmos/cosmos-proto/cmd/protoc-gen-go-pulsar@latest - # go get github.com/regen-network/cosmos-proto@latest # doesn't work in install mode +# +## make sure your `go env GOPATH` is in the `$PATH` +## Install: +## + latest buf (v1.0.0-rc11 or later) +## + protobuf v3 +# +## All protoc dependencies must be installed not in the module scope +## currently we must use grpc-gateway v1 +# cd ~ +# go install google.golang.org/protobuf/cmd/protoc-gen-go@latest +# go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest +# go install github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway@v1.16.0 +# go install github.com/cosmos/cosmos-proto/cmd/protoc-gen-go-pulsar@latest +# go get github.com/regen-network/cosmos-proto@latest # doesn't work in install mode +# go get github.com/regen-network/cosmos-proto/protoc-gen-gocosmos@v0.3.1 set -eo pipefail -protoc_install_gocosmos() { - echo "Installing protobuf gocosmos plugin" - # we should use go install, but regen-network/cosmos-proto contains - # replace directives. It must not contain directives that would cause - # it to be interpreted differently than if it were the main module. - # So the command below issues a warning and we are muting it for now. - # - # Installing plugins must be done outside of the module - (go get github.com/regen-network/cosmos-proto/protoc-gen-gocosmos@v0.3.1 2> /dev/null) - } - - protoc_install_gocosmos - echo "Generating gogo proto code" cd proto proto_dirs=$(find ./cosmos -path -prune -o -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq) From 6f070623741fe0d6851d79ada41e6e2b1c67e236 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 22 Apr 2022 18:42:42 +0200 Subject: [PATCH 2/2] build(deps): Bump amannn/action-semantic-pull-request (#11733) Bumps [amannn/action-semantic-pull-request](https://github.com/amannn/action-semantic-pull-request) from 4.3.0 to 4.4.0. - [Release notes](https://github.com/amannn/action-semantic-pull-request/releases) - [Changelog](https://github.com/amannn/action-semantic-pull-request/blob/master/CHANGELOG.md) - [Commits](https://github.com/amannn/action-semantic-pull-request/compare/v4.3.0...v4.4.0) --- updated-dependencies: - dependency-name: amannn/action-semantic-pull-request dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/lint-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint-pr.yml b/.github/workflows/lint-pr.yml index 333642a3a586..763a31d7cfbd 100644 --- a/.github/workflows/lint-pr.yml +++ b/.github/workflows/lint-pr.yml @@ -11,6 +11,6 @@ jobs: main: runs-on: ubuntu-latest steps: - - uses: amannn/action-semantic-pull-request@v4.3.0 + - uses: amannn/action-semantic-pull-request@v4.4.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}