I've created 3 proto files and would like to keep it in a git repo:
separated from all others files. The repository contains only .proto
files. I have 3 microservices and each of them has their own repository that is using those proto files to communicate with each others:
You can see on the picture above, that proto files are consuming from different microservices.
Assume, I am going to change the Protofile2 and push the changes to proto
repository, remember proto files repository are separated from microservices repository:
When I run go test
on service1 or service2, it should tell me, that Protofile2 has changed or does not have the same hash like proto file in the service2 folder:
That I have to generate the code again.
Does it exist any tools to solve the problem? Or how should I solve it?
Here's what I suggest:
import "github.com/me/myproto/protodef2"
go v1.11
in 2019) to ensure micro-service X gets a compatible version of protobuf YTo point 2 - and as @PaulHankin mentioned - try not to break backward compatibility. Protobuf fields can be removed, but as long as the remaining field indices are unaltered, old client calls will still be compatible with newer proto defs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With