-
Notifications
You must be signed in to change notification settings - Fork 401
Add "checkgenerate" make target to CI #239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add "checkgenerate" make target to CI #239
Conversation
@go install google.golang.org/protobuf/cmd/protoc-gen-go@a709e31e5d12 | ||
@go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.1.0 | ||
@go install github.com/jhump/protoreflect/desc/sourceinfo/cmd/protoc-gen-gosrcinfo | ||
@go install github.com/jhump/protoreflect/desc/sourceinfo/cmd/protoc-gen-gosrcinfo@v1.14.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line wouldn't run without this explicit version. The v1.14.1
tag for this repo is already in go.mod
, however there are some transitive deps of this package that are not otherwise used by this repo, so they had no entries in go.sum
. This gets it working again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Explicit deps FTW
download_protoc.sh
Outdated
rm -rf ./.tmp/protoc | ||
mkdir -p .tmp/protoc | ||
curl -L "https://github.com/google/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-${PROTOC_OS}-${PROTOC_ARCH}.zip" > .tmp/protoc/protoc.zip | ||
cd ./.tmp/protoc && unzip protoc.zip && cd .. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cd ./.tmp/protoc && unzip protoc.zip && cd .. | |
cd ./.tmp/protoc && unzip protoc.zip && cd ../.. |
pushd/popd not generally available? just curious
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
download_protoc.sh
Outdated
|
||
cd $(dirname $0) | ||
|
||
PROTOC_VERSION="22.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we pass this value in from the Makefile for clarity?
What version were we using before? I noticed the outputs are changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with a couple nits
@@ -89,7 +90,6 @@ errcheck: | |||
test: | |||
go test -race ./... | |||
|
|||
.tmp/protoc/bin/protoc: | |||
.tmp/protoc/bin/protoc: ./Makefile ./download_protoc.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the deps here, so that the compiler is auto-redownloaded if we change the version (which is in the Makefile) or the download script.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 nice
I was curious about the previously merged PR (#238), noticing that it only updated the JS code and not any Go code where the webform was embedded.
I now see that
go:embed
is used, which is why no explicit Go code had to be changed. Nice!But while playing with it, I realized that
make generate
wasn't being checked in CI, to make sure that all code was up to date from code generators. So this adds such a check to CI.