-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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] fix failing CI checks by supporting open-uri on Ruby 2.4 #18405
Conversation
# URI.open added by `require 'open-uri'` is not available in Ruby 2.4. This helper lets you open a URI | ||
# by choosing appropriate interface to do so depending on Ruby version. This helper is subject to be removed | ||
# when fastlane drops Ruby 2.4 support. | ||
def self.open_uri(*rest, &block) |
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.
Sweeeeet dependency isolation 鉂わ笍
fastlane_core/spec/helper_spec.rb
Outdated
end | ||
|
||
it 'performs URI.open with block' do | ||
is_called_block = false |
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.
Maybe is_block_called
or did_call_block
?
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.
did_call_block
reminds me UIKit's convention 馃槀 Will change it to the former one.
It turned out that unit tests failed actually but the PR was marked as "All checks have passed" due to the issue I fixed in https://github.com/fastlane/fastlane/pull/18398馃槀 The PR to replace |
Co-authored-by: Roger Oba <rogerluan.oba@gmail.com>
There are many ways to fix that timing issue :) we could enforce all PRs to contain the latest master before being mergeable (via GitHub branch settings), or also configure CI to run "PR builds" which merge master into the branch (locally only, in CI) before running checks 馃槃 |
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.
This is 馃敟 Thanks fo fixing this so quickly 鉂わ笍
In this case, only the former one could solve this issue as the PR was created before the fix goes into the master branch but the solution would need help from auto-merge tools in order to start adopting馃檪 |
Hey @ainame 馃憢 Thank you for your contribution to fastlane and congrats on getting this pull request merged 馃帀 Please let us know if this change requires an immediate release by adding a comment here 馃憤 |
Congratulations! 馃帀 This was released as part of fastlane 2.179.0 馃殌 |
Checklist
bundle exec rspec
from the root directory to see all new and existing tests passbundle exec rubocop -a
to ensure the code style is validMotivation and Context
Prior to this PR, I fixed deprecation warnings around the usage of
open-uri
in #18395 (as a part of #17931). However the alternativeURI.open
isn't supported on Ruby 2.4 apparently馃槩 So this PR is adding a helper method that chose eitherURI.open
orURI.parse(...).open
depending on Ruby version.Description
It's a simple helper method. I added tests to make sure all of the Ruby versions we support can perform
FastlaneCore::Helper.open_uri
.Testing Steps
It's done by RSpec.