Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Strip credentials from ambiguous source warnings. #3256

Merged
merged 1 commit into from
Dec 3, 2014
Merged

Strip credentials from ambiguous source warnings. #3256

merged 1 commit into from
Dec 3, 2014

Conversation

TimMoore
Copy link
Contributor

Fixes #3249.


def source_uris_for_spec(spec)
specs.search_all(spec.name).map{|s| s.source_uri }
specs.search_all(spec.name).inject([]) do |uris, spec|
uris << uri_without_credentials(spec.source_uri) if spec.source_uri
Copy link
Member

Choose a reason for hiding this comment

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

probably we want to create a credential-less map of source urls and use that so that we don't have to dup and remove creds from the same source urls hundreds of times?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. I'll update.

@TimMoore
Copy link
Contributor Author

@indirect any more thoughts on the change to add caching?

uris += source_uris_for_spec(spec)
uris.compact!
uris.uniq!
Installer.ambiguous_gems << [spec.name, *uris] if uris.length > 1
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Come to think of it, this probably isn't thread-safe either 😦

@indirect
Copy link
Member

@TimMoore did you get back to this, by any chance? If not, I can probably take a stab at it sometime in the next week.

@TimMoore
Copy link
Contributor Author

@indirect not yet, still on vacation, but I was planning to work on it tomorrow

@indirect
Copy link
Member

👍

On Nov 28, 2014, at 5:51 PM, Tim Moore [email protected] wrote:

@indirect https://github.com/indirect not yet, still on vacation, but I was planning to work on it tomorrow


Reply to this email directly or view it on GitHub #3256 (comment).

@TimMoore
Copy link
Contributor Author

TimMoore commented Dec 1, 2014

I rewrote this based on the earlier discussion with @indirect.

The current implementation passes the tests, including a new one that reproduces #3249, but it still leaves things a little messy. I'm working on a bigger refactoring at https://github.com/TimMoore/bundler/compare/TimMoore:issue-3249-hide-auth-in-source-warning...rubygems-remote-refactor but it will take a few more days to finish, and it might end up being to big for a 1.7.x release.

So assuming that everything passes once Travis is up again, I'd like to merge this (or a slight tweak to this if anyone has any feedback) to 1-7-stable for the next release, then I'll make another pull request against master for the bigger restructuring.

@indirect
Copy link
Member

indirect commented Dec 2, 2014

Awesome, thanks!

indirect added a commit that referenced this pull request Dec 3, 2014
…-warning

Strip credentials from ambiguous source warnings.
@indirect indirect merged commit 298618c into rubygems:1-7-stable Dec 3, 2014
@TimMoore TimMoore deleted the issue-3249-hide-auth-in-source-warning branch December 3, 2014 09:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants