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

chore: improve grpc tooling and upgrade setup-go to v3 #2553

Merged
merged 20 commits into from
Oct 18, 2022

Conversation

lvrach
Copy link
Member

@lvrach lvrach commented Oct 11, 2022

Description

This PR is addressing the following issues:

  • It was not straight-forward how to generate grpc & proto files. I have added the command in Makefile
  • Some proto files were generated with different versions using github.com/golang/protobuf/proto, which is suppressed by google.golang.org/protobuf. I've updated all of them.
  • No CI process was validating that proto files were indeed generated. I have added a verification step in github-action.

While adding the verification step, I noticed that GOPATH/bin was not added to PATH. Something that setup-go v3 is solving:

setup-go v3 also takes care of caching. Thus I've removed actions/cache@v2 step and used setup-go v3 in all methods.

Notion Ticket

https://www.notion.so/rudderstacks/proto-CI-improvements-24f0127f8e614aabab45cd17c14bbf5d

Security

  • The code changed/added as part of this pull request won't create any security issues with how the software is being used.

@@ -60,10 +60,9 @@ help: ## Show the available commands


install-tools:
go install github.com/golang/mock/mockgen@v1.6.0 || \
GO111MODULE=on go install github.com/golang/mock/mockgen@v1.6.0
Copy link
Member Author

Choose a reason for hiding this comment

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

Backwards compatibility is no longer needed.

@codecov
Copy link

codecov bot commented Oct 11, 2022

Codecov Report

Base: 43.91% // Head: 43.98% // Increases project coverage by +0.06% 🎉

Coverage data is based on head (7323301) compared to base (26b218c).
Patch has no changes to coverable lines.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2553      +/-   ##
==========================================
+ Coverage   43.91%   43.98%   +0.06%     
==========================================
  Files         187      187              
  Lines       39082    39082              
==========================================
+ Hits        17163    17190      +27     
+ Misses      20838    20811      -27     
  Partials     1081     1081              
Impacted Files Coverage Δ
services/stats/stats.go 88.48% <0.00%> (-1.82%) ⬇️
processor/processor.go 72.05% <0.00%> (+0.82%) ⬆️
enterprise/reporting/reporting.go 9.77% <0.00%> (+1.43%) ⬆️
enterprise/suppress-user/suppressUser.go 82.71% <0.00%> (+1.85%) ⬆️
config/backend-config/namespace_config.go 73.95% <0.00%> (+3.12%) ⬆️
enterprise/reporting/setup.go 52.38% <0.00%> (+14.28%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@lvrach lvrach changed the title Chore.proto grpc refresh chore: improve proto and grpc tooling Oct 11, 2022
@lvrach lvrach force-pushed the chore.proto-grpc-refresh branch from f5fc531 to be85f9b Compare October 11, 2022 20:21
@lvrach lvrach changed the title chore: improve proto and grpc tooling chore: improve grpc tooling and upgrade setup-go to v3 Oct 12, 2022
with:
version: '3.x'
- run: make proto
- run: git diff -I '^\/\/\s+-?\s+protoc\s+v' --exit-code ## Ignore protoc version comment
Copy link
Member Author

Choose a reason for hiding this comment

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

here is a caveat, it is hard to enforce protoc version is the same in all environments.

I could install the latest proto version in github actions and ubuntu is using a match older version by default.

What I noticed however is that the only difference is only the comment with the version. Thus, there is no real impact on the output if we compile from different protoc versions and if there is we can detect on our CI.

Another option is to use a docker image to generate the protoc files as @fracasula had done in the past.

Copy link
Collaborator

Choose a reason for hiding this comment

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

On CI I don't mind, either way it's fine so whatever it works for you 👍

I like the Docker approach mostly for the Makefile for recipes that we are meant to run locally. Mostly for cases like with protoc where a go install isn't enough. I use OpenSuse for example and I have to install protobuf-devel in order to be able to generate the files. The problem arises if somehow you want to install a different version of protoc.

@lvrach lvrach marked this pull request as ready for review October 12, 2022 15:45
@lvrach lvrach requested a review from a team October 14, 2022 13:19
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.

4 participants