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

fix: Generate gRPC files for long-running operations #13

Merged
merged 8 commits into from Dec 22, 2020

Conversation

boimart1
Copy link
Contributor

@boimart1 boimart1 commented Jun 11, 2020

Fixes #12 🦕

(My automatic whitespace formatter removed some trailing whitespace, is this an issue?)

Note that I'm not entirely sure how to work with synthtool, and so I couldn't figure out how to get the license header and formatting fixed before committing the files generated by nox -s generate_protos. Someone else is going to have to do that part for me 🙂 Still, the generated grpc file looks good.

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jun 11, 2020
@boimart1
Copy link
Contributor Author

Ah, actually, it looks like there are some more import weirdnesses than I expected. The committed
operations_pb2 expects operations_grpc_pb2 to have from operations_proto_pb2 import *, which is what allows it to have access both to the messages and the service definitions... I'm not entirely sure what to do with this 🤔

@boimart1
Copy link
Contributor Author

boimart1 commented Jun 11, 2020

I'm thinking of leaving the grpc file to its generated name operations_pb2_grpc.py, and having another "redirect" file (like the current operations_pb2.py) which would amount to:

# operations_grpc_pb2.py
from google.longrunning.operations_proto_pb2 import *
from google.longrunning.operations_pb2_grpc import *

This would ensure that all users who currently import either operations_pb2 or operations_grpc_pb2 continue to work as expected.

The only mild downside is the naming mess.

* Replaced operations_grpc_pb2 with compatibility file
* Removed renaming of newly-genrated operations_pb2_grpc file in noxfile.py
@busunkim96
Copy link
Contributor

I think the naming mess is kind of unavoidable at this point. 🤷 I'll ping some folks to see if they have more historical context on the LRO directory.

Thank you for the PR!

@busunkim96 busunkim96 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 16, 2020
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 16, 2020
@boimart1 boimart1 requested a review from a team as a code owner December 22, 2020 19:20
@busunkim96 busunkim96 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 22, 2020
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 22, 2020
@busunkim96 busunkim96 changed the title Noxfile: Generate gRPC files for long-running operations fix Generate gRPC files for long-running operations Dec 22, 2020
@busunkim96 busunkim96 changed the title fix Generate gRPC files for long-running operations fix: Generate gRPC files for long-running operations Dec 22, 2020
@busunkim96 busunkim96 added automerge Merge the pull request once unit tests and other checks pass. kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Dec 22, 2020
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 22, 2020
@gcf-merge-on-green gcf-merge-on-green bot merged commit a9ce288 into googleapis:master Dec 22, 2020
@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label Dec 22, 2020
gcf-merge-on-green bot pushed a commit that referenced this pull request Jan 27, 2021
@boimart1 boimart1 deleted the lro-generate-grpc branch April 27, 2021 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gRPC code isn't (re)generated for protos containing service definitions
4 participants