4 ms·
I see the "nanoseconds counted so they didn't use protobufs" note, but in case you do you protobufs and want to make sure this never happens to you, I heartily
by CobrastanJorji 3y ago
I see the "nanoseconds counted so they didn't use protobufs" note, but in case you do you protobufs and want to make sure this never happens to you, I heartily recommend using the "reserved" keyword in your protos whenever you remove a field. Reserving a number is a note to the proto compiler that says "I will not use this number again, and please generate an error if I foolishly later try."
It's a useful and probably under-used feature.
- scottshamus 3y agoIf anyone reading this hasn’t heard this before, I encourage you to read the do’s/dont’s of protobufs for some other good best practices. https://protobuf.dev/programming-guides/dos-donts/ https://protobuf.dev/programming-guides/dos-donts/
- GauntletWizard 3y agoThere are several protobuf linters out there, but what I haven't seen is a protobuf linter that integrates with Git to look behind and verify that you haven't accidentally changed protobuf numbers, or reused fields, or etc. Would be handy.
- orbz 3y agoI believe buf’s breaking change detection will pick up on this. It also allows you to specify a git ref to target. https://buf.build/docs/reference/cli/buf/breaking#against https://buf.build/docs/reference/cli/buf/breaking#against
- deleted 3y ago[deleted]
- sk5t 3y agoThere's a build plugin for this for Java/Maven: https://github.com/salesforce/proto-backwards-compat-maven-plugin https://github.com/salesforce/proto-backwards-compat-maven-p...