-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
scripts: improve regenerate.sh to use the correct proto compiler version #7064
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #7064 +/- ##
==========================================
- Coverage 81.24% 80.70% -0.54%
==========================================
Files 345 346 +1
Lines 33941 33802 -139
==========================================
- Hits 27574 27280 -294
- Misses 5202 5355 +153
- Partials 1165 1167 +2 |
8bb8747
to
af6bc49
Compare
e404049
to
a582a54
Compare
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 would prefer if we didnt track the version of protoc in different places.
What might be nicer is if both regenerate.sh
and vet.sh
points to the same place to install protoc. Also note ./vet.sh -install
basically does the same thing of installing protoc
for Github Actions.
I prefer creating a new script which installs protoc based on the ${OS}
. And for ./vet -install
I could call into the script to install the linux
and x86_64
flavor of protoc. And do something similar for regenerate.sh
20c21cb
to
a880e4d
Compare
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've made a few comments on your change. Could you please take a look at it?
2cddfeb
to
cc78601
Compare
Also this still seems to be not resolved? #7064 (comment) |
i would prefer if the reporter of a comment to close the conversation as resolved. The Github UI hides the conversation, and we would need to click on each to see if/what the response is. |
2baac2d
to
32610ba
Compare
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.
Great! Looks better now. LGTM modulo the comments from this pass.
scripts/vet-proto.sh
Outdated
if [[ "${GITHUB_ACTIONS}" = "true" ]]; then | ||
source ./scripts/install_protoc.sh "/home/runner/go" | ||
else | ||
die "run protoc installer https://github.com/grpc/grpc-go/scripts/install_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.
broken link?
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.
also shouldn't we mention how to run the installer from the terminal?
We should also put something in the top level package comment in scripts/install_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.
also i'm not convinced that only Github Actions should be able to run ./scripts/vet-proto.sh
with -install
. I would expect that if a user runs this, then we install protoc for them
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.
https://github.com/grpc/grpc-go/scripts/install_protoc.sh.
install_protoc.sh script is a new file so this link will be accessed only when it is merged.
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 is how links to files in our repo @ master would look like https://github.com/grpc/grpc-go/blob/master/admin/admin.go
Also about this; why not just something like:
source ./scripts/install_protoc.sh
5313711
to
6f7efac
Compare
scripts/vet-proto.sh
Outdated
if [[ "${GITHUB_ACTIONS}" = "true" ]]; then | ||
source ./scripts/install_protoc.sh "/home/runner/go" | ||
else | ||
die "run protoc installer https://github.com/grpc/grpc-go/scripts/install_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.
This is how links to files in our repo @ master would look like https://github.com/grpc/grpc-go/blob/master/admin/admin.go
Also about this; why not just something like:
source ./scripts/install_protoc.sh
if [[ "${GITHUB_ACTIONS}" = "true" ]]; then | ||
source ./scripts/install_protoc.sh "/home/runner/go" | ||
else | ||
die "run protoc installer https://github.com/grpc/grpc-go/blob/master/scripts/install_protoc.sh" | ||
fi |
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.
nit: This still looks like a link to what to do. But just points to a script without the how to. Have you looked at my other comment that talked about why it might be nice to run install_protoc.sh also in this case?
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.
added few lines on how to use install_protoc.sh
in case of manual run.
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, modulo two nits
scripts/regenerate.sh
Outdated
@@ -19,12 +19,16 @@ WORKDIR=$(mktemp -d) | |||
|
|||
function finish { | |||
rm -rf "$WORKDIR" | |||
# Revert back the PATH to client's original value | |||
export PATH=$ORIGINAL_PATH | |||
echo "Restored PATH variable to original value." |
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.
nit: remove this echo as well. The user doesnt have to know that the state changed and was reverted.
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.
Updated
Fixes #6583
This PR includes the following changes:
install_protoc.sh
script(responsible for installing protobuf on client side in case its not present) which is called byvet.sh and regenerate.sh
.RELEASE NOTES: n/a