Skip to content
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

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

aranjans
Copy link
Contributor

@aranjans aranjans commented Mar 25, 2024

Fixes #6583

RELEASE NOTES: n/a

Copy link

codecov bot commented Mar 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.70%. Comparing base (adf976b) to head (b3106cc).
Report is 84 commits behind head on master.

Current head b3106cc differs from pull request most recent head 77ac334

Please upload reports for the commit 77ac334 to get more accurate results.

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     

see 33 files with indirect coverage changes

@aranjans aranjans force-pushed the aranjans_6583 branch 2 times, most recently from 8bb8747 to af6bc49 Compare March 25, 2024 17:33
@dfawley dfawley added the Type: Meta Github repo, process, etc label Mar 25, 2024
@dfawley dfawley added this to the 1.64 Release milestone Mar 25, 2024
@dfawley dfawley requested a review from arvindbr8 March 25, 2024 17:37
@aranjans aranjans marked this pull request as ready for review March 25, 2024 17:37
@aranjans aranjans force-pushed the aranjans_6583 branch 2 times, most recently from e404049 to a582a54 Compare March 26, 2024 06:59
Copy link
Member

@arvindbr8 arvindbr8 left a 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

vet.sh Outdated Show resolved Hide resolved
regenerate.sh Show resolved Hide resolved
regenerate.sh Outdated Show resolved Hide resolved
@aranjans aranjans force-pushed the aranjans_6583 branch 12 times, most recently from 20c21cb to a880e4d Compare March 27, 2024 10:00
@dfawley dfawley assigned arvindbr8 and unassigned aranjans Mar 27, 2024
Copy link
Member

@arvindbr8 arvindbr8 left a 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?

protoc_installer.sh Outdated Show resolved Hide resolved
protoc_installer.sh Outdated Show resolved Hide resolved
protoc_installer.sh Outdated Show resolved Hide resolved
protoc_installer.sh Outdated Show resolved Hide resolved
protoc_installer.sh Outdated Show resolved Hide resolved
regenerate.sh Outdated Show resolved Hide resolved
regenerate.sh Outdated Show resolved Hide resolved
regenerate.sh Outdated Show resolved Hide resolved
regenerate.sh Outdated Show resolved Hide resolved
protoc_installer.sh Outdated Show resolved Hide resolved
@arvindbr8 arvindbr8 assigned aranjans and unassigned arvindbr8 Mar 29, 2024
@aranjans aranjans force-pushed the aranjans_6583 branch 2 times, most recently from 2cddfeb to cc78601 Compare April 1, 2024 06:40
@aranjans
Copy link
Contributor Author

aranjans commented May 9, 2024

@arvindbr8 In contrast to this comment, first comment is resolved but i didn't understand the second one. Can you be more specific on that?

@aranjans aranjans assigned arvindbr8 and unassigned aranjans May 9, 2024
@arvindbr8 arvindbr8 removed the stale label May 9, 2024
@arvindbr8
Copy link
Member

there is a TODO in the file which marks this PR. As part of nixing the TODO comment, i think this does not be applicable

die "-install currently intended for use in CI only."

Copy link

This PR is labeled as requiring an update from the reporter, and no update has been received after 6 days. If no update is provided in the next 7 days, this issue will be automatically closed.

scripts/install_protoc.sh Outdated Show resolved Hide resolved
PROTOC_VERSION="25.2"

# Function to download pre-built binaries for Linux with
# ARCH as $1, OS as $2, and WORKDIR as $3 arguments.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/WORKDIR/Install path? WORKDIR did not makes sense to me.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to clarify, can we substituteWORKDIR as $3 with Install Path as $3?

scripts/install_protoc.sh Show resolved Hide resolved
scripts/install_protoc.sh Outdated Show resolved Hide resolved
scripts/install_protoc.sh Show resolved Hide resolved
scripts/regenerate.sh Outdated Show resolved Hide resolved
scripts/regenerate.sh Outdated Show resolved Hide resolved
scripts/regenerate.sh Outdated Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, I see this done as part of this commit 64983a1 (#7064)

scripts/vet-proto.sh Outdated Show resolved Hide resolved
@arvindbr8
Copy link
Member

arvindbr8 commented May 28, 2024

Also this still seems to be not resolved? #7064 (comment)

@arvindbr8
Copy link
Member

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.

@aranjans aranjans force-pushed the aranjans_6583 branch 2 times, most recently from 2baac2d to 32610ba Compare May 30, 2024 07:45
Copy link
Member

@arvindbr8 arvindbr8 left a 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.

Comment on lines +33 to +34
echo "Existing protoc version ($installed_version) differs. Kindly make sure you have $PROTOC_VERSION installed."
exit 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
echo "Existing protoc version ($installed_version) differs. Kindly make sure you have $PROTOC_VERSION installed."
exit 1
die "Existing protoc version ($installed_version) differs. Kindly make sure you have $PROTOC_VERSION installed."

if installed_version=$(protoc --version | cut -d' ' -f2 2>/dev/null); then
if [ "$installed_version" = "$PROTOC_VERSION" ]; then
echo "protoc version $PROTOC_VERSION is already installed."
return
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return or exit 0? I'm not sure. How does source react to these different exit?

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."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

broken link?

Copy link
Member

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

Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve regenerate.sh to use the correct proto compiler version
4 participants