Shopify / bootboot

Dualboot your Ruby app made easy
MIT License
416 stars 35 forks source link

Document `DEPENDENCIES_NEXT bundle install` #28

Closed searls closed 4 years ago

searls commented 4 years ago

Apologies, I'm trying to work with bootboot for the first time and I'm flailing a bit.

Reading through the documentation and setting up an example repository, I got the impression bootboot would ensure gems were installed, but this seems to not happen. When running bundle install, bootboot indeed keep Gemfile_next.lock in sync, but when I try to run something with DEPENDENCIES_NEXT=1, the gems won't have been installed, necessitating that I run DEPENDENCIES_NEXT=1 bundle install, which seems a bit duplicative.

Do I have this right? Is this necessary? Should it be documented in the README?

Edouard-chin commented 4 years ago

Hey @searls 👋

We can probably modify the README to be more clear because your impression is incorrect. Bootboot won't ensure gems are installed, it will ensure that both lockfiles are in sync. It will basically do a bundle lock to update the content of the Gemfile_next.lock without installing gems specified for the next version, i.e. having a Gemfile like this:

if ENV['DEPENDENCIES_NEXT']
  gem 'rails', '6.0'
else
  gem 'rails', '5.0'
end

Running bundle install, will only install Rails 5.0 and update the Gemfile_next.lock snapshot so that it points to Rails 6.0. You are right that if you want to run Rails 6.0, then you'll need to install the gems by doing a DEPENDENCIES_NEXT=1 bundle install

The rationale behind this behaviour is that usually developers in your team don't need to have the "next" gems installed on their local machine, if we enforced installing them it will slow down the bundle install step without a real necessity.

searls commented 4 years ago

Yeah, that jives with what I pieced together from playing around with bootboot. I think a slight rewording in the README would make this more clear to me, because my first impression was "wait, I have the right Gemfile.lock, how aren't the gems installed?!" (Because in a normal user's course of using Bundler, they'll never experience that)

jacobthemyth commented 4 years ago

Hey @searls 👋. Do you think this is properly addressed by the changes to README.md in #30?

searls commented 4 years ago

Yup, thanks Jacob!