Skip to content

feat(generator): wire transport stub delegation to resumable upload stubs - #14322

Draft
whowes wants to merge 1 commit into
whowes/generator-resumable-upload-stub-composerfrom
whowes/generator-transport-stub-delegation
Draft

whowes wants to merge 1 commit into
whowes/generator-resumable-upload-stub-composerfrom
whowes/generator-transport-stub-delegation

Conversation

@whowes

@whowes whowes commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Wires generated transport stubs (GrpcServiceStub, HttpJsonServiceStub) to delegate resumable upload methods to the internal HTTP upload stub, and excludes upload RPCs from the main stubs' method descriptors and callables.

@whowes
whowes added this pull request to stack #14327 September 9, 2026 06:35
gemini-code-assist[bot]

This comment was marked as outdated.

@whowes
whowes force-pushed the whowes/generator-transport-stub-delegation branch 2 times, most recently from e42be42 to 30a1067 Compare September 9, 2026 19:35
@whowes
whowes force-pushed the whowes/generator-transport-stub-delegation branch from 30a1067 to e1bb5fb Compare September 9, 2026 20:17
@whowes
whowes removed this pull request from stack #14327 September 9, 2026 23:45
@whowes
whowes added this pull request to stack #14343 September 9, 2026 23:47
@whowes
whowes force-pushed the whowes/generator-transport-stub-delegation branch 2 times, most recently from c910ed3 to 3fb2567 Compare September 10, 2026 00:19
@whowes
whowes force-pushed the whowes/generator-transport-stub-delegation branch from 3fb2567 to daaf68a Compare September 10, 2026 01:15
@whowes
whowes force-pushed the whowes/generator-transport-stub-delegation branch from daaf68a to 7ca783c Compare September 10, 2026 06:05
@whowes
whowes force-pushed the whowes/generator-transport-stub-delegation branch from 7ca783c to 9905b6e Compare September 11, 2026 17:24
@whowes
whowes removed this pull request from stack #14343 September 11, 2026 17:25
@whowes
whowes added this pull request to stack #14363 September 11, 2026 17:25
@whowes
whowes force-pushed the whowes/generator-transport-stub-delegation branch from 9905b6e to 66afa95 Compare September 11, 2026 18:30
@whowes
whowes force-pushed the whowes/generator-transport-stub-delegation branch from 66afa95 to 26d0fde Compare September 11, 2026 20:00
@whowes
whowes force-pushed the whowes/generator-transport-stub-delegation branch from 26d0fde to 136e9ce Compare September 11, 2026 21:14
@whowes
whowes force-pushed the whowes/generator-transport-stub-delegation branch from 136e9ce to 1ddd21b Compare September 11, 2026 21:39
@whowes
whowes force-pushed the whowes/generator-transport-stub-delegation branch from 1ddd21b to 08ecb13 Compare September 11, 2026 22:15
@whowes
whowes force-pushed the whowes/generator-transport-stub-delegation branch from 08ecb13 to 63ee85f Compare September 14, 2026 21:35
@whowes
whowes removed this pull request from stack #14363 September 14, 2026 22:18
@whowes
whowes added this pull request to stack #14381 September 14, 2026 22:19
.build()
.getHeaders());
uploadHeaders.putAll(clientContext.getHeaders());
ClientContext httpJsonClientContext =

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.

We may want to give it more thought in terms of clientContext sharing between the main stub and the special stub. We could create a separate clientContext with the given settings, which might be easier instead of copying everything over. As long as the stub is still closed during client shutdown, we should good.

@whowes
whowes removed this pull request from stack #14381 September 14, 2026 23:13
@whowes
whowes added this pull request to stack #14382 September 14, 2026 23:14
@whowes
whowes force-pushed the whowes/generator-transport-stub-delegation branch from 63ee85f to ca49e87 Compare September 15, 2026 00:43
@whowes
whowes force-pushed the whowes/generator-transport-stub-delegation branch from ca49e87 to 4d9fb44 Compare September 15, 2026 16:30
@whowes
whowes removed this pull request from stack #14382 September 15, 2026 16:40
@whowes
whowes added this pull request to stack #14390 September 15, 2026 16:48
@whowes
whowes force-pushed the whowes/generator-transport-stub-delegation branch from 4d9fb44 to c77488e Compare September 15, 2026 23:14
@whowes
whowes force-pushed the whowes/generator-transport-stub-delegation branch from c77488e to b768584 Compare September 15, 2026 23:43
…tubs

Wires the generated transport stubs (GrpcServiceStub and HttpJsonServiceStub) to delegate resumable upload methods to the internal HTTP upload stub. In GrpcServiceStub, credentials, headers, and clocks are forwarded to the underlying HTTP client context. Clients initialize successfully without credentials; an exception results only if use of the HTTP upload stub is attempted.

Also declares the stub-side contract that the transports implement:

- In AbstractServiceStubClassComposer: emit public
  ResumableUploadCallable<RequestT, ResponseT> [method]Callable() throwing
  UnsupportedOperationException.
@whowes
whowes force-pushed the whowes/generator-transport-stub-delegation branch from b768584 to db79f9b Compare September 16, 2026 00:46
@sonarqubecloud

Copy link
Copy Markdown

@sonarqubecloud

Copy link
Copy Markdown

this.resumableUploadStub = null;
}

if (resumableUploadStub != null) {

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.

resumableUploadStub is only generated if resumable upload methods exist, so I don't think we need this null check.


if (clientContext.getCredentials() != null) {
this.resumableUploadStub =
HttpJsonResumableUploadServiceResumableUploadStub.create(clientContext, settings);

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.

As I mentioned in another comment, we might be able to just pass the settings to HttpJsonResumableUploadServiceResumableUploadStub.

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