nilslice / protolock

Protocol Buffer companion tool. Track your .proto files and prevent changes to messages and services which impact API compatibility.
https://protolock.dev
BSD 3-Clause "New" or "Revised" License
604 stars 37 forks source link

Add support for checking whether an existing field has moved into or out of a oneof #151

Closed pdecks closed 11 months ago

pdecks commented 11 months ago

Resolves https://github.com/nilslice/protolock/issues/133 by adding a OneofParent field to a Field type.

Adds a rule checking whether a field has been moved into or out of a oneof, which is a backwards-incompatible change for Go protobuf stubs per https://google.aip.dev/180#moving-into-oneofs.

In addition to the passing unit tests, I've also tested this locally via our custom tooling & protolock plugins and verified it behaves as expected.