Replace usage of CGI::Cookie, fix ruby 3.5 compatibility#2327
Replace usage of CGI::Cookie, fix ruby 3.5 compatibility#2327jeremyevans merged 1 commit intorack:mainfrom
CGI::Cookie, fix ruby 3.5 compatibility#2327Conversation
|
This looks okay to me. @jeremyevans wdyt? |
|
I've added Edit: Does ok on protocol-rack and rails tests but then chokes on roda because of something in rdoc that was extracted. Just wanted to make sure I didn't mess something up. |
I heard rdoc in ruby-head has some issue with psych that could be causing problems. Roda may also need changes for cgi removal. |
To pass tests, a bit more is required:
OTOH, it does not depends on no template engine right now, so it seems be the responsibility of the consumer to add it to their gemfile instead. Does that sound right? In regards to cgi, I think it's good. It does already just require |
In Ruby 3.5, `cgi` will only contain functions related to escaping/unescaping. https://bugs.ruby-lang.org/issues/21258 This is not an exact replicate of course, (`CGI::Cookie`) has some validations and coerces on setters but considering for that purpose this is, they don't seem necessary? During construction of the object rack already does conversions as necessary and setters don't make much sense, and aren't documented/tested for. Although, for improved backwards compatibility, it wouldn't be much effort to make them `attr_accesor` instead.
Rack may add `Rack::MockResponse::Cookie` itself: rack/rack#2327
|
For the 2.6.0 failure you can bump Also could we get this moving? It's preventing testing ruby-head against anything that uses |
|
Probably I can just bust the cache with |
|
I dropped the related cache entry, but now there is a different problem in psych. Instead of: We now get: This is probably because: Psych needs to be updated to only assume a |
|
ruby/psych#729 Unfortunate series of events (https://bugs.ruby-lang.org/issues/3072) |
|
Psych |
|
Deleted the cache entry and reran the job. Specs are now passing, so I'll merge shortly. Thank you @Earlopain for fixing the issue in rack, and @byroot for fixing the issue in psych. |
Well, credit to @Earlopain here to, I just merged. |
|
I hate to ask, and I'm not sure what the 'blast radius' of this is... Puma CI hasn't run for a few days, and I just ran it, and this caused all the ruby head builds to fail. I can add EDIT: as mentioned above, I may try to use rack/main... |
|
When testing with ruby-head, it would be best to also be testing with rack/main. We'll make sure to release versions of rack with this change before the final release of Ruby 3.5.0. |
Not to command you or anything, but ideally compatibility fixes are released quickly so they don't hide subsequent issues. There was a number of big changes in ruby-head recently, and lots of ruby-head CIs are uterly broken making it hard to notice when a new compatibility issue in introduced. |
Thanks. In the past, Puma CI has been stable, but (obviously) significant Ruby head changes can affect things. For now, I'm changing all of Puma's Ruby head CI jobs so they use rack/main, and they're passing.
When the Ruby 'infrastructure' for GHA was stable, I was often an 'advocate' for testing with Windows and also Ruby head. There was a lot of friction about it, but I believe it's common now. I hope people realize that it's needed to quickly determine the true 'blast radius' of changes, or better to fix it now rather than wait for the December release... |
|
If you are testing the master branch of ruby, and not the latest release, I don't think it is unreasonable to expect you to test with the master branch of other ruby projects, and not the latest release (at least when necessary). Expecting all ruby projects to release new gem versions quickly for all changes in ruby-head that affect them is expecting too much, IMO. That being said, I don't handle Rack releases. We should probably backport this to Rack 3.1, 3.0, and 2.2, since we'll want them to be compatible with Ruby 3.5. If another Rack committer wants to release new versions with the fixes shortly after that, I have no objections. |
|
Thanks all 🙏 |
Rack may add `Rack::MockResponse::Cookie` itself: rack/rack#2327
In Ruby 3.5,
cgiwill only contain functions related to escaping/unescaping.https://bugs.ruby-lang.org/issues/21258
This is not an exact replicate of course, (
CGI::Cookie) has some validations and coerces on setters but considering for what purpose this is, they don't seem necessary? During construction of the object rack already does conversions as necessary and setters don't make much sense, and aren't documented/tested for.Although, for improved backwards compatibility, it wouldn't be much effort to make them
attr_accesorinstead.