Skip to content

cleanup(internal/sidekick/rust): qualify ToProto calls - #7897

Merged
suzmue merged 1 commit into
googleapis:mainfrom
suzmue:qualify-toproto-regen
Nov 9, 2026
Merged

suzmue merged 1 commit into
googleapis:mainfrom
suzmue:qualify-toproto-regen

Conversation

@suzmue

@suzmue suzmue commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Generated ToProto implementations and gRPC transport callers previously invoked .to_proto() without qualifying the target prost type. When multiple crates in a dependency graph implement gaxi::prost::ToProto for the same shared model type (such as google_cloud_rpc::model::Status or google_cloud_type::model::Expr), unqualified .to_proto() calls fail with E0284 type inference ambiguity.

Annotate fields and external nested types with their target prost types and emit fully qualified gaxi::prost::ToProto::::to_proto calls across convert-prost and transport templates.

For googleapis/google-cloud-rust#7284

Generated ToProto implementations and gRPC transport callers previously invoked .to_proto() without qualifying the target prost type. When multiple crates in a dependency graph implement gaxi::prost::ToProto<LocalProstT> for the same shared model type (such as google_cloud_rpc::model::Status or google_cloud_type::model::Expr), unqualified .to_proto() calls fail with E0284 type inference ambiguity.

Annotate fields and external nested types with their target prost types and emit fully qualified gaxi::prost::ToProto::<ProstT>::to_proto calls across convert-prost and transport templates.

For googleapis/google-cloud-rust#7284
@suzmue suzmue changed the title fix(internal/sidekick/rust): qualify ToProto calls cleanup(internal/sidekick/rust): qualify ToProto calls Nov 4, 2026
@suzmue

suzmue commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

Regenerated: googleapis/google-cloud-rust#7374

@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 refactors the Rust code generator to qualify ToProto calls with explicit types (e.g., gaxi::prost::ToProto::::to_proto) rather than calling .to_proto() directly. To support this, a new ProstType field is added to field annotations, and helper functions are introduced in a new prost.go file to map well-known types and resolve paths for prost-generated types. Templates and tests are updated accordingly. I have no feedback to provide as there are no review comments.

@suzmue
suzmue marked this pull request as ready for review November 9, 2026 16:20
@suzmue
suzmue requested review from a team as code owners November 9, 2026 16:20
@suzmue
suzmue merged commit 97d21cf into googleapis:main Nov 9, 2026
50 of 51 checks passed
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