-
Notifications
You must be signed in to change notification settings - Fork 550
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
Support Ruby 2.8 keyword arguments for google-cloud-storage #4884
Conversation
Hi @yahonda, Thank you for opening this PR. Do you have an urgent need for it to be merged? |
Thanks for the reply. Let me update why I need this change, No urgency but it is important to prepare Ruby 3 and avoid warnings for Ruby 2.7 user.
https://buildkite.com/rails/rails/builds/67309#0d0e7865-29ec-49a4-99cb-cdc7b7ea596f/942-1266 ArgumentError: wrong number of arguments (given 4, expected 2..3) Also, Ruby 2.7 shows warnings if the code is not ready for Ruby 3 keyword arguments.
https://buildkite.com/rails/rails/builds/67301#4b646278-fdf1-4e12-86bc-07ea4c2768c0/1008-1275
I'd like to make Rails CI green as much as possible to prepare Ruby 3. Thanks. |
Thanks for the detailed explanation. This makes perfect sense, and we will try to help solve your CI build problem as fast as we can. We are hoping that gRPC will be updated soon, so that possibly we can avoid the Bundler hacks in this PR. In addition, I am thinking that some of these conversions to double splats can just be converted to definite keyword args instead. |
This library was originally written to support Ruby 1.9 (no longer supported), so there are places where |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you can remove the Bundler hacks (and wait for grpc to be updated, hopefully it won't be long), I am ready to approve this PR now with the following four small changes to use keyword args inline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found a few rubocop violations. Run rake rubocop
or rake ci
to check.
Here's a commit for my suggestions that you are welcome to include in this PR if it is helpful. |
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
Thanks for the detailed review. I agree with your commit then cherry-pick quartzmo@76b815f and pushed to this pull request. |
@googlebot I consent. |
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
@yahonda What do you think about removing the Bundler hacks in favor of waiting for a grpc update? |
* To support "Fully separate positional arguments and keyword arguments" ruby/ruby#2794 * `test/google/cloud/storage_test.rb` failure will be addressed once the newer version of minitest is released including the pull request below: "If a callable mock includes kwargs, Ruby 2.7 warns" minitest/minitest#824
Agreed. I have removed the bundler hack and squashed commits. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yahonda Thank you very much for helping us with this!
To prepare Ruby 3 keyword arguments support, there are some other gems also need update. `rake` is one of them. * Rake 13.0.0 supports Ruby 3 keyword arguments by ruby/rake#326 * Rake 13 drops Ruby 2.1 or older support by ruby/rake#325 * Gems under `google-cloud-ruby` repository only supports Ruby 2.4 or higher then dropping Ruby 2.1 support should not be an issue. refs: #4884 pr: #4897
This pull request supports Ruby 2.8 keyword arguments for google-cloud-storage
Fully separate positional arguments and keyword arguments support is required to use google-cloud-storage gem with currently developed Ruby 2.8.0-dev.
Note
test/google/cloud/storage_test.rb
failure will be addressed once the newer version of minitest is released including If a callable mock includes kwargs, Ruby 2.7 warnsWorkaround to force install grpc gem Refer Support for Ruby 2.7 grpc/grpc#21514 (comment)
Note: This commit must be reverted once the newer version of grpc is released to rubygems.org including Add ruby-2.7 to build process of binary gems for Windows and Linux grpc/grpc#22039