[rubygems/rubygems] Fix unnecessary downgrade of top level dependency when unlocking
Bundler is very conservative by default, trying to preserve versions from the lockfile as possible, and never downgrading them. However, when it runs into a resolution error, it still tries to find a valid resolution.
This fallback behavior was too "brute-force" though, completely unrestricting any gem found in the resolution conflict, and that could lead to direct dependencies being downgraded in some edge cases.
Instead, unlock things a bit more carefully:
First try unlocking fully pinned indirect dependencies, but leave a lower bound requirement in place to prevent downgrades.
Then try unlocking any fully pinned dependency, also leaving a lower bound requirement in place.
Finally completely unrestrict dependencies if nothing else worked.
[rubygems/rubygems] Fix unnecessary downgrade of top level dependency when unlocking
Bundler is very conservative by default, trying to preserve versions
from the lockfile as possible, and never downgrading them. However, when
it runs into a resolution error, it still tries to find a valid
resolution.
This fallback behavior was too "brute-force" though, completely
unrestricting any gem found in the resolution conflict, and that could
lead to direct dependencies being downgraded in some edge cases.
Instead, unlock things a bit more carefully:
lower bound requirement in place to prevent downgrades.
bound requirement in place.
https://github.com/rubygems/rubygems/commit/7f55ed8302