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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Ruby 3.0] Replace Kernel.open overridden by open-uri with URI.open #18395

Merged
merged 1 commit into from Mar 17, 2021

Conversation

ainame
Copy link
Contributor

@ainame ainame commented Mar 14, 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

Prior to this PR, I've fixed most issues about Ruby 2.7 deprecation warnings at least within fastlane/fastlane's codebase #18021 as per plan #17931. There are some left in its dependencies. While working on this PR #18278 that randomises the order of execution of test cases, I found that there are more issues that I missed last time due to the code path in unit testing which is always the same unless using --order random like #18278. (In other words, #18278 will be quite handy to reveal undiscovered issues馃槃)

https://app.circleci.com/pipelines/github/fastlane/fastlane/2446/workflows/604cf165-0e95-4227-8088-732c3957d62c/jobs/64390/parallel-runs/0/steps/0-115

Description

Kernel#open which is overridden by require 'open-uri' is deprecated in Ruby 2.7 and removed in Ruby 3.0. For some reasons, it wasn't detected in fastlane's codebase. So this PR replace Kernel#open that appears as open(url) with URI.open which remains available in Ruby 3.0.
ruby/ruby@a73b5cc

Testing Steps

@google-cla google-cla bot added the cla: yes label Mar 14, 2021
@@ -1,4 +1,3 @@
require 'open-uri'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is not in use.

Copy link
Member

@rogerluan rogerluan left a comment

Choose a reason for hiding this comment

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

Seems simple enough! LGTM 馃帀

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.

Oh goodness, I had no idea Kernel.open was being called anywhere 馃槺 Good catch on this! 鉂わ笍

@joshdholtz joshdholtz merged commit 3379eb3 into fastlane:master Mar 17, 2021
@ainame ainame deleted the remove-open-uri branch March 17, 2021 03:08
@ainame
Copy link
Contributor Author

ainame commented Mar 17, 2021

This causes failures in master branch's builds for Ruby 2.4馃槄 I'm not sure why this PR did pass CI checks 馃槀

The mystery solved. #18405 (comment)

@fastlane-bot
Copy link

Hey @ainame 馃憢

Thank you for your contribution to fastlane and congrats on getting this pull request merged 馃帀
The code change now lives in the master branch, however it wasn't released to RubyGems yet.
We usually ship about once a week, and your PR will be included in the next one.

Please let us know if this change requires an immediate release by adding a comment here 馃憤
We'll notify you once we shipped a new release with your changes 馃殌

@fastlane-bot
Copy link

Congratulations! 馃帀 This was released as part of fastlane 2.179.0 馃殌

@rogerluan rogerluan changed the title [Ruby 3.0] Replace Kenerl.open overridden by open-uri with URI.open [Ruby 3.0] Replace Kernel.open overridden by open-uri with URI.open Mar 28, 2021
@fastlane fastlane locked and limited conversation to collaborators May 28, 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

4 participants