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

globalid is broken with Ruby 3.4 / URI 1.0.2 #190

Open
voxik opened this issue Dec 11, 2024 · 1 comment · May be fixed by #192
Open

globalid is broken with Ruby 3.4 / URI 1.0.2 #190

voxik opened this issue Dec 11, 2024 · 1 comment · May be fixed by #192

Comments

@voxik
Copy link

voxik commented Dec 11, 2024

Testing globalid against Ruby 3.4, I observe errors such as:

... snip ...

Failure:
GlobalIDTest#test_invalid_app_name [test/cases/global_id_test.rb:13]:
ArgumentError expected but nothing was raised.

rails test test/cases/global_id_test.rb:8

F

... snip ...

Looking into root cause, it seems that this is due to change in URI, which now accepts underscore / ampersand as a host. I have reported the issue here

@voxik
Copy link
Author

voxik commented Dec 13, 2024

So after analysis, I believe that this is the culprit:

$ ruby -v -ruri -e "p URI::Parser"
ruby 3.3.5 (2024-09-03 revision ef084cc8f4) [x86_64-linux]
URI::RFC2396_Parser

$ ruby -v -ruri -e "p URI::Parser"
ruby 3.4.0dev (2024-12-06 master 3901df708d) +PRISM [x86_64-linux]
URI::RFC3986_Parser

The easy fix could be to keep using the URI::RFC2396_Parser

voxik added a commit to voxik/globalid that referenced this issue Dec 13, 2024
The default parser in URI 1.0.0 / Ruby 3.4 has been changed to RFC3986
[[1]]. This causes test failures such as:

~~~
... snip ...

Failure:
GlobalIDTest#test_invalid_app_name [test/cases/global_id_test.rb:13]:
ArgumentError expected but nothing was raised.

rails test test/cases/global_id_test.rb:8

F

... snip ...
~~~

where underscores / ampersands are now allowed in host. Keep using
`URI::RFC2396_PARSER` for compatibility.

Fixes rails#190

[1]: ruby/uri#107
@voxik voxik linked a pull request Dec 13, 2024 that will close this issue
voxik added a commit to voxik/globalid that referenced this issue Dec 13, 2024
The default parser in URI 1.0.0 / Ruby 3.4 has been changed to RFC3986
[[1]]. This causes test failures such as:

~~~
... snip ...

Failure:
GlobalIDTest#test_invalid_app_name [test/cases/global_id_test.rb:13]:
ArgumentError expected but nothing was raised.

rails test test/cases/global_id_test.rb:8

F

... snip ...
~~~

where underscores / ampersands are now allowed in host. Keep using URI
RFC2396 parser for compatibility.

Fixes rails#190

[1]: ruby/uri#107
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 a pull request may close this issue.

1 participant