-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Make the lock
command not be affected by the frozen
setting
#7034
Conversation
lock
not be affected by the frozen
settinglock
command not be affected by the frozen
setting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great, thank you!
Thanks @indirect! I included a refactoring that I don't think it's strictly related to this improvement, and while I think it's pretty nice, it does change the signature of a public method in So, I think I'm going to remove that change from this PR and consider it separately (whether it's fine, needs a deprecation or whatever). Not that I consider this particular |
@deivid-rodriguez I like the refactor and understand not wanting to break things. I think a deprecation warning makes sense given the code in bootboot. However, I think this refactor will be appreciated. It may even help the problem they're solving by patching Definition.new (but I didn't dig any further to see why or how that's used). |
@martinemde I fully agree with everything you said. I suspect this refactoring would allow I'll move the refactoring away from this PR and propose it separately in a smoother way (with deprecation). |
The `lock` command is specifically designed to manage the lockfile, so running it should take precedence over any "frozen" setting. Besides that, "frozen" is not specifically designed as "lockfile cannot be updated" but as "installation of gems should be prevented if gemfile is not in sync with the lockfile". The lock command does not install any gems and preserves the property of the lockfile being in sycn with its gemfile, so I think frozen should not influence it. The current behavior is quite confusing when frozen is set. On an app where rubocop can get lockfile updates ``` $ bundle lock --update rubocop Writing lockfile to /path/to/Gemfile.lock ``` Completely silent, it makes you think that it has written the lockfile, but still no updates. In verbose mode, it gives a bit more information, but still confusing and unexpected, and does not change the lockfile: ``` $ bundle lock --update rubocop --verbose Running `bundle lock --update "rubocop" --verbose` with bundler 2.4.20 Frozen, using resolution from the lockfile Writing lockfile to /path/to/Gemfile.lock ``` With this commit, it updates the lockfile as expected.
9dcd710
to
1d501ae
Compare
Make the `lock` command not be affected by the `frozen` setting (cherry picked from commit 28f813b)
Make the `lock` command not be affected by the `frozen` setting (cherry picked from commit 28f813b)
Make the `lock` command not be affected by the `frozen` setting (cherry picked from commit 28f813b)
Make the `lock` command not be affected by the `frozen` setting (cherry picked from commit 28f813b)
What was the end-user or developer problem that led to this PR?
The
lock
command is specifically designed to manage the lockfile, so running it should take precedence over any "frozen" setting.Besides that, "frozen" is not specifically designed as "lockfile cannot be updated" but as "installation of gems should be prevented if gemfile is not in sync with the lockfile".
The lock command does not install any gems and preserves the property of the lockfile being in sycn with its gemfile, so I think frozen should not influence it.
The current behavior is quite confusing when frozen is set. On an app where rubocop can get lockfile updates
Completely silent, it makes you think that it has written the lockfile, but still no updates.
In verbose mode, it gives a bit more information, but still confusing and unexpected, and does not change the lockfile:
What is your fix for the problem, implemented in this PR?
With this commit, it updates the lockfile as expected, by ignoring the
frozen
setting duringbundle lock
.Make sure the following tasks are checked