Skip to content

feat(internal/sidekick/rust): support default_transport configuration - #7503

Merged
suzmue merged 5 commits into
googleapis:mainfrom
suzmue:default-transport
Sep 8, 2026
Merged

suzmue merged 5 commits into
googleapis:mainfrom
suzmue:default-transport

Conversation

@suzmue

@suzmue suzmue commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Add the default_transport configuration option ("grpc" | "http") to RustDefault and RustModule in librarian config and sidekick codec.

When default_transport is set to "grpc", unary methods in default crate templates route through gRPC via self.grpc_inner.execute instead of HTTP REST. All request/response types for unary gRPC methods are included in prost hybrid generation and converted using ToProto/FromProto. For this PR, we skip LRO generation on the default template. This is incomplete in other ways, our grpc conversions can add references to external types, which we need to add to the Cargo.toml. For the most part, the intent is to support this for our veneers, which have a handwritten Cargo.toml and do not encounter this issue.

This also adds the librarian side changes to update the used by packages to reference "grpc" instead of "streaming".

For googleapis/google-cloud-rust#6470

@suzmue
suzmue requested review from a team as code owners September 3, 2026 23:49
@suzmue

suzmue commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Regenerate bigquery-read with the new config: googleapis/google-cloud-rust#6654

@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 a default_transport configuration option in the Rust generator, allowing unary methods to default to "grpc" instead of "http". It updates the configuration schema, Go structs, codec logic, and mustache templates to generate unary gRPC methods and their associated LRO conversion functions. The review feedback highlights critical compilation issues in the updated transport.rs.mustache template, specifically regarding the handling of nil PathInfo values and potential double-prefixing of external output and LRO types.

Comment thread internal/sidekick/rust/templates/crate/src/transport.rs.mustache
Comment thread internal/sidekick/rust/templates/crate/src/transport.rs.mustache
Comment thread internal/sidekick/rust/templates/crate/src/transport.rs.mustache Outdated
@suzmue
suzmue marked this pull request as draft September 4, 2026 00:30
@suzmue

suzmue commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

I need to think about LROs (or skip them for this PR).

Add the default_transport configuration option ("grpc" | "http") to RustDefault and RustModule in librarian config and sidekick codec.

When default_transport is set to "grpc", unary methods in default crate templates route through gRPC via self.grpc_inner.execute instead of HTTP REST. All request/response types for unary gRPC methods are included in prost hybrid generation and converted using ToProto/FromProto.
@suzmue
suzmue marked this pull request as ready for review September 8, 2026 21:46
@suzmue
suzmue merged commit 5480d3f into googleapis:main Sep 8, 2026
48 checks passed
JoeWang1127 pushed a commit that referenced this pull request Sep 14, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.43.0](v0.42.0...v0.43.0)
(2026-09-14)


### Features

* **internal/config:** add comment field to configuration schema
([#7539](#7539))
([b1deabc](b1deabc))
* **internal/config:** add NodejsDefault with custom_scopes
([#7525](#7525))
([f0fd2d4](f0fd2d4))
* **internal/config:** rename custom_scopes to custom_package_prefixes
([#7536](#7536))
([8b73142](8b73142))
* **internal/librarian/nodejs:** derive package name from custom
prefixes ([#7553](#7553))
([f877089](f877089))
* **internal/librarian/nodejs:** support excluding protos from
generation
([#7574](#7574))
([fd91f7a](fd91f7a)),
refs [#7217](#7217)
* **internal/sidekick/rust:** support default_transport configuration
([#7503](#7503))
([5480d3f](5480d3f))
* **internal/tool/pip:** force reinstall git packages
([#7538](#7538))
([2bf3435](2bf3435))
* **sidekick/rust:** allow fields to be renamed on BigQuery template
([#7563](#7563))
([6fc6200](6fc6200))
* **sidekick/rust:** allow fields to be renamed with name_overrides
([#7562](#7562))
([1ee6462](1ee6462))
* **sidekick/rust:** support unified idempotency_hook configuration
([#7523](#7523))
([4a95ea9](4a95ea9))
* **sidekick/swift:** pass request options to newRequest
([#7573](#7573))
([92b5ee5](92b5ee5))
* **sidekick/swift:** rename DocC landing page
([#7557](#7557))
([9f72f4f](9f72f4f))
* **sidekick/swift:** Storage Control retry policy
([#7529](#7529))
([efaf46c](efaf46c))
* **sidekick/swift:** use `setBody()` helper
([#7561](#7561))
([d8392c2](d8392c2))
* **swift:** add convenience methods without options to
StorageControlProtocol
([#7537](#7537))
([a7e2bb7](a7e2bb7))
* **swift:** generate LRO polling helpers for StorageControl
([#7560](#7560))
([fedb08b](fedb08b))


### Bug Fixes

* **.github/workflows:** trigger issue creation on go integration
failure ([#7554](#7554))
([ced1712](ced1712)),
refs [#7484](#7484)
* **internal/librarian/ruby:** omit copyright_year from librarian.yaml
([#7542](#7542))
([65f3767](65f3767))
* **internal/postprocessing:** add support of copy_and_rename as
method_operations
([#7555](#7555))
([b10b439](b10b439))
* **rust:** avoid use conflicts in setter samples
([#7548](#7548))
([4c72bcc](4c72bcc))
* **sidekick/swift:** normalize monorepo root to forward slashes
([#7566](#7566))
([d6d0250](d6d0250))
* **sidekick/swift:** serialize enums as strings in ProtoJSON
([#7569](#7569))
([fafac18](fafac18))

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