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
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
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
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.
Reply all
Reply to author
Forward
0 new messages