-
Notifications
You must be signed in to change notification settings - Fork 56
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: Add DIREGAPIC-specific pagination #767
feat: Add DIREGAPIC-specific pagination #767
Conversation
…or from dumped file. For debugging puproses.
Codecov Report
@@ Coverage Diff @@
## master #767 +/- ##
==========================================
- Coverage 91.71% 91.25% -0.47%
==========================================
Files 140 140
Lines 14795 14884 +89
Branches 1052 1061 +9
==========================================
+ Hits 13569 13582 +13
- Misses 942 1011 +69
- Partials 284 291 +7
Continue to review full report at Codecov.
|
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.
Could we base this PR on #765 if possible?
src/main/java/com/google/api/generator/debug/CodeGeneratorRequestDumper.java
Outdated
Show resolved
Hide resolved
src/main/java/com/google/api/generator/debug/CodeGeneratorRequestDumper.java
Outdated
Show resolved
Hide resolved
src/main/java/com/google/api/generator/gapic/composer/defaultvalue/DefaultValueComposer.java
Show resolved
Hide resolved
src/main/java/com/google/api/generator/gapic/model/Message.java
Outdated
Show resolved
Hide resolved
...com/google/api/generator/gapic/composer/common/AbstractServiceStubSettingsClassComposer.java
Show resolved
Hide resolved
List<String> fieldNames = new ArrayList<>(); | ||
fieldNames.add("page_size"); | ||
if (transport == Transport.REST) { | ||
fieldNames.add("max_results"); |
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.
Do we need to do something to check that either max_results
xor page_size
are present, and not both?
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.
No. This logic explicitly prefers page_size
over max_results
if both are present, for safer backward compatibility (i.e. to not let DIREGAPIC-speficif logic mess with normal GAPICS, if somebody for whatever reason decides to add max_results
field into a regular paginated gapic method.
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.
SGTM, could we add a one-line comment to that effect, so that this behavior is clear to future readers who may be unfamiliar with this codebase?
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.
Added
@miraleung There was a merge commit with conflicts in between, so rebasing was painful. I just cleaned up the other pr form this one manually, since it was easier (just 6 files with straightforward changes). I also migrated the relevant comments to the #765, please continue there. |
return inputMessage.fieldMap().containsKey("page_size") | ||
&& inputMessage.fieldMap().containsKey("page_token") | ||
&& outputMessage.fieldMap().containsKey("next_page_token"); | ||
String pagedFieldName = null; |
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.
As per the comment thread above, can we remove this null-assignment?
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.
This is a legit null assignment, as there is no else block. I.e. if there are not signs of field being paginated, null
is a legit value, representing non-paginated case.
List<String> fieldNames = new ArrayList<>(); | ||
fieldNames.add("page_size"); | ||
if (transport == Transport.REST) { | ||
fieldNames.add("max_results"); |
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.
SGTM, could we add a one-line comment to that effect, so that this behavior is clear to future readers who may be unfamiliar with this codebase?
@miraleung PTAL |
🤖 I have created a release *beep* *boop* --- ## [3.0.1](googleapis/java-shared-dependencies@v3.0.0...v3.0.1) (2022-08-02) ### Dependencies * update dependency com.google.code.gson:gson to v2.9.1 ([#766](googleapis/java-shared-dependencies#766)) ([b0d531d](googleapis/java-shared-dependencies@b0d531d)) * update gax.version to v2.18.7 ([#767](googleapis/java-shared-dependencies#767)) ([02e98d5](googleapis/java-shared-dependencies@02e98d5)) * update google.core.version to v2.8.6 ([#770](googleapis/java-shared-dependencies#770)) ([3acea4b](googleapis/java-shared-dependencies@3acea4b)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [org.threeten:threetenbp](https://www.threeten.org/threetenbp) ([source](https://github.com/ThreeTen/threetenbp)) | `1.5.2` -> `1.6.0` | [![age](https://badges.renovateapi.com/packages/maven/org.threeten:threetenbp/1.6.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.threeten:threetenbp/1.6.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.threeten:threetenbp/1.6.0/compatibility-slim/1.5.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.threeten:threetenbp/1.6.0/confidence-slim/1.5.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>ThreeTen/threetenbp</summary> ### [`v1.6.0`](https://github.com/ThreeTen/threetenbp/releases/v1.6.0) [Compare Source](https://github.com/ThreeTen/threetenbp/compare/v1.5.2...v1.6.0) See the [change notes](https://www.threeten.org/threetenbp/changes-report.html) for more information. </details> --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-core).
No description provided.