Skip to content

feat: Skip generation for services without RPC methods defined#1279

Open
aandreassa wants to merge 3 commits intomainfrom
generator-fix-apr-2026
Open

feat: Skip generation for services without RPC methods defined#1279
aandreassa wants to merge 3 commits intomainfrom
generator-fix-apr-2026

Conversation

@aandreassa
Copy link
Copy Markdown
Contributor

@aandreassa aandreassa commented Apr 10, 2026

Example of empty service: google-cloud-dataplex-v1

fix: safely handle bindings_override passing in local LRO clients

When an API includes custom standalone LRO clients alongside ones using mixins like Location, the generator tries to configure those mixins inside the LRO client itself.

Since these LRO clients don't support the bindings_override attribute, this causes crashes withNoMethodError. This change adds a simple check to ensure we only try to pass that setting when the parent client actually defines it.

@aandreassa
Copy link
Copy Markdown
Contributor Author

I tested this locally in google-cloud-dataform-v1beta1 using a local build of gapic-generator-ruby in googleapis . Here is the diff (expected line was deleted):

$ git diff
diff --git a/google-cloud-dataform-v1beta1/lib/google/longrunning/operations/rest/client.rb b/google-cloud-dataform-v1beta1/lib/google/longrunning/operations/rest/client.rb
index f0ddf1e72e..d150c41ef1 100644
--- a/google-cloud-dataform-v1beta1/lib/google/longrunning/operations/rest/client.rb
+++ b/google-cloud-dataform-v1beta1/lib/google/longrunning/operations/rest/client.rb
@@ -182,7 +182,6 @@ module Google
               config.quota_project = @quota_project_id
               config.endpoint = @operations_stub.endpoint
               config.universe_domain = @operations_stub.universe_domain
-              config.bindings_override = @config.bindings_override
               config.logger = @operations_stub.logger if config.respond_to? :logger=
             end

@aandreassa aandreassa marked this pull request as ready for review April 10, 2026 19:46
@aandreassa aandreassa requested a review from a team as a code owner April 10, 2026 19:46
When an API includes custom standalone LRO clients alongside ones using mixins like Location, the generator mistakenly tries to configure those mixins inside the LRO client itself.

Since standard LRO clients don't actually support the `bindings_override` attribute, this caused crashes at startup due to a `NoMethodError`. This change adds a simple check to ensure we only try to pass that setting when the parent client actually defines it!
@aandreassa aandreassa force-pushed the generator-fix-apr-2026 branch from 8bed731 to a5fdbf5 Compare April 13, 2026 18:13
Copy link
Copy Markdown
Member

@viacheslav-rostovtsev viacheslav-rostovtsev left a comment

Choose a reason for hiding this comment

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

LGTM

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