From 8cd96de98594a0482f25b23a670cd0da4fc6eef1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 Jul 2024 10:37:01 +0200 Subject: [PATCH 1/4] chore: bump bufbuild/buf-setup-action from 1.31.0 to 1.35.0 (#139) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/proto-registry.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/proto-registry.yml b/.github/workflows/proto-registry.yml index bc7c4240..4b0fb3bc 100644 --- a/.github/workflows/proto-registry.yml +++ b/.github/workflows/proto-registry.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: bufbuild/buf-setup-action@v1.31.0 + - uses: bufbuild/buf-setup-action@v1.35.0 - uses: bufbuild/buf-push-action@v1 with: buf_token: ${{ secrets.BUF_TOKEN }} From dbc693018292093cb8f96cf6eb23ab1583f0d7f0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 Jul 2024 08:40:12 +0000 Subject: [PATCH 2/4] chore: bump amannn/action-semantic-pull-request from 5.5.2 to 5.5.3 (#136) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Julien Robert --- .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 80fa625a..05d5cc6e 100644 --- a/.github/workflows/lint-pr.yml +++ b/.github/workflows/lint-pr.yml @@ -17,6 +17,6 @@ jobs: statuses: write # for amannn/action-semantic-pull-request to mark status of analyzed PR runs-on: ubuntu-latest steps: - - uses: amannn/action-semantic-pull-request@v5.5.2 + - uses: amannn/action-semantic-pull-request@v5.5.3 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 0923950e3edda18a0d1c2a6e380e0262e9016be4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 7 Aug 2024 17:37:49 +0200 Subject: [PATCH 3/4] chore: bump bufbuild/buf-setup-action from 1.35.0 to 1.36.0 (#141) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/proto-registry.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/proto-registry.yml b/.github/workflows/proto-registry.yml index 4b0fb3bc..cd82b05e 100644 --- a/.github/workflows/proto-registry.yml +++ b/.github/workflows/proto-registry.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: bufbuild/buf-setup-action@v1.35.0 + - uses: bufbuild/buf-setup-action@v1.36.0 - uses: bufbuild/buf-push-action@v1 with: buf_token: ${{ secrets.BUF_TOKEN }} From 5312ce88dbb7759774f03277e8b21ab5b90f896a Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Thu, 8 Aug 2024 09:46:15 +0200 Subject: [PATCH 4/4] feat: make serviceDesc public (#142) --- .github/workflows/ci-workflow.yml | 17 +++-------------- CHANGELOG.md | 4 ++++ install-protobuf.sh | 28 ---------------------------- protoc-gen-gogo/grpc/grpc.go | 1 + 4 files changed, 8 insertions(+), 42 deletions(-) delete mode 100755 install-protobuf.sh diff --git a/.github/workflows/ci-workflow.yml b/.github/workflows/ci-workflow.yml index c9549323..8a22068f 100644 --- a/.github/workflows/ci-workflow.yml +++ b/.github/workflows/ci-workflow.yml @@ -7,11 +7,9 @@ on: jobs: build_and_test: - name: pb-${{ matrix.protobuf_version }} + name: make buildserverall runs-on: ubuntu-latest strategy: - matrix: - protobuf_version: [3.19.4] fail-fast: false steps: - name: Checkout branch @@ -21,15 +19,6 @@ jobs: uses: actions/setup-go@v5 with: go-version: 1.19 - - - name: Setup protoc - env: - PROTOBUF_VERSION: ${{ matrix.protobuf_version }} - run: ./install-protobuf.sh - - - name: Protoc version - run: PATH=$HOME/bin:$PATH protoc --version - + - uses: arduino/setup-protoc@v1 - name: Build server allgo version - - run: PATH=$HOME/bin:$PATH make buildserverall + run: make buildserverall diff --git a/CHANGELOG.md b/CHANGELOG.md index d03a18b0..eba6cd33 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +## [v1.6.0](https://github.com/cosmos/gogoproto/releases/tag/v1.6.0) - 2024-08-08 + +- [#142](https://github.com/cosmos/gogoproto/pull/142) Update code generator to make grpc `ServiceDesc` public. + ## [v1.5.0](https://github.com/cosmos/gogoproto/releases/tag/v1.5.0) - 2024-06-05 ### Improvements diff --git a/install-protobuf.sh b/install-protobuf.sh deleted file mode 100755 index 90178635..00000000 --- a/install-protobuf.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env bash - -set -ex - -die() { - echo "$@" >&2 - exit 1 -} - -cd ${HOME} - -case "$PROTOBUF_VERSION" in -2*) - basename=protobuf-$PROTOBUF_VERSION - wget https://github.com/google/protobuf/releases/download/v$PROTOBUF_VERSION/$basename.tar.gz - tar xzf $basename.tar.gz - cd protobuf-$PROTOBUF_VERSION - ./configure --prefix=${HOME} && make -j2 && make install - ;; -3*) - basename=protoc-$PROTOBUF_VERSION-linux-x86_64 - wget https://github.com/google/protobuf/releases/download/v$PROTOBUF_VERSION/$basename.zip - unzip $basename.zip - ;; -*) - die "unknown protobuf version: $PROTOBUF_VERSION" - ;; -esac diff --git a/protoc-gen-gogo/grpc/grpc.go b/protoc-gen-gogo/grpc/grpc.go index 1b5dad61..2cec8f88 100755 --- a/protoc-gen-gogo/grpc/grpc.go +++ b/protoc-gen-gogo/grpc/grpc.go @@ -243,6 +243,7 @@ func (g *grpc) generateService(file *generator.FileDescriptor, service *pb.Servi } // Service descriptor. + g.P("var ", strings.TrimPrefix(serviceDescVar, "_"), " = ", serviceDescVar) g.P("var ", serviceDescVar, " = ", grpcPkg, ".ServiceDesc {") g.P("ServiceName: ", strconv.Quote(fullServName), ",") g.P("HandlerType: (*", serverType, ")(nil),")