Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Ruby 3.0] Migrate google-api-client gem and drop Ruby 2.4 #18656

Merged
merged 8 commits into from
May 14, 2021

Conversation

ainame
Copy link
Contributor

@ainame ainame commented May 7, 2021

Checklist

  • I've run bundle exec rspec from the root directory to see all new and existing tests pass
  • I've followed the fastlane code style and run bundle exec rubocop -a to ensure the code style is valid
  • I've read the Contribution Guidelines
  • I've updated the documentation if necessary.

Motivation and Context

As per plan #17931, I've been working on Ruby 3.0 support. Prior to this PR, I have done the followings -

  • Updated CI environment/checks to prevent regressions
  • Removed deprecation warnings
  • Bumped Rubocop's version to the latest
  • Replaced unmaintained gems with alternatives

This PR finally unblocks Ruby 3.0 installation by migrating google-api-client gem to new ones that support Ruby 3.0. I also enabled CI checks with Ruby 3.0 on CircleCI, which requires us to install it manually as they haven't released a new macOS image with Xcode 12.5 that is supposed to bundle it.

After this PR gets merged, we are going to be ready to release the new version that officially supports Ruby 3.0 and drop Ruby 2.4 support at the same time.

Description

https://github.com/googleapis/google-api-ruby-client/blob/master/google-api-client/OVERVIEW.md

google-api-client is now split by service. (Just like AWS did for aws-sdk-ruby v3!). We can install only what we use. For fastlane we only use google-apis-playcustomapp_v1 and google-apis-androidpublisher_v3. I put them in gemspec. google-cloud-storage is more like a higher abstracted library to interact with Cloud Storage. It depends on google-apis-iamcredentials_v1 and google-apis-storage_v1 internally.

As far as I read changelog files, there's no breaking change in those four services playcustomapp_v1, androidpublisher_v3, google-apis-iamcredentials_v1 and google-apis-storage_v1 (since google-api-client 0.37.0) and google-cloud-storage (sicne 1.15).

Links
https://github.com/googleapis/google-api-ruby-client/blob/master/google-api-client/CHANGELOG.md
https://github.com/googleapis/google-cloud-ruby/blob/master/google-cloud-storage/CHANGELOG.md#1310--2021-03-10

That change only broke a test case that stub API requests. The gem changed the hostname of API once apparently.

Testing Steps

Try supply. I personally have never used supply or Android related actions. I appreciate if people try to use this branch for testing 😂

@google-cla google-cla bot added the cla: yes label May 7, 2021
@ainame ainame force-pushed the ai/migrate-google-api-client branch from d18a329 to 5ab5d4b Compare May 7, 2021 17:36
@ainame ainame force-pushed the ai/migrate-google-api-client branch from 5ab5d4b to 7e7c687 Compare May 8, 2021 05:52
@ainame ainame force-pushed the ai/migrate-google-api-client branch from 22a50f5 to b5d76dc Compare May 8, 2021 06:42
@ainame ainame changed the base branch from master to fix-minor-deprecation May 8, 2021 06:45
@ainame ainame changed the title [Ruby 3.0] Officially support Ruby 3.0 by migrating google-api-client gem [Ruby 3.0] Migrate google-api-client gem and drop Ruby 2.5 May 8, 2021
@@ -103,8 +103,9 @@ Gem::Specification.new do |spec|

# The Google API Client gem is *not* API stable between minor versions - hence the specific version locking here.
# If you upgrade this gem, make sure to upgrade the users of it as well.

Choose a reason for hiding this comment

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

Does this comment still apply?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you know that? 😂 I couldn't find the statement that those gems follow the semantic versioning.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But there's no reason to keep them as is. Will revise it.

Choose a reason for hiding this comment

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

I don't know whether the new gems are intended to use semantic versioning. I only noticed that these are no longer version locked.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's right! Thanks.

Copy link
Contributor

Choose a reason for hiding this comment

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

Obviously these are different ecosystems, but if the versions line up at all, at least for javascript the google-apis follows semantic versioning, but it's essentially nothing but major versions because of it - there is always some API changing incompatibly: https://github.com/googleapis/google-api-nodejs-client/blob/master/CHANGELOG.md

Copy link
Contributor Author

@ainame ainame May 10, 2021

Choose a reason for hiding this comment

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

I ended up removing the comment.

As far as I read this thread, they can publish any breaking changes within pre-1.0 version technically.
googleapis/google-api-ruby-client#833 (comment)

That said since they split the gem, it's easy to assume that there are fewer likely breaking changes than before. Their typical breaking changes were removals by APIs; for example, below changelog, which now are split into each gem. If the removal happens, it will appear as the gem's error, which we won't be able to prevent anyway unless we keep catching up with their changes.

Breaking changes:
Deleted androidpublisher_v1_1
Deleted androidpublisher_v2

https://github.com/googleapis/google-api-ruby-client/blob/master/google-api-client/CHANGELOG.md#0420

So my conclusion is to not strict about minor version updates and to keep eyes on their changes. There are new changelog files for each gem as well. We can check them when needed.

https://github.com/googleapis/google-api-ruby-client/blob/master/generated/google-apis-playcustomapp_v1/CHANGELOG.md
https://github.com/googleapis/google-api-ruby-client/blob/master/generated/google-apis-androidpublisher_v3/CHANGELOG.md

@ainame ainame marked this pull request as ready for review May 8, 2021 16:06
@joshdholtz
Copy link
Member

@ainame The title of this PR says “drop Ruby 2.5” but its supposed to say “drop Ruby 2.4”, right? 😇

@ainame ainame changed the title [Ruby 3.0] Migrate google-api-client gem and drop Ruby 2.5 [Ruby 3.0] Migrate google-api-client gem and drop Ruby 2.4 May 10, 2021
@ainame
Copy link
Contributor Author

ainame commented May 10, 2021

@joshdholtz That's right🙈 I fixed it.
If you review this PR, please do that for #18646 first, which this branch depends on 🙇

Copy link
Member

@joshdholtz joshdholtz left a comment

Choose a reason for hiding this comment

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

This is the one!!! 🎊 I pulled this down and ran some tests on supply to make sure we are good and it seems like everything still works as it should 🤷‍♂️ Let's ship this!

@joshdholtz joshdholtz merged commit 690c175 into fix-minor-deprecation May 14, 2021
joshdholtz pushed a commit that referenced this pull request May 14, 2021
ainame added a commit that referenced this pull request May 14, 2021
* Migrate google-api-client to split gems

* Officially support Ruby 3.0 and drop Ruby 2.5 support

* Enable Ruby 3.0 check

* Set 2.5 to Rubocop TagetRubyVersion

* Apply Style/HashTransformKeys and Style/SymbolProc cop correction

* Apply Performance/RedundantEqualityComparisonBlock correction

* Update google-cloud-storage to the latest for Ruby 3.0

* Removed unnecessary comment
joshdholtz pushed a commit that referenced this pull request May 14, 2021
…18689)

* Migrate google-api-client to split gems

* Officially support Ruby 3.0 and drop Ruby 2.5 support

* Enable Ruby 3.0 check

* Set 2.5 to Rubocop TagetRubyVersion

* Apply Style/HashTransformKeys and Style/SymbolProc cop correction

* Apply Performance/RedundantEqualityComparisonBlock correction

* Update google-cloud-storage to the latest for Ruby 3.0

* Removed unnecessary comment

Co-authored-by: Satoshi Namai <s.namai.09@gmail.com>
Copy link

@fastlane-bot fastlane-bot left a comment

Choose a reason for hiding this comment

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

Congratulations! 🎉 This was released as part of fastlane 2.183.0 🚀

@ainame ainame deleted the ai/migrate-google-api-client branch May 17, 2021 14:01
@fastlane fastlane locked and limited conversation to collaborators Jul 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants