Skip to content

feat(gax): implement uploadChunkCallable for resumable uploads - #14140

Draft
whowes wants to merge 1 commit into
whowes/resumable-upload-startfrom
whowes/resumable-upload-chunk
Draft

feat(gax): implement uploadChunkCallable for resumable uploads#14140
whowes wants to merge 1 commit into
whowes/resumable-upload-startfrom
whowes/resumable-upload-chunk

Conversation

@whowes

@whowes whowes commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

This handles sending binary chunks and finalize commands over HTTP/JSON, extracting offset and status from response headers/codes.

gemini-code-assist[bot]

This comment was marked as outdated.

@whowes whowes changed the title whowes/resumable upload chunk feat(gax): implement uploadChunk in HttpJsonResumableUploadClient Aug 19, 2026
@whowes
whowes force-pushed the whowes/resumable-upload-chunk branch from faf99d0 to 010c0aa Compare August 19, 2026 23:36
@whowes whowes changed the title feat(gax): implement uploadChunk in HttpJsonResumableUploadClient feat(gax): implement uploadChunk in HttpJsonResumableUploadClient Aug 19, 2026
@whowes
whowes force-pushed the whowes/resumable-upload-chunk branch from 010c0aa to baee7f0 Compare August 20, 2026 00:06
@whowes

whowes commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

/gemini review

@whowes
whowes force-pushed the whowes/resumable-upload-chunk branch from baee7f0 to 8a6d2fc Compare August 20, 2026 00:10

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces support for transmitting individual chunks in a resumable upload session by adding ChunkUploadRequest and ChunkUploadResponse classes, implementing uploadChunkCallable() in HttpJsonResumableUploadClient, and adding corresponding unit tests. Feedback was provided to change the HTTP method in UPLOAD_CHUNK_DESCRIPTOR from POST to PUT to comply with the Google Scotty resumable upload protocol.

@whowes
whowes force-pushed the whowes/resumable-upload-chunk branch from 8a6d2fc to 1c123a9 Compare August 20, 2026 01:38
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed for 'gapic-generator-java-root'

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@whowes
whowes force-pushed the whowes/resumable-upload-chunk branch from 1c123a9 to d1a4963 Compare August 20, 2026 20:56
@whowes whowes changed the title feat(gax): implement uploadChunk in HttpJsonResumableUploadClient feat(gax): implement uploadChunkCallable for resumable uploads Aug 21, 2026
@whowes
whowes force-pushed the whowes/resumable-upload-chunk branch from d1a4963 to 0dcb287 Compare August 21, 2026 00:37
@whowes
whowes force-pushed the whowes/resumable-upload-chunk branch 3 times, most recently from 839a11f to e6fd648 Compare August 25, 2026 01:03
@whowes
whowes force-pushed the whowes/resumable-upload-chunk branch from e6fd648 to c851386 Compare August 25, 2026 16:34
@whowes
whowes force-pushed the whowes/resumable-upload-chunk branch from c851386 to 3e9ab99 Compare August 25, 2026 21:44
@whowes
whowes force-pushed the whowes/resumable-upload-chunk branch from 3e9ab99 to 4937751 Compare August 25, 2026 22:00
@whowes

whowes commented Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces chunk uploading capabilities to the resumable upload client by adding ChunkUploadRequest and ChunkUploadResponse value objects, exposing uploadChunkCallable() in ResumableUploadClient, and implementing it in HttpJsonResumableUploadClient along with corresponding unit tests. The review feedback suggests optimizing memory efficiency by using InputStreamContent instead of ByteArrayContent for payload transmission, replacing Guava's Strings.isNullOrEmpty with standard Java checks, and adding defensive validation to ensure non-negative offsets during object creation.


String sizeReceivedStr =
HttpHeadersUtils.getFirstHeader(headers, UPLOAD_SIZE_RECEIVED_HEADER);
if (!Strings.isNullOrEmpty(sizeReceivedStr)) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Using a standard null and empty check avoids any dependency on the Strings class from Guava, ensuring compatibility and avoiding potential compilation issues if the import is missing.

Suggested change
if (!Strings.isNullOrEmpty(sizeReceivedStr)) {
if (sizeReceivedStr != null && !sizeReceivedStr.isEmpty()) {

@whowes
whowes force-pushed the whowes/resumable-upload-chunk branch from 4937751 to a3f0d4c Compare August 25, 2026 23:07
@sonarqubecloud

Copy link
Copy Markdown

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed for 'gapic-generator-java-root'

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

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.

1 participant