-
Notifications
You must be signed in to change notification settings - Fork 53
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
Generator should skip generation for empty services #2750
Comments
Similar issue #2050 where the gapic generator errors out if no service exists. |
Possible solutions:
|
Currently I am opting for option 1 in #3051, to skip generation altogether if no RPCs found in a service (filter in parsing services). However, I run into a conflict with this test, and discovered this relative old pr that put on a check for empty services for sample composers.
I want to run this quickly by @blakeli0 to check if you think it's okay to not generate clients for empty services that do not have RPCs? Or otherwise, is empty services like this one a legit use case? |
Thanks for the investigation @zhumin8 ! I don't think this is a legit use case, the PR was probably trying to resolve a presubmit check internally when this proto was introduced. |
fixes #2750 Skip parsing a service if no RPCs found for. In the scenario that only one service with no RPCs or all services have no RPCs, falls back to #2460 This pr also reverts a change brought by #985, and removes the relevant tests. For more context, this has been discussed [here](#2750 (comment)). --------- Co-authored-by: Lawrence Qiu <lawrenceqiu@google.com>
A scenario came up with googleapis/google-cloud-java#10802 where https://github.com/googleapis/googleapis/blob/master/google/cloud/visionai/v1/prediction.proto contains an empty service (e.g. no RPCs).
There tests fail when trying to compile the generated library containing this proto which means the generator is generating some classes for this empty service which are not compilable. The generator instead should skip generation for an empty service.
The text was updated successfully, but these errors were encountered: