-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Rack 3.x compatibility #16158
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
base: trunk
Are you sure you want to change the base?
Rack 3.x compatibility #16158
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||||||||
Rack has renamed `Rack::File` to `Rack::Files` starting with Rack 2.1.0
[[1]]. Rack 3+ drops the old `Rack::File` class and therefore there are
bunch of errors such as:
~~~
334) Selenium::WebDriver::VirtualAuthenticator#user_verified= can not obtain credential requiring verification when set to false
Failure/Error: @static = Rack::File.new(file_root)
NameError:
uninitialized constant Rack::File
# ./spec/integration/selenium/webdriver/spec_support/rack_server.rb:103:in 'Selenium::WebDriver::SpecSupport::RackServer::TestApp#initialize'
# ./spec/integration/selenium/webdriver/spec_support/rack_server.rb:30:in 'Class#new'
# ./spec/integration/selenium/webdriver/spec_support/rack_server.rb:30:in 'Selenium::WebDriver::SpecSupport::RackServer#initialize'
# ./spec/integration/selenium/webdriver/spec_support/test_environment.rb:87:in 'Class#new'
# ./spec/integration/selenium/webdriver/spec_support/test_environment.rb:87:in 'Selenium::WebDriver::SpecSupport::TestEnvironment#app_server'
# ./spec/integration/selenium/webdriver/spec_support/test_environment.rb:162:in 'Selenium::WebDriver::SpecSupport::TestEnvironment#url_for'
# ./spec/integration/selenium/webdriver/spec_support/helpers.rb:41:in 'Selenium::WebDriver::SpecSupport::Helpers#url_for'
# ./spec/integration/selenium/webdriver/virtual_authenticator_spec.rb:55:in 'block (2 levels) in <module:WebDriver>'
~~~
[1]: rack/rack@626272b
The `Rack::Handler` was extracted from Rack 3+ into separate `rackup` package.
User description
🔗 Related Issues
💥 What does this PR do?
Selenium locks Rack to version 2.x, whereas the Rack 3.x is the future. This PR attempts to address the compatibility with Rack 3+
🔧 Implementation Notes
This hopefully keeps compatibility with Rack 2.x. And keeps the Rack 2.x to be locked in Gemfile.lock.
💡 Additional Considerations
🔄 Types of changes
Not sure what category this belongs to 🤔
PR Type
Enhancement
Description
Update Rack compatibility for version 3.x support
Replace deprecated
Rack::FilewithRack::FilesAdd conditional
Rackup::Handlerusage for Rack 3+Maintain backward compatibility with Rack 2.x
Diagram Walkthrough
File Walkthrough
rack_server.rb
Update Rack server for 3.x compatibilityrb/spec/integration/selenium/webdriver/spec_support/rack_server.rb
rackuprequire with error handlingRack::FilewithRack::Filesfor compatibilityRackup::Handlerwhen available, fallback toRack::Handler