Skip to content

Conversation

@deivid-rodriguez
Copy link
Contributor

@deivid-rodriguez deivid-rodriguez commented Feb 13, 2025

What was the end-user or developer problem that led to this PR?

Sometimes, running bundle update <foo> would downgrade a top level dependency. Regression was introduced by d0f7899.

What is your fix for the problem, implemented in this PR?

The fix is to avoid calling converge_specs when adding lower bound extra requirements to prevent downgrades. Using this method was causing the extra requirements to sometimes not be added.

Fixes #8474.

This PR builds on top of #8489, so that PR should be merged first.

Make sure the following tasks are checked

These don't really hurt, so I'm not sure why I introduced it.
To make it consistent with the spec above it.
There's no reason to call `converge_specs` when adding additional
lower bound requirements to prevent downgrades, and it actually causes
the extra requirements to be missed sometimes.

Loop over the originally locked specs directly, adding the additional
precaution of not adding the requirement if the Gemfile dependency has
changed and it no longer matches the locked spec.
@deivid-rodriguez deivid-rodriguez force-pushed the deivid-rodriguez/fix-unintended-downgrades branch from 4786c2b to 5154506 Compare February 17, 2025 13:30
@deivid-rodriguez deivid-rodriguez marked this pull request as ready for review February 17, 2025 13:31
@deivid-rodriguez deivid-rodriguez merged commit 8fe5bae into master Feb 17, 2025
91 checks passed
@deivid-rodriguez deivid-rodriguez deleted the deivid-rodriguez/fix-unintended-downgrades branch February 17, 2025 15:12
deivid-rodriguez added a commit that referenced this pull request Feb 17, 2025
…d-downgrades

Fix regression when running `bundle update <foo>` would sometimes downgrade a top level dependency

(cherry picked from commit 8fe5bae)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Potential downgrade regression with Bundler >= 2.6.0

2 participants