Skip to content

[Ruby] grpc_tools_ruby_protoc generates wrong namespace for fully-qualified rpc response type #23490

@dazuma

Description

@dazuma

What version of gRPC and what language are you using?

grpc_tools_ruby_protoc 1.30.1 (see https://rubygems.org/gems/grpc-tools/versions/1.30.1) on Ubuntu bionic

What did you do?

Running the grpc protoc plugin on the google.cloud.oslogin.v1 proto (as part of client library codegen). The GetSshPublicKey and UpdateSshPublicKey RPCs generate an incorrect Ruby type for their response type.

Proto: https://github.com/googleapis/googleapis/blob/1b969c28a6579265e89cd35e6c2ecacc89970e2d/google/cloud/oslogin/v1/oslogin.proto#L72

Result: https://github.com/googleapis/google-cloud-ruby/pull/7036/files#diff-963ba7c73491dae821dd8275d003634e (you'll have to click View Diff to see it).

Here's a screen shot in case the PR gets closed: screen shot

Note that the generated type of the response is incorrect (part of the namespace is duplicated).

Some items of note that might be pertinent to this case:

  • The response in the proto is fully-qualified.
  • The proto has defined a custom Ruby namespace (i.e. a ruby_package proto option). The response type is also in a custom Ruby namespace.

Note that the "extra" namespace path that is being added corresponds to the "fully-qualified" segments of the response type, but does not conform to the custom Ruby namespace for this proto. (Look carefully at the case of the "L" in "OsLogin".)

This appears to be a regression in grpc_tools 1.30. (Previous generation runs using 1.28 did not exhibit this behavior.)

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions