Browse Source

fix: proto-breakage (#4506)

* fix: fix proto-breakage

- this is amed to fix proto breakage for consumers

Signed-off-by: Marko Baricevic <marbar3778@yahoo.com>

* fix for importing third_party everywhere

* undo change

* test breakage change

* test ssh

* test https

* change ssh to https

* fix phony
pull/4533/head
mergify[bot] 5 years ago
committed by GitHub
parent
commit
4c8e3c8145
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 15 additions and 29 deletions
  1. +1
    -4
      .circleci/config.yml
  2. +6
    -1
      Makefile
  3. +1
    -1
      abci/types/types.pb.go
  4. +0
    -1
      buf.yaml
  5. +2
    -2
      libs/kv/types.pb.go
  6. +1
    -1
      scripts/protocgen.sh
  7. +4
    -19
      tools.mk

+ 1
- 4
.circleci/config.yml View File

@ -87,7 +87,7 @@ jobs:
steps: steps:
- checkout - checkout
- run: - run:
command: make proto-check-breaking
command: make proto-check-breaking-ci
test_abci_apps: test_abci_apps:
executor: golang executor: golang
@ -378,13 +378,10 @@ jobs:
# command: | # command: |
# set -x # set -x
# export PATH=~/.local/bin:$PATH # export PATH=~/.local/bin:$PATH
# # install node and dredd # # install node and dredd
# ./scripts/get_nodejs.sh # ./scripts/get_nodejs.sh
# # build the binaries with a proper version of Go # # build the binaries with a proper version of Go
# docker run --rm -v "$PWD":/go/src/github.com/tendermint/tendermint -w /go/src/github.com/tendermint/tendermint golang make build-linux build-contract-tests-hooks # docker run --rm -v "$PWD":/go/src/github.com/tendermint/tendermint -w /go/src/github.com/tendermint/tendermint golang make build-linux build-contract-tests-hooks
# # This docker image works with go 1.7, we can install here the hook handler that contract-tests is going to use # # This docker image works with go 1.7, we can install here the hook handler that contract-tests is going to use
# go get github.com/snikch/goodman/cmd/goodman # go get github.com/snikch/goodman/cmd/goodman
# make contract-tests # make contract-tests


+ 6
- 1
Makefile View File

@ -4,6 +4,7 @@ OUTPUT?=build/tendermint
BUILD_TAGS?='tendermint' BUILD_TAGS?='tendermint'
LD_FLAGS = -X github.com/tendermint/tendermint/version.GitCommit=`git rev-parse --short=8 HEAD` -s -w LD_FLAGS = -X github.com/tendermint/tendermint/version.GitCommit=`git rev-parse --short=8 HEAD` -s -w
BUILD_FLAGS = -mod=readonly -ldflags "$(LD_FLAGS)" BUILD_FLAGS = -mod=readonly -ldflags "$(LD_FLAGS)"
HTTPS_GIT := https://github.com/tendermint/tendermint.git
all: check build test install all: check build test install
.PHONY: all .PHONY: all
@ -57,9 +58,13 @@ proto-lint:
.PHONY: proto-lint .PHONY: proto-lint
proto-check-breaking: proto-check-breaking:
@buf check breaking --against-input '.git#branch=master'
@buf check breaking --against-input ".git#branch=master"
.PHONY: proto-check-breaking .PHONY: proto-check-breaking
proto-check-breaking-ci:
@buf check breaking --against-input "$(HTTPS_GIT)#branch=master"
.PHONY: proto-check-breaking-ci
############################################################################### ###############################################################################
### Build ABCI ### ### Build ABCI ###
############################################################################### ###############################################################################


+ 1
- 1
abci/types/types.pb.go View File

@ -2571,7 +2571,7 @@ func (m *PartSetHeader) GetHash() []byte {
// Validator // Validator
type Validator struct { type Validator struct {
Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
//PubKey pub_key = 2 [(gogoproto.nullable)=false];
// PubKey pub_key = 2 [(gogoproto.nullable)=false];
Power int64 `protobuf:"varint,3,opt,name=power,proto3" json:"power,omitempty"` Power int64 `protobuf:"varint,3,opt,name=power,proto3" json:"power,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"` XXX_unrecognized []byte `json:"-"`


+ 0
- 1
buf.yaml View File

@ -13,4 +13,3 @@ lint:
breaking: breaking:
use: use:
- FILE - FILE
- PACKAGE

+ 2
- 2
libs/kv/types.pb.go View File

@ -26,7 +26,7 @@ var _ = math.Inf
// proto package needs to be updated. // proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
// Define these here for compatibility but use tmlibs/common.KVPair.
// Define these here for compatibility but use tmlibs/kv.Pair.
type Pair struct { type Pair struct {
Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
@ -82,7 +82,7 @@ func (m *Pair) GetValue() []byte {
return nil return nil
} }
// Define these here for compatibility but use tmlibs/common.KI64Pair.
// Define these here for compatibility but use tmlibs/kv.KI64Pair.
type KI64Pair struct { type KI64Pair struct {
Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
Value int64 `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"` Value int64 `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"`


+ 1
- 1
scripts/protocgen.sh View File

@ -8,4 +8,4 @@ for dir in $proto_dirs; do
-I. \ -I. \
--gogo_out=Mgoogle/protobuf/timestamp.proto=github.com/golang/protobuf/ptypes/timestamp,Mgoogle/protobuf/duration.proto=github.com/golang/protobuf/ptypes/duration,plugins=grpc,paths=source_relative:. \ --gogo_out=Mgoogle/protobuf/timestamp.proto=github.com/golang/protobuf/ptypes/timestamp,Mgoogle/protobuf/duration.proto=github.com/golang/protobuf/ptypes/duration,plugins=grpc,paths=source_relative:. \
$(find "${dir}" -name '*.proto') $(find "${dir}" -name '*.proto')
done
done

+ 4
- 19
tools.mk View File

@ -77,29 +77,14 @@ $(PROTOBUF):
@go get github.com/gogo/protobuf/protoc-gen-gogo@v1.3.1 @go get github.com/gogo/protobuf/protoc-gen-gogo@v1.3.1
.PHONY: protobuf .PHONY: protobuf
buf: protoc-gen-buf-check-breaking protoc-gen-buf-check-lint
buf:
@echo "Installing buf..." @echo "Installing buf..."
@curl -sSL \ @curl -sSL \
"https://github.com/bufbuild/buf/releases/download/v${BUF_VERSION}/buf-${UNAME_S}-${UNAME_M}" \
-o "${BIN}/buf" && \
chmod +x "${BIN}/buf"
"https://github.com/bufbuild/buf/releases/download/v$(BUF_VERSION)/buf-$(UNAME_S)-$(UNAME_M)" \
-o "$(BIN)/buf" && \
chmod +x "$(BIN)/buf"
.PHONY: buf .PHONY: buf
protoc-gen-buf-check-breaking:
@echo "Installing protoc-gen-buf-check-breaking..."
@curl -sSL \
"https://github.com/bufbuild/buf/releases/download/v${BUF_VERSION}/protoc-gen-buf-check-breaking-${UNAME_S}-${UNAME_M}" \
-o "${BIN}/protoc-gen-buf-check-breaking" && \
chmod +x "${BIN}/protoc-gen-buf-check-breaking"
protoc-gen-buf-check-lint:
@echo "Installing protoc-gen-buf-check-lint..."
@curl -sSL \
"https://github.com/bufbuild/buf/releases/download/v${BUF_VERSION}/protoc-gen-buf-check-lint-${UNAME_S}-${UNAME_M}" \
-o "${BIN}/protoc-gen-buf-check-lint" && \
chmod +x "${BIN}/protoc-gen-buf-check-lint"
.PHONY: protoc-gen-buf-check-lint
goodman: $(GOODMAN) goodman: $(GOODMAN)
$(GOODMAN): $(GOODMAN):
@echo "Get Goodman" @echo "Get Goodman"


Loading…
Cancel
Save