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

Automatically unlock dependants released in lockstep #5520

Closed
wants to merge 2 commits into from

Conversation

deivid-rodriguez
Copy link
Member

@deivid-rodriguez deivid-rodriguez commented May 9, 2022

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

Sometimes users might run bundle update <transitive-dependency>, for example, because <transitive-dependency> has a security issue and they want to pick up a release with a fix. This will only work if there are no dependents holding the previous version. A very common case where it does not work is when dependants are released in lockstep with the gem being updated.

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

Smartly detecting dependants holding updates and retrying resolution with those unlocked is a general improvement that could be worth adding to the resolver. However, exact dependencies is a very easy case that can be detected in advance without having to retry at all.

Once dependencies to be unlocked have been figured out, have one more pass to check whether any gems have exact dependencies on them, and unlock those too.

This PR allows things like bundle update actionview just work, by updating the whole "Rails family" at once. It also makes it easier for dependabot to create automated PRs to fix this kind of issue.

Fixes #5463.

Make sure the following tasks are checked

@deivid-rodriguez deivid-rodriguez force-pushed the better-rails-updates branch 4 times, most recently from 5cf0c28 to 2e32e86 Compare May 12, 2022 13:14
I'm tempted to remove it though, since it does not really cover the
original issue it was supposed to cover. But I'll fix it just in case.
@vitaly-pushkar
Copy link

Any chance this gets merged at some point? Would love to have this feature

@deivid-rodriguez
Copy link
Member Author

I think the better way to go is to make this work in general.

Special casing exact dependencies works for the most common cases, but it's not compulsory to keep releasing in lockstep once you've done that once, you should be free to relax those constraints if you need to and special casing exact dependencies would not play nice with that.

I do plan to revisit this.

Smartly detecting dependants holding updates and retrying resolution with those unlocked is a general improvement that could be worth adding to the resolver. However, exact dependencies is a very easy case that can be detected in advance without having to retry at all.

@deivid-rodriguez
Copy link
Member Author

I'm working on a more general solution at #7558, so closing this!

@deivid-rodriguez deivid-rodriguez deleted the better-rails-updates branch April 4, 2024 19:12
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.

Allow easier upgrade of Rails components (and transitive dependencies in general)
2 participants