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

Allow rack >= 3 in Rails. #46594

Closed
wants to merge 1 commit into from
Closed

Allow rack >= 3 in Rails. #46594

wants to merge 1 commit into from

Conversation

ioquatix
Copy link
Contributor

@ioquatix ioquatix commented Nov 27, 2022

Allow Rack 3 to be used in Rails.

Blocked By:

@rails-bot rails-bot bot added the actionpack label Nov 27, 2022
@casperisfine
Copy link
Contributor

You'll have to bundle update rack to see if the test suite passes.

As for the failure you see, it was fixed on main, so you can rebase.

@yahonda
Copy link
Member

yahonda commented Nov 28, 2022

There is a similar pull request #45741 Please consider closing one of them.

@p8
Copy link
Member

p8 commented Nov 28, 2022

Wouldn't this also allow rack 4?

Gemfile.lock Outdated Show resolved Hide resolved
@ioquatix
Copy link
Contributor Author

On my local dev machine, just considering actionpack, I've got the test suite down to 27 failures and 2 errors.

@ioquatix
Copy link
Contributor Author

One thing I could use some help with is adding Rack 2 and Rack 3 to the test matrix. It is probably only strictly required for actionpack but maybe others wouldn't hurt.

@ioquatix ioquatix force-pushed the rack-3 branch 4 times, most recently from 1d6c828 to 9be1e57 Compare January 14, 2023 09:25
@ioquatix ioquatix force-pushed the rack-3 branch 2 times, most recently from 854256d to 7cc2592 Compare February 15, 2023 01:29
@drnic
Copy link
Contributor

drnic commented Feb 15, 2023

Great talk at RubyConfAU today @ioquatix! Looking forward to my rails 7.1 app being more awesome. Thanks for all the work!

@ioquatix
Copy link
Contributor Author

A related issue: #47456

@ioquatix

This comment was marked as outdated.

@ioquatix ioquatix force-pushed the rack-3 branch 2 times, most recently from 6eb7f48 to 92afa7a Compare March 13, 2023 00:37

post :render_body, params: params.dup
post :render_body, body: body
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think setting the body directly is the right fix here.

This would bypass the body_stream branch in ActionDispatch::Request#body and there is already have a test for it.

This is currently failing on CI, so I tried a different fix and submitted a PR targeting main to bring back CI to green.


assert_equal params.to_query, @response.body
assert_equal body, @response.body
Copy link
Contributor

Choose a reason for hiding this comment

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

This test pass for me on main with Rack 3.0
Unless I am missing something, I don't think we need to change it anymore.

Rack 3 drops the requirement for input bodies to be rewindable, and
params, once read, may not be available for "raw_post". Update the tests
to prefer to use raw "body:" rather than "params:" which can be consumed
by Rack::Request in Rack 3.
@ioquatix
Copy link
Contributor Author

ioquatix commented Jun 13, 2023

Okay, as far as I'm concerned, this is now all working the best it can be for a 7.1 release. Thanks everyone for your huge effort and patience. It was truely a multi-year project.

@zzak I'd also recommend we make the rack-3 parts of the CI non-optional if they aren't already.

@ioquatix ioquatix closed this Jun 13, 2023
@ioquatix ioquatix deleted the rack-3 branch June 13, 2023 03:41
@ioquatix
Copy link
Contributor Author

ioquatix commented Jun 13, 2023

Summary of all work done in rails:

@piradata
Copy link

piradata commented Jul 5, 2023

The last version of actionpack (7.0.6) still wants rack to be ~> 2.0, >= 2.2.4.
Do you guys know if there is any open PR on actionpack about changing this?

@skipkayhil
Copy link
Member

The last version of actionpack (7.0.6) still wants rack to be ~> 2.0, >= 2.2.4. Do you guys know if there is any open PR on actionpack about changing this?

The work to support Rack 3 has been done on the main branch, so it will be released as Rails 7.1

atosbucket added a commit to atosbucket/turbo-rails that referenced this pull request Apr 11, 2024
There is some test failure when running against edge Rails, due to the
dependencies installing Rack 3 which is [not yet supported][1]. Pinning
our Rack version prevents the failures.

Once the linked Rails PR has landed, we can remove this constraint.

[1]: rails/rails#46594
newheaven918 added a commit to newheaven918/turbo that referenced this pull request Apr 26, 2024
There is some test failure when running against edge Rails, due to the
dependencies installing Rack 3 which is [not yet supported][1]. Pinning
our Rack version prevents the failures.

Once the linked Rails PR has landed, we can remove this constraint.

[1]: rails/rails#46594
luisjose1996 added a commit to luisjose1996/Turbo-Rails that referenced this pull request May 10, 2024
There is some test failure when running against edge Rails, due to the
dependencies installing Rack 3 which is [not yet supported][1]. Pinning
our Rack version prevents the failures.

Once the linked Rails PR has landed, we can remove this constraint.

[1]: rails/rails#46594
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet