diff --git a/.github/workflows/proto.yml b/.github/workflows/proto.yml index 02fd18e72d27b..f4c7d73ee3952 100644 --- a/.github/workflows/proto.yml +++ b/.github/workflows/proto.yml @@ -20,4 +20,5 @@ jobs: - run: apt update && apt install -y unzip - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - run: git config --global --add safe.directory "$PWD" # actions/runner#2033 - - run: bin/protoc-diff + - run: bin/protoc-go.sh + - run: git diff --exit-code diff --git a/bin/protoc b/bin/protoc deleted file mode 100755 index cb2cd03be92da..0000000000000 --- a/bin/protoc +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env sh - -set -eu - -if [ "$(uname -s)" = Darwin ]; then - os=osx -else - os=linux -fi -arch=$(uname -m) - -bindir=$( cd "${0%/*}" && pwd ) -targetbin=$( cd "$bindir"/.. && pwd )/target/bin -protocversion=3.20.0 -protocbin=$targetbin/protoc-$protocversion -protocurl=https://github.com/google/protobuf/releases/download/v$protocversion/protoc-$protocversion-$os-$arch.zip - -require_from() { - if ! command -v "$1" >/dev/null 2>/dev/null ; then - echo "Please acquire $1 from $2" >&2 - return 1 - fi -} - -if [ ! -f "$protocbin" ]; then - require_from curl 'https://curl.se/download.html' - require_from unzip 'http://infozip.sourceforge.net/UnZip.html#Downloads' - tmp=$(mktemp -d -t protoc.XXX) - mkdir -p "$targetbin" - ( - cd "$tmp" - "$bindir"/scurl -o "./protoc.zip" "$protocurl" - unzip -q "./protoc.zip" bin/protoc - chmod +x bin/protoc - ) - mv "$tmp/bin/protoc" "$protocbin" - rm -rf "$tmp" -fi - -"$protocbin" "$@" diff --git a/bin/protoc-diff b/bin/protoc-diff deleted file mode 100755 index c7f2327180166..0000000000000 --- a/bin/protoc-diff +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env sh - -set -eu - -bindir=$( cd "${0%/*}" && pwd ) -"$bindir"/protoc-go.sh - -dir_dirty=$(git diff HEAD -- **/gen/**) -if [ -z "$dir_dirty" ]; then - echo 'Protobuf definitions match generated code' - exit 0 -else - echo 'Protobuf definitions diverge from generated code:' - git status - exit 64 -fi diff --git a/bin/protoc-go.sh b/bin/protoc-go.sh index 0bfac376bdae7..598b3b61d33e2 100755 --- a/bin/protoc-go.sh +++ b/bin/protoc-go.sh @@ -2,21 +2,14 @@ set -eu -bindir=$( cd "${0%/*}" && pwd ) - -if ! command -v protoc-gen-go-grpc >/dev/null ; then - go install -mod=readonly google.golang.org/protobuf/cmd/protoc-gen-go@v1.28 - go install -mod=readonly google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2 -fi - rm -rf controller/gen/common controller/gen/config viz/metrics-api/gen viz/tap/gen mkdir -p controller/gen/common/net viz/metrics-api/gen/viz viz/tap/gen/tap -"$bindir"/protoc -I proto --go_out=paths=source_relative:controller/gen proto/common/net.proto -"$bindir"/protoc -I proto -I viz/metrics-api/proto --go_out=paths=source_relative:viz/metrics-api/gen viz/metrics-api/proto/viz.proto -"$bindir"/protoc -I proto -I viz/metrics-api/proto --go-grpc_out=paths=source_relative:viz/metrics-api/gen/viz viz/metrics-api/proto/viz.proto -"$bindir"/protoc -I proto -I viz/tap/proto -I viz/metrics-api/proto --go_out=paths=source_relative:viz/tap/gen viz/tap/proto/viz_tap.proto -"$bindir"/protoc -I proto -I viz/tap/proto -I viz/metrics-api/proto --go-grpc_out=paths=source_relative:viz/tap/gen/tap viz/tap/proto/viz_tap.proto +protoc -I proto --go_out=paths=source_relative:controller/gen proto/common/net.proto +protoc -I proto -I viz/metrics-api/proto --go_out=paths=source_relative:viz/metrics-api/gen viz/metrics-api/proto/viz.proto +protoc -I proto -I viz/metrics-api/proto --go-grpc_out=paths=source_relative:viz/metrics-api/gen/viz viz/metrics-api/proto/viz.proto +protoc -I proto -I viz/tap/proto -I viz/metrics-api/proto --go_out=paths=source_relative:viz/tap/gen viz/tap/proto/viz_tap.proto +protoc -I proto -I viz/tap/proto -I viz/metrics-api/proto --go-grpc_out=paths=source_relative:viz/tap/gen/tap viz/tap/proto/viz_tap.proto mv controller/gen/common/net.pb.go controller/gen/common/net/ mv viz/metrics-api/gen/viz.pb.go viz/metrics-api/gen/viz/viz.pb.go diff --git a/controller/gen/common/net/net.pb.go b/controller/gen/common/net/net.pb.go index 8a059897cfb28..c975540f4abe3 100644 --- a/controller/gen/common/net/net.pb.go +++ b/controller/gen/common/net/net.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.35.2 -// protoc v3.20.0 +// protoc v5.29.0 // source: common/net.proto package net diff --git a/viz/metrics-api/gen/viz/viz.pb.go b/viz/metrics-api/gen/viz/viz.pb.go index 8a76d12f92f61..e0a72468d59e2 100644 --- a/viz/metrics-api/gen/viz/viz.pb.go +++ b/viz/metrics-api/gen/viz/viz.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.35.2 -// protoc v3.20.0 +// protoc v5.29.0 // source: viz.proto package viz diff --git a/viz/metrics-api/gen/viz/viz_grpc.pb.go b/viz/metrics-api/gen/viz/viz_grpc.pb.go index 7acade30226cf..5c6b0db30734a 100644 --- a/viz/metrics-api/gen/viz/viz_grpc.pb.go +++ b/viz/metrics-api/gen/viz/viz_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.5.1 -// - protoc v3.20.0 +// - protoc v5.29.0 // source: viz.proto package viz diff --git a/viz/tap/gen/tap/viz_tap.pb.go b/viz/tap/gen/tap/viz_tap.pb.go index 9ff3a810854d9..4cc50207b7595 100644 --- a/viz/tap/gen/tap/viz_tap.pb.go +++ b/viz/tap/gen/tap/viz_tap.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.35.2 -// protoc v3.20.0 +// protoc v5.29.0 // source: viz_tap.proto package tap diff --git a/viz/tap/gen/tap/viz_tap_grpc.pb.go b/viz/tap/gen/tap/viz_tap_grpc.pb.go index 8541c67fb7a7a..6ccc6313e457d 100644 --- a/viz/tap/gen/tap/viz_tap_grpc.pb.go +++ b/viz/tap/gen/tap/viz_tap_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.5.1 -// - protoc v3.20.0 +// - protoc v5.29.0 // source: viz_tap.proto package tap