Skip to content

feat(generator): emit resumable upload settings and HttpJson upload stub - #14321

Merged
whowes merged 1 commit into
mainfrom
whowes/generator-resumable-upload-stub-composer
Sep 18, 2026
Merged

whowes merged 1 commit into
mainfrom
whowes/generator-resumable-upload-stub-composer

Conversation

@whowes

@whowes whowes commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Modified and introduces composers to emit an internal, dedicated REST stub and settings for resumable upload-powered services

@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-resumable-upload-stub-composer branch from f246196 to 1885bb8 Compare September 9, 2026 15:50
@whowes
whowes force-pushed the whowes/generator-resumable-upload-stub-composer branch from 1885bb8 to 542f6e7 Compare September 9, 2026 20:16
@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-resumable-upload-stub-composer branch from 542f6e7 to 6f00489 Compare September 9, 2026 23:51
@whowes
whowes force-pushed the whowes/generator-resumable-upload-stub-composer branch from 6f00489 to 296ed15 Compare September 10, 2026 00:19
@whowes
whowes force-pushed the whowes/generator-resumable-upload-stub-composer branch from 296ed15 to bbc408e Compare September 10, 2026 01:15
@whowes
whowes force-pushed the whowes/generator-resumable-upload-stub-composer branch from bbc408e to c8c1e06 Compare September 10, 2026 06:05
@whowes
whowes force-pushed the whowes/generator-resumable-upload-stub-composer branch from c8c1e06 to c41b295 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-resumable-upload-stub-composer branch from c41b295 to 63a3b57 Compare September 11, 2026 18:30
@whowes
whowes force-pushed the whowes/generator-resumable-upload-stub-composer branch from 63a3b57 to f014476 Compare September 11, 2026 20:00
@whowes
whowes force-pushed the whowes/generator-resumable-upload-stub-composer branch from f014476 to 46d6fdf Compare September 11, 2026 21:14
@whowes
whowes force-pushed the whowes/generator-resumable-upload-stub-composer branch from 46d6fdf to 2525926 Compare September 11, 2026 21:39
@whowes
whowes force-pushed the whowes/generator-resumable-upload-stub-composer branch from 2525926 to 2f42f31 Compare September 11, 2026 22:15
* settings. This is protected so that it is easy to make a subclass, but otherwise, the static
* factory methods should be preferred.
*/
protected HttpJsonResumableUploadServiceResumableUploadStub(

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 have three constructor/factory methods that have the same arguments, consider consolidate them.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Modified this to have one private constructor and one factory method (which has a conditional to adapt for gRPC v. HTTP/JSON).

@whowes
whowes force-pushed the whowes/generator-resumable-upload-stub-composer branch 3 times, most recently from 57daa1f to 954089e Compare September 16, 2026 00:45
RetrySettings settings = null;
settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build();
definitions.put("no_retry_params", settings);
RETRY_PARAM_DEFINITIONS = definitions.build();

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.

The retry settings are not used currently, we need to add the initial unary call settings to ResumableUploadCallSettings. I'll work on it in a separate PR.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

SGTM, thanks!

@whowes
whowes force-pushed the whowes/generator-resumable-upload-stub-composer branch from 954089e to 5821e21 Compare September 16, 2026 05:46
@whowes
whowes force-pushed the whowes/generator-resumable-upload-stub-composer branch 3 times, most recently from c7cffbf to 82fe151 Compare September 18, 2026 15:03
@whowes
whowes marked this pull request as ready for review September 18, 2026 15:07
@whowes
whowes requested review from a team as code owners September 18, 2026 15:07
@whowes
whowes requested a review from blakeli0 September 18, 2026 15:07
.build())
.setTransportChannelProvider(
InstantiatingHttpJsonChannelProvider.newBuilder()
.setEndpoint(settings.getEndpoint())

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.

Endpoint will be set in ClientContext, I don't think we need to set endpoint explicitly. For non-httpjson, I think we can use a default InstantiatingHttpJsonChannelProvider.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Switched to this approach.

.setTransportToken(
GaxHttpJsonProperties.getHttpJsonTokenName(),
GaxHttpJsonProperties.getHttpJsonVersion())
.setQuotaProjectIdToken(settings.getQuotaProjectId())

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.

quotaProjectId is also handled in ClientContext, we don't have to set it here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed.

uploadMediaCallable;

public static HttpJsonResumableUploadServiceResumableUploadStub create(
ClientContext clientContext, ResumableUploadServiceStubSettings settings) throws IOException {

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.

Do we still need to pass clientContext in if we are always recreating it from settings? I think we can use info from settings to determine if the setting is for grpc or httpjson.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I had intended that create would operate only on settings on the last round but clearly didn't get all the way there - apologies for the churn.

Now using only settings, withsettings.getTransportChannelProvider().getTransportName().equals(HttpJsonTransportChannel.getHttpJsonTransportName()) as the condition to determine whether we need to derive the ClientContext from gRPC.

Adds generator support for protocol-specific resumable upload options, independent of any transport stub wiring:

- Emit ResumableUploadCallSettings on the generated <Service>Settings and
  <Service>StubSettings, populated with global timeouts extracted from the
  service config while bypassing standard unary retries.
- Add HttpJsonServiceResumableUploadStubClassComposer, which generates the
  dedicated REST stub (HttpJson[Service]ResumableUploadStub) for services
  containing resumable upload RPC methods.
- Extract HttpJsonDescriptorComposer out of HttpJsonServiceStubClassComposer
  and add path prefix support. Pure refactor with no golden changes, reused by
  the upload stub composer above.

Supersedes #14318 and #14320, which are folded in here.
@whowes
whowes force-pushed the whowes/generator-resumable-upload-stub-composer branch from 82fe151 to 1dee45d Compare September 18, 2026 18:17
@sonarqubecloud

Copy link
Copy Markdown

@sonarqubecloud

Copy link
Copy Markdown

settings
.toBuilder()
.setHttpJsonInternalHeaderProvider(
ApiClientHeaderProvider.newBuilder()

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.

Not in this PR: There might be a better way to do this without exposing a protected method. Or at least share the same generation code as the defaultHttpJsonHeaderProvider.

@whowes
whowes requested a review from blakeli0 September 18, 2026 20:00
@whowes
whowes merged commit c122474 into main Sep 18, 2026
306 of 310 checks passed
@whowes
whowes deleted the whowes/generator-resumable-upload-stub-composer branch September 18, 2026 22:20
blakeli0 pushed a commit that referenced this pull request Sep 23, 2026
🤖 I have created a release *beep* *boop*
---


<details><summary>1.92.0</summary>

##
[1.92.0](v1.91.0...v1.92.0)
(2026-09-23)


### Features

* **bigquery-jdbc:** add `EnableTimestampPicos` connection property and
its plumbing
([#14284](#14284))
([b4aa5ac](b4aa5ac))
* **bigquery-jdbc:** implement picosecond temporal math and formatting
engine
([#14286](#14286))
([2a9612a](2a9612a))
* **bigquery-jdbc:** support picosecond in REST JSON path and nested
types
([#14334](#14334))
([15ffe4a](15ffe4a))
* **bigquery-jdbc:** support picosecond in `PreparedStatement`
parameters and batching
([#14373](#14373))
([c1aac66](c1aac66))
* **bigquery-jdbc:** support picosecond timestamp in `ResultSetMetaData`
and `DatabaseMetaData`
([#14358](#14358))
([43acdd3](43acdd3))
* **bigquery-jdbc:** support picosecond timestamps in Arrow Storage Read
API and nested types
([#14332](#14332))
([b5d9aca](b5d9aca))
* **bigquery-jdbc:** support qualified project delimiter in
`DefaultDataset` property
([#14240](#14240))
([6e8d6c8](6e8d6c8))
* **bigquery:** accelerate row-based query() with Arrow wire format
([#14405](#14405))
([8d12a8f](8d12a8f))
* **bigquery:** add ArrowDeserializer helper utility
([#13943](#13943))
([d9a298b](d9a298b))
* **bigquery:** add ArrowQueryPageFetcher for Arrow query result
pagination
([#14404](#14404))
([615409f](615409f))
* **bigquery:** add ArrowQueryResult and ArrowQueryResultImpl for Arrow
result streaming
([#13944](#13944))
([a62fdf8](a62fdf8))
* **bigquery:** add Storage Read API slow-path fallback for row-based
query()
([#14409](#14409))
([26e568a](26e568a))
* **bigquery:** add zero-copy queryArrow API for Arrow VectorSchemaRoot
streaming
([#14402](#14402))
([b44ffe8](b44ffe8))
* **bigquery:** make BigQuery AutoCloseable with default no-op close
method
([#14434](#14434))
([00bf3de](00bf3de))
* **firestore:** add support for BSON types
([#13189](#13189))
([8a123d9](8a123d9))
* **gax:** add ApiCallContext and request-level settings overloads to
ResumableUploadCallable
([#14251](#14251))
([e8cbd42](e8cbd42))
* **gax:** add globalTimeout settings field to
ResumableUploadCallSettings
([#14253](#14253))
([438cda6](438cda6))
* **gax:** add resumable upload error classification and retry algorithm
([#14419](#14419))
([b70396d](b70396d))
* **gax:** add ResumableUploadCallable creation to Callables and
HttpJsonCallableFactory
([#14242](#14242))
([7de24de](7de24de))
* **gax:** implement baseline Callable and Future for resumable uploads
([#14241](#14241))
([5a54db9](5a54db9))
* **generator:** add model flag and allowlist parser for resumable
upload RPCs
([#14317](#14317))
([acc1856](acc1856))
* **generator:** emit resumable upload client surface
([#14319](#14319))
([a9fed00](a9fed00))
* **generator:** emit resumable upload settings and HttpJson upload stub
([#14321](#14321))
([c122474](c122474))
* **generator:** enable resumable upload generation for showcase
([#14325](#14325))
([f9ebd79](f9ebd79))
* **generator:** switch resumable upload specialized stubs to package
private
([#14471](#14471))
([0d4e875](0d4e875))
* **generator:** wire transport stub delegation to resumable upload
stubs
([#14322](#14322))
([cc4b980](cc4b980))
* **google/cloud/backupdr/v1beta:** add backupdr
([#14410](#14410))
([a4a47da](a4a47da))
* **google/cloud/networkservices/v1beta1:** add networkservices
([#14407](#14407))
([21c4955](21c4955))
* **pubsub:** add publish telemetry headers for publish attempt
observability
([#14338](#14338))
([c167ab8](c167ab8))
* **pubsub:** implement publish hedging to reduce tail latency
([#13735](#13735))
([b302615](b302615))
* **spanner:** Support dynamic TLS certificate and key rotation for
Spanner Omni
([#14456](#14456))
([ffc745c](ffc745c))
* **storage/control:** add delete folder recursive sample
([#13642](#13642))
([f4b1b46](f4b1b46))
* **storage/control:** add delete folder recursive sample
([#14397](#14397))
([2c01d55](2c01d55))


### Bug Fixes

* **auth:** restore transportFactory upon deserialization in
InternalAwsSecurityCredentialsSupplier
([#14340](#14340))
([beea42f](beea42f))
* **bigquery-jdbc:** ensure row ordering in PCNT IT
([#14330](#14330))
([a16f048](a16f048))
* **bigquery-jdbc:** fix htapi fallback due to permission logic
([#14418](#14418))
([21e6dc8](21e6dc8))
* **bigquery-jdbc:** fix Timestamp assertions
([#14290](#14290))
([533ba14](533ba14))
* **bigquery-jdbc:** handle null parameters in Storage Write API bulk
inserts
([#14270](#14270))
([dd2c41a](dd2c41a)),
refs
[#14066](#14066)
* **bigquery-jdbc:** handle SQL NULLs in ResultSet primitive getters
([#14383](#14383))
([8e464fe](8e464fe)),
refs
[#14371](#14371)
* **bigquery:** default Arrow pagination stream location to US instead
of global
([#14458](#14458))
([2775eb1](2775eb1))
* **bigquery:** preserve page token and paginate correctly in Arrow
query when maxResults is set
([#14469](#14469))
([f5601f4](f5601f4))
* **bigquery:** use first page row count for Arrow query pagination
offset
([#14466](#14466))
([9d10dd0](9d10dd0))
* **bigtable:** don't notify config listeners while holding the manager
lock
([#14294](#14294))
([4426ccd](4426ccd))
* **bigtable:** fall back to classic path when per-RPC CallCredentials
are set on session path
([#14477](#14477))
([57bacb0](57bacb0))
* **bigtable:** fix abnormal session closures and scale-up in session
pool
([#14431](#14431))
([6361ecd](6361ecd))
* **biqguery:** fix undeclared QueryParameter wiring in QueryStatistics
([#14401](#14401))
([64cf1d3](64cf1d3))
* **bom:** restore google-cloud-spanner-jdbc to libraries-bom
([#14362](#14362))
([bc7be5e](bc7be5e)),
refs
[#14347](#14347)
* **spanner:** honor maxAttempts and totalTimeout in streaming resume
loop
([#14370](#14370))
([305f47d](305f47d))
* **spanner:** only set snapshot isolation read timestamp for SI or
optimistic txns in CloudClientExecutor
([#14346](#14346))
([54c0d0f](54c0d0f))
* **spanner:** prevent statement cancellation race in
AbstractBaseUnitOfWork
([#14283](#14283))
([d9a8eef](d9a8eef))
* **spanner:** re-enable ITInstanceAdminTest on cloud-devel and
cloud-staging
([#14281](#14281))
([89a8268](89a8268))


### Performance Improvements

* **spanner:** stop re-parsing the request id on every RPC
([#14353](#14353))
([46108f4](46108f4))


### Documentation

* Add a Http/Json Post-Quantum Cryptography Guide
([#13963](#13963))
([fcc65b0](fcc65b0))
* **bigquery:** add QueryArrow code sample and document JDK 17+ JVM
requirements
([#14437](#14437))
([bd363f6](bd363f6))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
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