Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
CLA is signed and green now. The CI workflow run is sitting in Ran the suite locally in the meantime (Ruby 3.3.10, macOS):
Happy to adjust anything. |
|
@linyiru can you rebase on latest main? That should pull in the fix for the CI failures, then I can stamp |
…rvice REST stubs have no sibling Service constant, so const_defined? with the default inherit: true walks up to Object. An application-level ::Service is then treated as a gRPC Service and service_name is called on it, raising NoMethodError during client construction. Look up Service and Rest with inherit: false so only locally defined constants are considered. Fixes googleapis#70
d1eff2b to
d2b4f77
Compare
|
@torreypayne thanks for reminding about this, I've just rebased and please let me know if any change needed. |
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
toys ciin the gem subdirectory.closes: #70
Summary
Gapic::LoggingConcerns.normalize_servicelooks up theServiceconstant withconst_defined?'s defaultinherit: true. Generated REST stubs have no siblingService, so the lookup walks up toObject. If the application defines a top-level::Service, it is treated as a gRPCServiceandservice_nameis called on it, raisingNoMethodErrorduring client construction.gRPC transports are unaffected because they do define a local
Service.Change
Look up
ServiceandRestwithinherit: falseso only constants defined on the enclosing module are considered.Tests
On starship (Ruby 3.4.10):
toys test: 316 runs, 948 assertions, 0 failures, 0 errorsbundle exec rubocop lib: 42 files, no offensesbundle exec ruby -Ilib:test test/gapic/logging_concerns_test.rb: 10 runs, 12 assertions, 0 failures