googleapis/gapic-generator-ruby

Better support for common classes and resource definitions

dazuma opened this issue · 1 comments

This manifests as two possibly related issues:

  1. Core resource definitions such as cloudresourcemanager.googleapis.com/Project and locations.googleapis.com/Location are defined in google/cloud/common_resources.proto. This file is not present in the common protos provided as part of the generator. Hence:
    • Synth scripts must add it explicitly.
    • This, in turn, causes an unreferenced lib/google/cloud/common_resources_pb.rb file to get generated by the ruby protoc plugin.
  2. It appears that cross-reference links to common protos (such as google.longrunning.Operation) are not getting generated. (This appears, for example, in the docs for google.spanner.admin.database.v1.DatabaseAdmin.ListBackupOperations.) It's possible this would be alleviated if we added google.longrunning.operations.proto explicitly in the synth script but that would then cause the issues in (1) above.

Update: After looking at the particular google.longrunning.Operation failure, I think it's being caused by a different issue. However, the google/cloud/common_resources.proto issue is still relevant.

We need to handle these "common" resources better than we are.

I think we've gotten about as good as we're going to get on this one. We're now removing common_resources_pb.rb during postprocessing. But it's probably the right thing for synth scripts to include it explicitly for now (at least until the bazel work tells us to do something different.) Closing.