diff options
author | Pavlo Strokov <pstrokov@gitlab.com> | 2020-09-14 19:13:24 +0300 |
---|---|---|
committer | Paul Okstad <pokstad@gitlab.com> | 2020-09-14 19:13:24 +0300 |
commit | 41217b88b8bce0dcac171d8f1d5e9af0270a06f2 (patch) | |
tree | 6e1e418b068b0cd0407e478d0dcc9ba43a40f6df /Makefile | |
parent | 159b5e841865c09a50483501535c3225da24c1a4 (diff) |
Protobuf generates different code locally and on CI
As it is hard to reason about what is the difference between
local run and run on CI in the Docker container the first
step to identify what is the actual difference between two.
If it is only a formatting then it is possible that locally
generated version was formatted and committed.
To see the difference a new artifact 'proto.diff' would be
available after failed execution of the 'no-changes' task.
It will show delta between locally generated and committed
files vs files generated on CI during verification.
Part of: https://gitlab.com/gitlab-org/gitaly/-/issues/2855
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -280,7 +280,7 @@ clean-ruby-vendor-go: mkdir -p ${SOURCE_DIR}/ruby/vendor && find ${SOURCE_DIR}/ruby/vendor -type f -name '*.go' -delete .PHONY: check-proto -check-proto: proto no-changes +check-proto: proto no-proto-changes .PHONY: rubocop rubocop: ${SOURCE_DIR}/.ruby-bundle @@ -330,6 +330,11 @@ proto-lint: ${PROTOC} ${PROTOC_GEN_GO} no-changes: ${Q}${GIT} status --porcelain | awk '{ print } END { if (NR > 0) { exit 1 } }' +.PHONY: no-proto-changes +no-proto-changes: + ${Q}${GIT} diff -- '*.pb.go' 'ruby/proto/gitaly' >proto.diff + ${Q}if [ -s proto.diff ]; then echo "There is a difference in generated proto files. Please take a look at proto.diff file." && exit 1; fi + .PHONY: smoke-test smoke-test: all rspec ${Q}go test -tags "${GO_BUILD_TAGS}" ./internal/gitaly/rubyserver |