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

feat(AIP-162): lint operation_info response_type #1137

Merged
merged 2 commits into from
Apr 13, 2023

Conversation

noahdietz
Copy link
Collaborator

Allow Rollback RPCs to use LRO, and lint the response_type as if it were the RPC return type.

Do some light refactoring of "is a longrunning operation" checks, favoring a new helper method.

Fixes #1063

@noahdietz noahdietz requested a review from a team as a code owner April 13, 2023 15:24
loc := locations.MethodResponseType(m)

// If LRO, check the response_type short name.
if utils.IsOperation(m.GetOutputType()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

do you think this is worth refactoring to it's own method?

feels like getting the response type from an LRO is a common operation.. or to go a level farther: a utility method to get a response type from a method regardless of whether it's an LRO or not (do the unpacking in the utility method).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think it could be useful for sure.

I think at least some of the code that does similar checks to extract the response type will also want to know if it is an LRO or not for another reason (i.e. which Location to provide to the finding).

Could be a nice clean up though.

@noahdietz noahdietz merged commit 6ea9f20 into googleapis:main Apr 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AIP-162: Rollback should be allowed to return an LRO
2 participants