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

Extract rackup command, Rack::Server, Rack::Handler and related code into a separate gem. #1937

Merged
merged 4 commits into from Aug 4, 2022

Conversation

ioquatix
Copy link
Member

@ioquatix ioquatix commented Aug 1, 2022

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 of rack.

Copy link
Contributor

@jeremyevans jeremyevans left a 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.

@ioquatix ioquatix changed the title Extract rackup Extract rackup command, Rack::Server, Rack::Handler and related code into a separate gem. Aug 4, 2022
@ioquatix ioquatix merged commit 882cbb3 into main Aug 4, 2022
@ioquatix ioquatix deleted the extract-rackup branch August 4, 2022 04:08
dentarg added a commit to dentarg/rack that referenced this pull request Sep 7, 2022
Does not work since the rackup extraction (rack#1937).
@dentarg dentarg mentioned this pull request Sep 7, 2022
ioquatix pushed a commit that referenced this pull request Sep 9, 2022
Does not work since the rackup extraction (#1937).
ElMassimo pushed a commit to ElMassimo/jekyll-vite that referenced this pull request Sep 9, 2022
stbenjam added a commit to stbenjam/origin that referenced this pull request Sep 13, 2022
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.
stbenjam added a commit to stbenjam/origin that referenced this pull request Sep 13, 2022
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.
@ppibburr
Copy link

ppibburr commented Oct 10, 2022

Should have never took the lobster out

  1. Example code is everywhere with require 'rack/lobster
  2. Rack::Lobster is word play on Rock-Lobster, not Rockup-Lobster

@ioquatix
Copy link
Member Author

Can you share some of the example code that uses this?

blooper05 added a commit to blooper05/LGTuMblr-api that referenced this pull request Oct 13, 2022
openshift-cherrypick-robot pushed a commit to openshift-cherrypick-robot/origin that referenced this pull request Oct 19, 2022
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.
openshift-cherrypick-robot pushed a commit to openshift-cherrypick-robot/origin that referenced this pull request Oct 19, 2022
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants