-
Notifications
You must be signed in to change notification settings - Fork 13
feat: Add exception rules for multiple protos on the compute clients #765
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
Conversation
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.
So we don't want to make exceptions for these - the only reason we did that for UsableSubnetworksAggregatedList was because 1) it was a breaking change and we wanted it to unblock the release, and 2) it doesn't seem to obey any heuristic, so we needed an exception.
But implementing a better heuristic for determining which RPCs are paginated will result in a breaking change, as we are going to enforce a new heuristic which will correct the existing RPCs which we previously missed, as well as ensure we don't miss turning RPCs into paginated lists in the future.
The PHP Heuristic should look like this:
- Check the exception dictionary. If the method is there as a key, use the value as the results field (you've done this already)
- If there is exactly one map field, that field is the results field.
- If there are no repeated fields there is no results field and we shall throw an error
- If there is exactly one repeated field, that field is the results field.
- If there is one repeated message field and any number of repeated primitives, we page on the message field
By implementing this, the above RPCs should be turned into paginated lists (without needing to add them to the exception dictionary)
24263a9 to
3cf0926
Compare
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 added a few minor suggestions, but the logic here looks good! We just need to add some tests (either by updating compute_small.proto or by creating a new test like rest_only_pagination.proto).
|
Here is the summary of changes. You are about to add 4 region tags.
This comment is generated by snippet-bot.
|
614e5a1 to
d5b096d
Compare
Edit the generation logic to pick the correct paginated results from a proto message.
b/427528266