googleads / google-ads-ruby

Google Ads API Ruby Client Library
https://developers.google.com/google-ads/api/
Apache License 2.0
70 stars 67 forks source link

Wrong dependency of gapic-common #484

Closed himanshu-patel-dev closed 5 months ago

himanshu-patel-dev commented 5 months ago

Describe the bug: gem google-ads-googleads version 27.0.0 have below code (I used this gem to use v16)

File: lib/google/ads/google_ads/v16/services/google_ads_service/client.rb Class: Google:Ads:GoogleAds:V16:Services:GoogleAdsService

def initialize
....
                @google_ads_service_stub = ::Gapic::ServiceStub.new(
                  ::Google::Ads::GoogleAds::V16::Services::GoogleAdsService::Stub,
                  credentials: credentials,
                  endpoint: @config.endpoint,
                  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
                  universe_domain: @config.universe_domain,
                  channel_args: @config.channel_args,
                  interceptors: @config.interceptors,
                  channel_pool_config: @config.channel_pool
                )
...

Above code Gapic::ServiceStub takes many parameters out of which two are

                  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
                  universe_domain: @config.universe_domain,

The above 2 parameters are provided only in gem gapic-common version 0.21.1 and not 0.20.0. As mentioned on rubygems.org below are the current dependencies for google-ads-googleads version 27.0.0

[gapic-common](https://rubygems.org/gems/gapic-common) ~> 0.20
[google-protobuf](https://rubygems.org/gems/google-protobuf) >= 3.19.4, < 4.0

The below screenshot show the difference in the code of gapic-common image

Steps to Reproduce: Try initializing a client this way to observe the issue.

        @client = Google::Ads::GoogleAds::GoogleAdsClient.new do |config|
          config.refresh_token = adwords_user.refresh_token
          config.client_id = ADWORDS_CONFIG['CLIENT_ID']
          config.client_secret = ADWORDS_CONFIG['CLIENT_SECRET']
          config.developer_token = ADWORDS_CONFIG['DEVELOPER_TOKEN']
          config.logger = Rails.logger
        end

Expected behavior: The expected behavior is to make google-ads-googleads point to the right gapic-common version which is 0.21.1

Client library version and API version: Client library version: 27.0.0 Google Ads API version: v16

Gemfile.lock attached as (Gemfile.txt) Gemfile.txt

himanshu-patel-dev commented 5 months ago

Please can I get someone from googleads/google-ads-ruby maintainers team to take a look. It's quite urgent. @mcloonan @danielfrg

Raised a PR for gapic-common gem dependency update: https://github.com/googleads/google-ads-ruby/pull/486

mcloonan commented 5 months ago

Thanks for making the PR. Added one comment, and I'll merge once it's resolved.