dependencies: migrate from gogo/protobuf to google.golang.org/protobuf#165
dependencies: migrate from gogo/protobuf to google.golang.org/protobuf#165liran-funaro wants to merge 1 commit into
Conversation
|
|
217cce3 to
d1eb4c3
Compare
github.com/gogo/protobuf, along with the related github.com/gogo/status and github.com/gogo/googleapis, is deprecated and unmaintained. This migrates the whole module to the standard, maintained protobuf stack it already depended on: google.golang.org/protobuf (+ anypb), google.golang.org/grpc/status, and google.golang.org/genproto/googleapis/rpc/status. The .proto files are regenerated with the standard protoc-gen-go and protoc-gen-go-grpc, dropping the custom protoc-gen-gogoroach plugin and all gogoproto options, and the hand-written code is adapted to the v2 runtime: - errbase packs and unpacks error detail payloads with anypb.New and (*anypb.Any).UnmarshalNew, resolving types through the standard protoregistry instead of gogo's registry. - The previously non-nullable embedded fields (Details, Cause, ErrorTypeMark) are now pointers, read through the generated nil-safe getters. DecodeError takes *EncodedError and GetTypeMark returns *errorspb.ErrorTypeMark accordingly. - extgrpc and grpc/middleware use google.golang.org/grpc/status. Because the standard Any can hold standard protobufs directly, the former gogo/standard status split collapses into a single path, and google.rpc.Status now comes from genproto with the same type URL. - go.mod drops all three gogo modules. Wire compatibility is preserved: no proto package/message name or field number changes, and google.protobuf.Any type URLs are unchanged, so errors serialized by the previous gogo-based version still decode here and vice versa. This is a breaking API change (major version): the encoder/decoder registration interfaces now reference the v2 proto.Message, so consumers that register custom error types must supply standard-protobuf payloads. Errors originally produced as github.com/gogo/status types decode to an opaque error (message and safe details preserved) rather than being reconstructed as a gRPC status. Signed-off-by: Liran Funaro <liran.funaro@gmail.com>
d1eb4c3 to
59349cb
Compare
Migrating off gogo protobuf (cockroachdb/errors)This release replaces the deprecated gogo protobuf stack Are you affected?Not affected (most users): code that only uses Affected: code that does any of:
What changed (API points)
Behavioral changeAn error originally produced as a Migration steps
For a typical single custom error type this is usually: regenerate one |
github.com/gogo/protobuf, along with the related github.com/gogo/status and github.com/gogo/googleapis, is deprecated and unmaintained. This migrates the whole module to the standard, maintained protobuf stack it already depended on: google.golang.org/protobuf (+ anypb), google.golang.org/grpc/status, and
google.golang.org/genproto/googleapis/rpc/status.
The .proto files are regenerated with the standard protoc-gen-go and protoc-gen-go-grpc, dropping the custom protoc-gen-gogoroach plugin and all gogoproto options, and the hand-written code is adapted to the v2 runtime:
Wire compatibility is preserved: no proto package/message name or field number changes, and google.protobuf.Any type URLs are unchanged, so errors serialized by the previous gogo-based version still decode here and vice versa.
This is a breaking API change (major version): the encoder/decoder registration interfaces now reference the v2 proto.Message, so consumers that register custom error types must supply standard-protobuf payloads. Errors originally produced as github.com/gogo/status types decode to an opaque error (message and safe details preserved) rather than being reconstructed as a gRPC status.