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

Fix private urls using colon separator #2519

Merged
merged 3 commits into from
Feb 5, 2017

Conversation

balthazar
Copy link

@balthazar balthazar commented Jan 20, 2017

People were still experiencing issues with private urls using colons as separator even after the fix introduced in #2384.

This fix basically replace the initial pathname part of the parsed url in the git resolver, and reformat exploded parts onto the equivalent url, removing the colon culprit.

Unsure about why the require onto the url module is done the old way, I've decided to follow consistency, but can refactor if needed. Related issues referenced in commit.

👋 @chrisirhc @lxe

@chrisirhc
Copy link
Contributor

chrisirhc commented Jan 20, 2017

The might not work for some git urls since : doesn't always translate to /. The conversion needs to be through git/ssh client which understand in their own way what the : means based on the .gitconfig or .ssh/config. I've mentioned one way of solving this is to not attempt to rewrite the URL (since it'll just fail) and just send it straight to the git client for handling (#573 (comment)).


});

test('GitResolver transformUrl affect host colon separated urls', () => {
Copy link

Choose a reason for hiding this comment

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

Maybe call this 'GitResolver transformUrl replaces the colon on colon separated urls' ?

// This transformUrl util is here to replace colon separators in the pathname
// from private urls. It takes the url parts retrieved using urlFormat and
// returns the associated url. Related to #573, introduced in #2519.
static transformUrl(parts) : string {
Copy link

Choose a reason for hiding this comment

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

I think we can probably come up with a more descriptive name than "transform."

@bestander
Copy link
Member

Nice work, thanks a lot for the tests!

@bestander bestander merged commit de43f4a into yarnpkg:master Feb 5, 2017
mnsn pushed a commit to mnsn/yarn that referenced this pull request Feb 15, 2017
* Fix private urls using colon separator

Closes yarnpkg#573, closes yarnpkg#2416.

Related to yarnpkg#2384, yarnpkg#573.

* Remove unused suppression

* Move to dedicated method & add tests
balthazar referenced this pull request Apr 13, 2017
…ers (#2990)

* Non-nullable git supportsArchiveCache

* Git URLs are not real URLs, they also support scp host specifiers

Fixes #1796

* Remove workaround replacing ':' in git URLs

(#573, #1796)

* Expect already-parsed URL in Git constructor
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.

4 participants