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

Revert "path: fix bugs and inconsistencies" #55414

Merged

Conversation

RedYetiDev
Copy link
Member

@RedYetiDev RedYetiDev commented Oct 17, 2024

This (uncleanly) reverts commit efbba60.

Fixes #55410


The commit efbba60 introduced a change where paths would retain trailing / characters. This change led to issues in npm and likely other libraries, because trailing / characters are not typically expected to be preserved.

The purpose of using resolve() on a path is to fully resolve it to its canonical form, regardless of how it is written (e.g., both /hello/../world and /hello/../hello/../world should resolve to the same path). However, this commit altered that behavior, making /hello/ resolve differently from /hello. That made the resolution of identical paths (one with / and one without) return different results. This reverts that behavior

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/loaders
  • @nodejs/url

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. module Issues and PRs related to the module subsystem. needs-ci PRs that need a full CI run. path Issues and PRs related to the path subsystem. whatwg-url Issues and PRs related to the WHATWG URL implementation. labels Oct 17, 2024
@RedYetiDev RedYetiDev added revert PRs that revert previously landed PRs. and removed c++ Issues and PRs that require attention from people who are familiar with C++. module Issues and PRs related to the module subsystem. whatwg-url Issues and PRs related to the WHATWG URL implementation. labels Oct 17, 2024
Copy link

codecov bot commented Oct 17, 2024

Codecov Report

Attention: Patch coverage is 86.04651% with 6 lines in your changes missing coverage. Please review.

Project coverage is 88.40%. Comparing base (7ae193d) to head (c9d8289).
Report is 65 commits behind head on main.

Files with missing lines Patch % Lines
src/path.cc 20.00% 3 Missing and 1 partial ⚠️
lib/internal/url.js 90.00% 0 Missing and 1 partial ⚠️
lib/path.js 96.15% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #55414      +/-   ##
==========================================
- Coverage   88.40%   88.40%   -0.01%     
==========================================
  Files         653      653              
  Lines      187600   187518      -82     
  Branches    36117    36089      -28     
==========================================
- Hits       165854   165770      -84     
+ Misses      14974    14971       -3     
- Partials     6772     6777       +5     
Files with missing lines Coverage Δ
lib/internal/modules/cjs/loader.js 97.74% <100.00%> (+0.30%) ⬆️
lib/internal/url.js 97.63% <90.00%> (-0.36%) ⬇️
lib/path.js 95.99% <96.15%> (+<0.01%) ⬆️
src/path.cc 69.04% <20.00%> (+1.65%) ⬆️

... and 26 files with indirect coverage changes

@lpinca
Copy link
Member

lpinca commented Oct 17, 2024

FWIW the npm issue was already reported in the comments of the original PR, see #54224 (comment).

@ovflowd
Copy link
Member

ovflowd commented Oct 17, 2024

FWIW the npm issue was already reported in the comments of the original PR, see #54224 (comment).

I wonder why no one (besides you) followed up on that. It should never have landed. Still, we should have more tests on CITGM to verify these changes.

Copy link
Member

@ovflowd ovflowd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@RedYetiDev RedYetiDev added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Oct 17, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Oct 17, 2024
@nodejs-github-bot
Copy link
Collaborator

@huseyinacacak-janea
Copy link
Contributor

Since my PR to fix inconsistencies between functions broke a lot of things in other dependencies, it would be better to revert the PR rather than fix all the other dependencies. Thank you for the PR to revert the changes.

@richardlau
Copy link
Member

richardlau commented Oct 17, 2024

FWIW the npm issue was already reported in the comments of the original PR, see #54224 (comment).

I wonder why no one (besides you) followed up on that. It should never have landed. Still, we should have more tests on CITGM to verify these changes.

We used to test npm in CITGM, but it often failed (nodejs/citgm#897). I think it was removed as part of one of the clear outs of persistently failing modules.

There's a (stalled?) PR to add it back: nodejs/citgm#979

@vzaidman
Copy link

fixes #55424

@RDIL
Copy link

RDIL commented Oct 17, 2024

This also broke a ton of Yarn's e2e tests, did CITGM miss that too? 🤔

@RedYetiDev
Copy link
Member Author

For discussion of the CITGM, see nodejs/citgm#1067

@ovflowd
Copy link
Member

ovflowd commented Oct 17, 2024

This also broke a ton of Yarn's e2e tests, did CITGM miss that too? 🤔

I'm not sure if our tests cover it :) https://github.com/nodejs/citgm/tree/main/test/yarn

@RDIL
Copy link

RDIL commented Oct 17, 2024

Oh, yeah, good point.

@nodejs-github-bot
Copy link
Collaborator

@Bo98 Bo98 mentioned this pull request Oct 19, 2024
1 task
@RedYetiDev
Copy link
Member Author

Hey, can this land with the passing CI and approvals?

@bricss
Copy link

bricss commented Oct 20, 2024

Looking forward to see 👀 this in the next semver minor or patch release asap ⏰ coz current Node 23 version a little bit broken, atm 🫠

@lpinca lpinca added the commit-queue Add this label to land a pull request using GitHub Actions. label Oct 21, 2024
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Oct 21, 2024
@nodejs-github-bot nodejs-github-bot merged commit ee46d22 into nodejs:main Oct 21, 2024
59 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in ee46d22

@RedYetiDev
Copy link
Member Author

Great! Should this go out in a patch, or in the next minor?

@jkoenig134
Copy link

This also broke a ton of Yarn's e2e tests, did CITGM miss that too? 🤔

great question, when will this fix land?

@ljharb
Copy link
Member

ljharb commented Oct 23, 2024

npm is very broken; it should go out in a patch asap if possible.

@RedYetiDev
Copy link
Member Author

FWIW I just asked about a potential v23.0.1 patch in slack https://openjs-foundation.slack.com/archives/C019MGJQ8RH/p1729695807771819

aduh95 pushed a commit that referenced this pull request Oct 23, 2024
This reverts commit efbba60.

PR-URL: #55414
Reviewed-By: Claudio Wunder <cwunder@gnome.org>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@aduh95 aduh95 mentioned this pull request Oct 24, 2024
@richardlau richardlau added dont-land-on-v18.x PRs that should not land on the v18.x-staging branch and should not be released in v18.x. dont-land-on-v20.x PRs that should not land on the v20.x-staging branch and should not be released in v20.x. dont-land-on-v22.x PRs that should not land on the v22.x-staging branch and should not be released in v22.x. labels Oct 29, 2024
louwers pushed a commit to louwers/node that referenced this pull request Nov 2, 2024
This reverts commit efbba60.

PR-URL: nodejs#55414
Reviewed-By: Claudio Wunder <cwunder@gnome.org>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. dont-land-on-v18.x PRs that should not land on the v18.x-staging branch and should not be released in v18.x. dont-land-on-v20.x PRs that should not land on the v20.x-staging branch and should not be released in v20.x. dont-land-on-v22.x PRs that should not land on the v22.x-staging branch and should not be released in v22.x. needs-ci PRs that need a full CI run. path Issues and PRs related to the path subsystem. revert PRs that revert previously landed PRs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

npm pack crash in Node 23