We define a number of optional groups in our Gemfile for various purposes (test dependencies, rubocop etc…) but the definition is broken on older rubies using non-legacy versions of Bundler
Bundler should always check dependency resolution with all optional groups, even when not actually installing them. However on old versions this check didn't happen, which is intuitive but wrong
We were depending on the broken behaviour of older Bundler versions to get our tests to run on old Ruby versions. Instead, we should be upfront about these groups not installing on old Rubies by not defining them unless they will resolve
This allows us to use more up-to-date Bundler versions on old Rubies, instead of hard-coding a super old version with broken behaviour
Goal
We define a number of optional groups in our Gemfile for various purposes (test dependencies, rubocop etc…) but the definition is broken on older rubies using non-legacy versions of Bundler
Bundler should always check dependency resolution with all optional groups, even when not actually installing them. However on old versions this check didn't happen, which is intuitive but wrong
We were depending on the broken behaviour of older Bundler versions to get our tests to run on old Ruby versions. Instead, we should be upfront about these groups not installing on old Rubies by not defining them unless they will resolve
This allows us to use more up-to-date Bundler versions on old Rubies, instead of hard-coding a super old version with broken behaviour