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(gapic-generator): Change REGAPIC pagination algorithm to the standard algorithm for non-compute clients #1143

Merged
merged 3 commits into from
Jan 30, 2025

Conversation

dazuma
Copy link
Member

@dazuma dazuma commented Jan 15, 2025

See internal issue b/382502247. This updates the pagination detection algorithm for REST/REGAPIC clients so it complies with AIP-158. It does not affect compute, which should remain on the custom algorithm.

This will cause breaking changes in 70-ish GAPICs, where pagination behavior for some REST RPC methods will change. Thus, this should be merged and applied with care.

@dazuma dazuma requested a review from a team as a code owner January 15, 2025 22:53
@dazuma dazuma force-pushed the pr/regapic-pagination branch 3 times, most recently from f7ca806 to c394de3 Compare January 22, 2025 21:30
@dazuma dazuma force-pushed the pr/regapic-pagination branch from c394de3 to c5b8976 Compare January 23, 2025 18:56
@dazuma dazuma requested a review from aandreassa January 23, 2025 21:39
return "::Gapic::Rest::PagedEnumerable<#{pagination.paged_element_doc_type}>" if paged?
if paged?
elem_type = compute_pagination&.paged_element_doc_type
elem_type ||= (lro? ? "::Gapic::Operation" : @main_method.paged_response_type)

Choose a reason for hiding this comment

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

This will always return false

Copy link
Member Author

Choose a reason for hiding this comment

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

Are you sure? It's not possible to be both paged? and lro?? The logic in MethodPresenter#lro? seems to account for the case of both.

Choose a reason for hiding this comment

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

you're checking for lro? 2 lines up and bailing out if it's true though

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh 🤦🏻‍♂️ you're right. Okay I don't understand fully the cases here, but I guess we'll retain the current logic.

Copy link
Member

@viacheslav-rostovtsev viacheslav-rostovtsev left a comment

Choose a reason for hiding this comment

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

LGTM with some comments

@dazuma dazuma merged commit 95d1add into googleapis:main Jan 30, 2025
3 checks passed
@dazuma dazuma deleted the pr/regapic-pagination branch January 30, 2025 22:23
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.

2 participants