GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: forward compatible diregapic LRO support by software-dov · Pull Request #1085 · googleapis/gapic-generator-python

This repository was archived by the owner on Aug 25, 2026. It is now read-only.

Conversation

@software-dov

@software-dov software-dov commented Nov 13, 2021

Copy link
Copy Markdown
Contributor

Detect whether a method fulfills the criteria for DIREGAPIC LRO.
If so, fudge the name of the generated method by adding the suffix
'_primitive'. This change is made for both the synchronous and async
client variants. Any generated unit tests are changed to use and
reference the fudged name.

The names of the corresponding transport method is NOT changed.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@software-dov
feat: forward compatible diregapic LRO support
6ac5d41
Detect whether a method fulfills the criteria for DIREGAPIC LRO.
If so, fudge the name of the generated method by adding the suffix
'_primitive'. This change is made for both the synchronous and async
client variants. Any generated unit tests are changed to use and
reference the fudged name.

The names of the corresponding transport method is NOT changed.
@software-dov
software-dov requested review from a team, atulep, busunkim96, kbandes, noahdietz, vam-google and vchudnov-g November 13, 2021 00:19
@google-cla google-cla Bot added the cla: yes This human has signed the Contributor License Agreement. label Nov 13, 2021
@software-dov
Changed right back
8b33328
vam-google
vam-google reviewed Nov 16, 2021
View reviewed changes

@vam-google vam-google left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thanks for doing it. I have only one major comment: most probably we would need to populate https://github.com/googleapis/python-api-common-protos with externded_operations stuff (see the corresponding comment for details), like we have done with the other langauges.

Another question: have we agreed on the _primitive suffix? I do not have a strong opinion on the suffix itself, as long as it is as consistent as possible with other languages.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread google/cloud/extended_operations_pb2.py
@@ -0,0 +1,132 @@
# -*- coding: utf-8 -*-

@vam-google vam-google Nov 16, 2021

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we need to add these files into
https://github.com/googleapis/python-api-common-protos/tree/main/google

We have done simiilar procedure in other langauges already, for example:
Java: https://github.com/googleapis/java-common-protos/tree/main/proto-google-common-protos/src/main/java/com/google/cloud

Ruby: https://github.com/googleapis/common-protos-ruby/tree/main/google-cloud-common/lib/google/cloud

Once we do that, I believe we can remove most of these files from this PR.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@busunkim96 busunkim96 Nov 16, 2021 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/googleapis/python-cloud-common/tree/main/google/cloud/common/types was created for google/cloud/common_resources.proto, so I think it will be a more appropriate repo/package for extended_operations.proto.

Can the BUILD.bazel https://github.com/googleapis/googleapis/blob/master/google/cloud/BUILD.bazel be updated to generate this proto as well?

Another note, we've switched to generating proto-plus types by default instead of _pb2.py, will that be a problem for the generator or generated library code? @software-dov

I'm happy to assist with getting the protos published to the appropriate package once the questions above are sorted out.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@vam-google vam-google Nov 16, 2021

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/googleapis/googleapis/blob/master/google/cloud/BUILD.bazel#L51 already has a python target for extended_operations. But that one will create default stubs. If you want generate proto-plus ones, then it is still straightforward, but woluld require changing that target to py_gapic_library and py_gapic_assembly targets instead. I'm happy to assist with that.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@software-dov software-dov Nov 16, 2021

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The extended_operations_pb2.py file is just used by the generator; I don't believe generating proto-plus types will work because proto-plus can't handle message extensions.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@software-dov software-dov Nov 16, 2021

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vam-google The other files added to the PR are necessary for the fragment tests. The only file that can and should be moved is extended_operations_pb2.py.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread gapic/templates/tests/unit/gapic/%name_%version/%sub/test_%service.py.j2 Resolved

Uh oh!

There was an error while loading. Please reload this page.

@software-dov
software-dov requested a review from vam-google November 16, 2021 19:37
@software-dov

software-dov commented Nov 16, 2021

Copy link
Copy Markdown
Contributor Author

@vam-google with regards to the _primitive suffix: the forward compatible LRO doc does not indicate that there is a consensus formed. Ruby does not use that naming convention, and it looks like go doesn't either.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vam-google

vam-google commented Nov 17, 2021

Copy link
Copy Markdown
Contributor

@software-dov Which ones do ruby and go use?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

vam-google
vam-google approved these changes Nov 17, 2021
View reviewed changes

@vam-google vam-google left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but please first finalize the suffix we want to use for this (_primitive or something else) with @vchudnov-g, and upate this PR accordingly to feature the proper suffix.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread tests/fragments/test_diregapic_forwardcompat_lro.proto Resolved

Uh oh!

There was an error while loading. Please reload this page.

software-dov added 3 commits November 17, 2021 14:00
@software-dov
Change the "_primitive" naming convention to "_unary"
07413f4
@software-dov
Add newlines at the end of files
5c126e4
@software-dov
Async get unary'ed
5857d7c
@software-dov
software-dov merged commit aa7f4d5 into googleapis:master Nov 17, 2021
gcf-merge-on-green Bot pushed a commit that referenced this pull request Nov 17, 2021
@release-please
chore: release 0.57.0 (#1090)
7ea436f
🤖 I have created a release \*beep\* \*boop\*
---
## [0.57.0](https://www.github.com/googleapis/gapic-generator-python/compare/v0.56.2...v0.57.0) (2021-11-17)


### Features

* forward compatible diregapic LRO support ([#1085](https://www.github.com/googleapis/gapic-generator-python/issues/1085)) ([aa7f4d5](https://www.github.com/googleapis/gapic-generator-python/commit/aa7f4d568f7f43738ab3489fc84ce6bc5d6bda18))
---


This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
This was referenced Jan 18, 2022
chore(master): release reverted #1133
Merged
chore(master): release 0.40.0 #1138
Closed
chore(master): release 0.39.1 #1146
Closed
This was referenced Jan 26, 2022
chore(main): release 0.39.1 #1160
Closed
chore(main): release 0.39.1 #1162
Closed
chore(main): release 0.61.0 #1163
Merged
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@kbandes kbandes Awaiting requested review from kbandes
@vchudnov-g vchudnov-g Awaiting requested review from vchudnov-g
@noahdietz noahdietz Awaiting requested review from noahdietz
@busunkim96 busunkim96 Awaiting requested review from busunkim96
@atulep atulep Awaiting requested review from atulep
1 more reviewer
@vam-google vam-google vam-google approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@software-dov @vam-google @busunkim96
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.