Skip to content

feat(gax): add helpers to detect and surface unsupported resumable upload configurations - #14652

Draft
whowes wants to merge 1 commit into
mainfrom
whowes/resumable-upload-transport-detect
Draft

whowes wants to merge 1 commit into
mainfrom
whowes/resumable-upload-transport-detect

Conversation

@whowes

@whowes whowes commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

gRPC clients bridge resumable uploads to HTTP/JSON using only top-level StubSettings; pre-built channels or transport providers with direct endpoint, credentials, or header overrides are currently silently ignored rather than surfacing an actionable error.

This PR adds

  • HttpJsonCallableFactory.isResumableUploadSupported() to detect incompatible transport providers
  • createFailingResumableUploadCallable() that throws a deferred exception when an upload or resume call is invoked (stub initialization continues to be successful) if an incompatibility or error was encountered during stub creation.

@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 ResumableUploadTransportValidator to validate transport configurations on StubSettings for resumable uploads, exposing helper methods via HttpJsonCallableFactory. A review comment suggests adding a defensive null check for the transport channel provider in ResumableUploadTransportValidator to prevent a potential NullPointerException.

@whowes whowes changed the title feat(gax): detect and defer failure on unsupported resumable upload transport configs feat(gax): add helpers for unsupported resumable upload transport configs Oct 13, 2026
@whowes
whowes added this pull request to stack #14654 October 13, 2026 23:24
@whowes
whowes force-pushed the whowes/resumable-upload-transport-detect branch 2 times, most recently from 9ef8b1e to 5ecea13 Compare October 14, 2026 00:03
@whowes whowes changed the title feat(gax): add helpers for unsupported resumable upload transport configs feat(gax): add helpers to detect and surface unsupported resumable upload configurations Oct 14, 2026
@whowes
whowes force-pushed the whowes/resumable-upload-transport-detect branch from 5ecea13 to b7097e4 Compare October 14, 2026 17:52
@whowes
whowes force-pushed the whowes/resumable-upload-transport-detect branch from b7097e4 to ea63e73 Compare October 14, 2026 18:02
@whowes
whowes marked this pull request as ready for review October 14, 2026 18:06
@whowes
whowes requested a review from a team as a code owner October 14, 2026 18:06
@whowes
whowes requested a review from blakeli0 October 14, 2026 18:06
@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

@whowes
whowes marked this pull request as draft October 14, 2026 20:34
// credentials, and endpoint configured on StubSettings. The provider is only compatible if it
// does not wrap a pre-built channel (FixedTransportChannelProvider) and still expects all
// three settings to be supplied by StubSettings.
return !(provider instanceof FixedTransportChannelProvider)

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.

Discussed offline that this may introduce false positives. Because we are always creating a new channel from StubSettings, as long as customers set the same headers/credentials/endpoints on the StubSettings as well, resumable upload should be supported.

On the other hand, I don't think there is a concrete way to decide if a customized grpc channel can be supported for resumable uploads. This check still provide some value and can be used for a warning message instead of a hard failure.

This branch has not been deployed

No deployments
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