-
Notifications
You must be signed in to change notification settings - Fork 1.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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extract rackup
command, Rack::Server
, Rack::Handler
and related code into a separate gem.
#1937
Conversation
5153e96
to
709d841
Compare
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.
As stated previously, I don't think the benefits of extracting rackup outweigh the backwards compatibility breakage. However, since we've decided to move in that direction, in terms of implementation, this looks mostly fine.
Can you explain why Rack::Handler#{register,[]}
were left? Is it because web servers use those and you don't want to break that? If so, shouldn't both issue deprecation warnings? Ultimately, setting of handlers is for the benefit of rackup, not rack itself, if I understand things correctly. So we would want the webservers to check Rack.release
and:
- For >= 3, if they want to support rackup, switch to
Rackup::Handler
(if only defined, or attempting to require first and defining only if successful?). If they don't want to support rackup, do nothing. - For < 3, continue using
Rack::Handler
.
5752b86
to
867b23c
Compare
rackup
command, Rack::Server
, Rack::Handler
and related code into a separate gem.
Does not work since the rackup extraction (rack#1937).
Does not work since the rackup extraction (#1937).
Related to rack/rack#1937
This test is failing in CI: ``` [sig-builds][Feature:Builds][Slow] s2i build with environment file in sources Building from a template should create a image from "test-env-build.json" template and run it in a pod [apigroup:build.openshift.io][apigroup:image.openshift.io] ``` In rack/rack#1937, rackup was moved to a different gem, which is what the s2i ruby config relies on: https://github.com/sclorg/s2i-ruby-container/blob/master/2.2/s2i/bin/assemble#L52 This adds "rackup" gem.
This test is failing in CI: ``` [sig-builds][Feature:Builds][Slow] s2i build with environment file in sources Building from a template should create a image from "test-env-build.json" template and run it in a pod [apigroup:build.openshift.io][apigroup:image.openshift.io] ``` In rack/rack#1937, rackup was moved to a different gem, which is what the s2i ruby config relies on: https://github.com/sclorg/s2i-ruby-container/blob/master/2.2/s2i/bin/assemble#L52 This adds "rackup" gem.
Should have never took the lobster out
|
Can you share some of the example code that uses this? |
… separate gem in Rack 3.0 refs. rack/rack#1937
This test is failing in CI: ``` [sig-builds][Feature:Builds][Slow] s2i build with environment file in sources Building from a template should create a image from "test-env-build.json" template and run it in a pod [apigroup:build.openshift.io][apigroup:image.openshift.io] ``` In rack/rack#1937, rackup was moved to a different gem, which is what the s2i ruby config relies on: https://github.com/sclorg/s2i-ruby-container/blob/master/2.2/s2i/bin/assemble#L52 This adds "rackup" gem.
This test is failing in CI: ``` [sig-builds][Feature:Builds][Slow] s2i build with environment file in sources Building from a template should create a image from "test-env-build.json" template and run it in a pod [apigroup:build.openshift.io][apigroup:image.openshift.io] ``` In rack/rack#1937, rackup was moved to a different gem, which is what the s2i ruby config relies on: https://github.com/sclorg/s2i-ruby-container/blob/master/2.2/s2i/bin/assemble#L52 This adds "rackup" gem.
Recently I re-organized my web-related ruby code. Still going through ... One component was rack + sinatra. So when I looked at rack, I found that in my old code for the lobster:
It took me a while to find out that Rack::Server is not part of rack anymore. Finally I found this here, I read the changelog.md file. At the least the change was documented. Still, I find this was not a good change. I believe that IF such things are changed, they should be I also agree that the lobster is epic and should not be tampered with. Back when chris2 wrote So my first suggestion here is:
|
I should also point out again, just so that people understand this, that google search really sucks now. Finding examples and working code is so much harder than it used to be. Because of this I think it is SUPER important that ruby in general improves its documentation everywhere. Otherwise with projects that are abandoned yet changing code and nobody updating the documentation, we are operating in a black box made worse by Google having ruined its search engine (and the replacements also suck; I tried to switch to duckduckgo, and it consistently produces even more garbage results than Google. I have no idea what happened, but either way my conclusion is that documentation must be improved in general, everywhere - and particular in ruby-based projects. Some document very nicely, such as Jeremy's projects, but other projects kind of lack documentation. Rack is somewhere in the middle, though such breaking code changes also intensify the need to have better documentation overall. I keep local documentation too, but just as the example of Rack::Server shows, I may end up being dumbfounded for a while and then it takes some time to get up-to-date again. That change is not even that old, ~2 years ago, so you can see how quickly things decay quality-wise.) |
Thanks for your feedback. I've added a link to This was also mentioned in the upgrade guide, and it has some examples, although not as extensive as you probably want. Feel free to contribute an |
We discussed the options here and the general consensus seems to be to extract it. #1928
This PR removes all the rackup specific code into https://github.com/rack/rackup
I've released a v0.1.0 gem for testing, and confirmed it works with this branch.
The following classes were moved:
Rack::Server
->Rackup::Server
Rack::Handler
->Rackup::Handler
. Some minimal function was retained for compatibility.Rack::Lobster
->Rackup::Lobster
.I've moved almost all the code verbatim with minimal changes.
There are several follow up actions but I suggest we make this as direct lift and shift as possible. Later on we can improve
rackup
independently ofrack
.