[2.0] Remove RubyGems Aggregate & support transitive source pinning#5792
[2.0] Remove RubyGems Aggregate & support transitive source pinning#5792bundlerbot merged 15 commits intomasterfrom
Conversation
|
@segiddins "it warranted a CVE and its own minor release of Bundler" I know the CVE, but don't think I ever saw the versions impacted and the first fixing version. Can you provide that info? Thanks! |
|
|
@bundlerbot r+ |
|
📌 Commit 9181c06 has been approved by |
|
@bundlerbot r- |
|
👍 |
96057e7 to
4e27808
Compare
Also update them to modern bundler test syntax
# Conflicts: # spec/install/gemfile/sources_spec.rb
4e27808 to
f243da6
Compare
|
There's an off-chance this will pass now, so please review :) |
indirect
left a comment
There was a problem hiding this comment.
This is looking good, and I'm super happy with the metadata source 🙌🏻
| o << "Could not find gem '#{printable_dep(conflict.requirement)}' " | ||
| end | ||
|
|
||
| o << if relevant_sources.empty? |
There was a problem hiding this comment.
please append inside the branches rather than indenting the whole conditional 👍🏻
f243da6 to
4b0db68
Compare
|
Passing for Bundler 1, down to 5 failures for Bundler 2 (I don't know how I keep on missing them locally, I'm sorry) |
|
nothing to be sorry about 😄 |
4b0db68 to
4dcd333
Compare
|
Have two 👍, so going to merge this. @bundlerbot r+ |
|
📌 Commit 4dcd333 has been approved by |
[2.0] Remove RubyGems Aggregate & support transitive source pinning ### What was the end-user problem that led to this PR? The problem was that the resolver could resolve specs from _any_ of the sources specified in the Gemfile, even if that source had nothing to do with the spec in question. This was such a large security vulnerability that, when discovered, it warranted a CVE and its own minor release of Bundler. Closes #3671. Closes #3696. Closes #4059. ### Was was your diagnosis of the problem? My diagnosis was that we needed to get rid of the notion of a `rubygems aggregate` and enforce that specs could only come either from the source they were declared to come from (the top-level source if declared at the top-level of the Gemfile, else a scoped source), or a source that it transitively "inherited" from the gems that required it. ### What is your fix for the problem, implemented in this PR? My fix is to disable multiple top-level sources in the Gemfile, remove the RubyGems aggregate, and filter the sources gems could come from as described above. ### Why did you choose this fix out of the possible options? I chose this fix because it allows doing the filtering in a reasonably performant manner, and refactors the way we handle sources to abstract some of the grossness in such a way that the machinations to make sure that all of the necessary gem info is downloaded is encapsulated into a single method, driven from the definition, rather than being specific to rubygems sources. See #4714 and #4930 for the prior implementation.
|
☀️ Test successful - status-travis |
|
EDIT: My apologies, I'm running into issues with bundler How would specify the preferred source for transitive dependencies? e.g. We have a dependency on Would something like the following work...? |
What was the end-user problem that led to this PR?
The problem was that the resolver could resolve specs from any of the sources specified in the Gemfile, even if that source had nothing to do with the spec in question. This was such a large security vulnerability that, when discovered, it warranted a CVE and its own minor release of Bundler.
Closes #3671.
Closes #3696.
Closes #4059.
Was was your diagnosis of the problem?
My diagnosis was that we needed to get rid of the notion of a
rubygems aggregateand enforce that specs could only come either from the source they were declared to come from (the top-level source if declared at the top-level of the Gemfile, else a scoped source), or a source that it transitively "inherited" from the gems that required it.What is your fix for the problem, implemented in this PR?
My fix is to disable multiple top-level sources in the Gemfile, remove the RubyGems aggregate, and filter the sources gems could come from as described above.
Why did you choose this fix out of the possible options?
I chose this fix because it allows doing the filtering in a reasonably performant manner, and refactors the way we handle sources to abstract some of the grossness in such a way that the machinations to make sure that all of the necessary gem info is downloaded is encapsulated into a single method, driven from the definition, rather than being specific to rubygems sources.
See #4714 and #4930 for the prior implementation.