Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

all: upcoming unmitigated breaking change in generated .pb.go files #11020

Open
quartzmo opened this issue Oct 23, 2024 · 0 comments
Open

all: upcoming unmitigated breaking change in generated .pb.go files #11020

quartzmo opened this issue Oct 23, 2024 · 0 comments
Labels
type: cleanup An internal cleanup or hygiene concern.

Comments

@quartzmo
Copy link
Member

Client

All GAPIC clients.

Environment

All environments

Impact

Generated service registration function signatures will change from concrete types to an interfaces. Note that there will be no impact on most usages because the previous concrete type and generated service code both already implemented the interface.

However, customers that reference the modified code in one or more of the following four ways will be broken by an unmitigated change:

  1. Creating a variable with the generated function signature as the type for use in code, like so:
// Where *grpc.Server is being changed to grpc.ServiceRegistrar
var myRegisterFunc func(*grpc.Server, FooServer)

// call site that would break with change to RegisterFooServer
myRegisterFunc = foopb.RegisterFooServer
  1. Passing the function as a parameter typed as the function signature, like so:
// Where *grpc.Server is being changed to grpc.ServiceRegistrar
func myFunc(registerFunc func(*grpc.Server, FooServer)) { ... }

// call site that would break with change to RegisterFooServer
myFunc(foopb.RegisterFooServer)
  1. Making the function signature the type of a struct property, like so:
type MyFoo struct {
  // Where *grpc.Server is being changed to grpc.ServiceRegistrar

  RegisterFoo func(*grpc.Server, FooServer)
}

// call site that would break with change to RegisterFooServer
myFoo := MyFoo{
  RegisterFoo: foopb.RegisterFooServer,
}
  1. Reflecting over the exported surface looking for a function with the old signature.
@quartzmo quartzmo added triage me I really want to be triaged. type: cleanup An internal cleanup or hygiene concern. and removed triage me I really want to be triaged. labels Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: cleanup An internal cleanup or hygiene concern.
Projects
None yet
Development

No branches or pull requests

1 participant