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

Regression go away #7756

Merged
merged 10 commits into from Apr 20, 2023
Merged

Regression go away #7756

merged 10 commits into from Apr 20, 2023

Conversation

enebo
Copy link
Member

@enebo enebo commented Apr 14, 2023

When File#absolute_path? was added it did not consider JRuby's
value-added webby URIs. This has been added along with tests.

Pathname was modified to not acces any possible URI as a means
for absolute pathness. This broke because the old pathname code
would walk back a dir at a time until it reached the root (or not).
That process would somehow not pass with http:// urls. The new code
uses a single regular expression and just examines the left hand side
of the string. The regexp matches all URI patterns. Specs have been
added to show this too.

This work led to noticing that File.absolute_path itself is inconsistent
with both File.absolute_path? and Pathname.absolute?. All older versions
are inconsistent in the same way so I pended out the weird spec for future
investigation (It is extremely unclear if someone depends on this behavior
in an external gem/app).

Additionally when roving over regression specs I noticed some glob specs
that I moved into the same spec:jruby suite along with these specs.

This regression spec was written a long time ago but did not test
anything.  ruby/spec does have the spec for this issue and we
currently have it tagged out.  Removing.
When File#absolute_path? was added it did not consider JRuby's
value-added webby URIs.  This has been added along with tests.

Pathname was modified to not acces any possible URI as a means
for absolute pathness.  This broke because the old pathname code
would walk back a dir at a time until it reached the root (or not).
That process would somehow not pass with http:// urls.  The new code
uses a single regular expression and just examines the left hand side
of the string.  The regexp matches all URI patterns.  Specs have been
added to show this too.

This work led to noticing that File.absolute_path itself is inconsistent
with both File.absolute_path? and Pathname.absolute?.  All older versions
are inconsistent in the same way so I pended out the weird spec for future
investigation (It is extremely unclear if someone depends on this behavior
in an external gem/app).
@enebo enebo added this to the JRuby 9.4.3.0 milestone Apr 14, 2023
Moved from -Ptest into jruby:spec and added not only the same tests
but also added negative tests to make sure we behave like previous
JRuby versions for jar resources (do not support // as root?).
Added same general logic and specs.
@enebo enebo merged commit 92ae0eb into jruby:master Apr 20, 2023
46 of 49 checks passed
@enebo enebo deleted the regression_go_away branch June 7, 2023 18:14
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

1 participant