What is the best practice to share protobuf between Git repositories
64 views
Skip to first unread message
Xiao Xin
unread,
Apr 11, 2020, 12:46:24 AM4/11/20
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to grpc.io
Hi everyone, I'm currently importing proto definitions for gRPC services using git submodules but I found it quite not elegant. I always have to sync the submodules manually, and it's quite easy to lose track. I wonder how people have been dealing with the situation. Mono-repo pattern appears as another solution to the issue, but I don't think that's in favor for Git either.
zda...@google.com
unread,
Apr 15, 2020, 1:54:29 PM4/15/20
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to grpc.io
This is an open question and there might not be the best practice, but google provides a guidance for API owners to release their protobuf with semantic versioning (https://cloud.google.com/apis/design/versioning) for best effort on backward compatibility and API stability.
Chris Toomey
unread,
Apr 16, 2020, 1:04:22 AM4/16/20
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to grpc.io
Our solution is to have a dedicated repo for proto/grpc definitions, and to generate code libraries from those in the various languages needed. Then for application code (in different repos) we reference the appropriate build packages. This way there's a single source of truth for the definitions and all clients/servers are working from the same definitions. Along with that we use semantic versioning for changes to the shared definitions.