-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Support Protobuf Editions #4555
Comments
Hi, thanks for this issue. I agree that it is important that the gateway stays up to date with the protobuf ecosystem as it evolves. Have you tried using our generators with the new editions syntax? How does it fail, if at all? I was under the impression that editions are optional and may not require any changes to generators. Are there any new features you anticipate will affect the gateway? |
I have tried using the current plugin (in Bazel through rules_proto_grpc_gatway) and encountered failures. As plugin doesn't explicitly notify that it supports editions, proto compilations fails. Here is a sample error message from Bazel:
You're right that adding editions may not require any changes from gateway perspective. I believe if the plugin can just notify that it supports editions, without any functional changes, it should be able to handle protos in the new syntax. |
Hm, I wonder if this is just a matter of updating our dependencies. In any case, thanks for the description. Would you be able to help contribute this? |
Sure thing. I will take a look at the gateway plugin source. I will get back to you when I have a PR. In the mean time, please share any details that may be helpful to me, given that this would be my first contribution here. Thanks! |
The logic is all in |
I took a look at the plugin and included EDITION 2023 in its supported features. Unfortunately that didn't work i.e. protoc didn't complain but the generated code was not valid. Up on digging deeper, it looks like the templating and template functions need to be updated to support field presence, among other things. I also noticed that the code generator, as it is, didn't quite work for proto2 -- for instance, using Let me know if I'm understanding this incorrectly. I was wrong in underestimating the changes needed to add Editions support. I will revisit this later when I have more cycles. |
Thanks for taking a look. I'm surprised to hear that proto2 syntax is causing issues, I wouldn't expect that to be the case. This might be the right time for at least the protoc-gen-grpc-gateway generator to move to something like https://github.com/protocolbuffers/protobuf-go/tree/master/compiler/protogen, though I don't know how much work that would be. |
🚀 Feature
Protobuf is replacing the current syntax
proto2
&proto3
with Editions. All future releases will be new Editions. Edition 2023 is already released as well.The proto plugin for grpc-gateway doesn't yet support Editions. It will be great to add this support as users switch to the new syntax.
The text was updated successfully, but these errors were encountered: