Skip to content

Make bundle update --bundler actually lock to the latest bundler version (even if not yet installed) - #5182

Merged
deivid-rodriguez merged 10 commits into
masterfrom
bundle-update-bundler
Jan 11, 2022
Merged

deivid-rodriguez merged 10 commits into
masterfrom
bundle-update-bundler

Conversation

@deivid-rodriguez

@deivid-rodriguez deivid-rodriguez commented Dec 20, 2021 •

Copy link
Copy Markdown
Contributor

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

The problem is that upgrading your application to use the latest Bundler is not easy. You have to first run gem install bundler, and then run bundle update --bundler. Running the latter should upgrade Bundler without having to run the former.

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

Fix is to implement this feature but checking available versions remotely and installing the latest available. That unless a specific version is specified as a target (bundle update --bundler <version>), in which case, we first check whether that version is already installed locally and switch to it in that case, or directly install it and switch otherwise.

Fixes #3343.
Fixes #5172.

Make sure the following tasks are checked

@deivid-rodriguez

Copy link
Copy Markdown
Contributor Author

This is green now! I'll add some specs tomorrow.

@deivid-rodriguez
deivid-rodriguez force-pushed the bundle-update-bundler branch 4 times, most recently from 17d9545 to aaf60aa Compare January 7, 2022 20:29
@deivid-rodriguez

Copy link
Copy Markdown
Contributor Author

Alright, I fixed a bunch of bugs and added specs. If CI agrees, this one should be ready!

@deivid-rodriguez
deivid-rodriguez marked this pull request as ready for review January 7, 2022 20:34
Comment thread bundler/lib/bundler/self_manager.rb Resolved
@deivid-rodriguez
deivid-rodriguez force-pushed the bundle-update-bundler branch 5 times, most recently from 595d022 to 884b8ab Compare January 8, 2022 11:45
We did this conservatively when installing the locked version on `bundle
install` (and we may also stop doing it), but in the case of `bundle
update --bundler`, updating bundler is the whole point so it makes no
sense to ignore any errors.
@deivid-rodriguez

Copy link
Copy Markdown
Contributor Author

It was more painful than I expected, but it's all green now!

@deivid-rodriguez
deivid-rodriguez merged commit 474a5e8 into master Jan 11, 2022
@deivid-rodriguez
deivid-rodriguez deleted the bundle-update-bundler branch January 11, 2022 11:31
deivid-rodriguez added a commit that referenced this pull request Jan 12, 2022
Make `bundle update --bundler` actually lock to the latest bundler version (even if not yet installed)

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

Projects

None yet

2 participants