jnbt / candy_check

Check and verify in-app receipts
MIT License
125 stars 71 forks source link

Replace Google API client with specific gems #65

Closed dsantosmerino closed 2 years ago

dsantosmerino commented 3 years ago

As explained in their docs Google changed their approach managing their services gems and the global google-api-client is deprecated.

This library is deprecated and will likely not be updated further. Instead, please install the gem corresponding to the specific service you want to use. For example, to use the Google Drive V3 client, install the google-apis-drive_v3 gem. To use the code generator, install the google-apis-generator gem. The google-api-client gem is a 75 megabyte installation including client classes for more than 300 services. Although the library is designed so that only the classes being used are loaded into memory, it still takes a nontrivial amount of space on disk (and in deployments), and can take a while to install.

Here we only need access to the Android Publisher and the Auth ones, replacing the global one.

This change enables also the support for Ruby 3.0, so it fixes #64.

coveralls commented 3 years ago

Coverage Status

Coverage increased (+0.001%) to 98.644% when pulling b0b1f21bb8d08c241e78b2c836abd0a4ebd89794 on Badiapp:upgrade/google-api-client into 6080043f78078fa627cb157714e9e54a74d5c05c on jnbt:master.

coveralls commented 3 years ago

Coverage Status

Coverage increased (+0.001%) to 98.644% when pulling a47ba1188b911de81b72a1b13a01d56af5c6621c on Badiapp:upgrade/google-api-client into 6080043f78078fa627cb157714e9e54a74d5c05c on jnbt:master.

jnbt commented 3 years ago

@dsantosmerino Thanks for this contribution. Really appreciated.

@christophweegen Please have a look here. It fails on Ruby 2.4, but I think this acceptable as < 2.6 Ruby isn't officially supported anyways.

dsantosmerino commented 3 years ago

@jnbt @christophweegen Can we drop Ruby 2.4 and 2.5 support?

jnbt commented 3 years ago

@dsantosmerino For me it would be OK to drop Ruby 2.4 support (but a breaking change). We would need to keep 2.5 from our use cases because we rely on JRuby which is still on Ruby 2.5.x level.

JRuby 9.2.x is compatible with Ruby 2.5.x and stays in sync with C Ruby.

We also should extend the CI system to test for 2.7.

dsantosmerino commented 3 years ago

@jnbt It should be ready now. Let me know if you need anything else from my side.

dsantosmerino commented 3 years ago

Hey @jnbt, do I need to change something else?

christopheragnus commented 3 years ago

lets hope this gets merged.

christopheragnus commented 3 years ago

I tried testing this PR directly, I'm still getting this error:

Bundler could not find compatible versions for gem "google-apis-androidpublisher_v3":
  In snapshot (Gemfile.lock):
    google-apis-androidpublisher_v3 (>= 0.6.0)

  In Gemfile:
    google-apis-androidpublisher_v3 (~> 0.6.0)

    candy_check was resolved to 0.4.0, which depends on
      google-apis-androidpublisher_v3 (~> 0.2.0)

Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.
dsantosmerino commented 3 years ago

Hey @christopheragnus, I just tested it out in a fresh Ruby project adding the dependency from the PR-related branch with Ruby 3.0.1, and it works fine.

My related test:

# Gemfile
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '3.0.1'

gem 'candy_check', git: 'https://github.com/Badiapp/candy_check',
                   branch: 'upgrade/google-api-client'
christopheragnus commented 3 years ago

Hey @dsantosmerino - I think this is caused because it's using an older version of google-apis-androidpublisher_v3. I think you need to update the dependecies to the latest one?

dsantosmerino commented 3 years ago

@christopheragnus @jnbt We're already using this on our production services 😸

danila commented 2 years ago

@dsantosmerino @jnbt hey there! Are you going to merge this anytime soon?

skliarov commented 2 years ago

@dsantosmerino thank you for this pull request! @jnbt can you please merge it? Looks like all the support of JRuby and Ruby 2.5+ is in place.

skliarov commented 2 years ago

@christophweegen thank you!

christophweegen commented 2 years ago

@skliarov you're welcome. Thanks to you and all the other contributors.

Sorry that progress in this project was a bit delayed in the last months.

Will make sure to close most of the open issues to the end of the year.

NemyaNation commented 1 year ago

this is still an issue in the latest 4.0 gem?

What's the fix?

mike927 commented 1 year ago

When is this fix going to be released in the gem bundle?