railsbump / app

Check which gems are compatible with which Rails version!
https://railsbump.org
MIT License
152 stars 20 forks source link

Improve compatibility checking by splitting up dependency groups #55

Closed manuelmeurer closed 4 years ago

manuelmeurer commented 4 years ago

Let's say we have a Compat linked to Rails 5.0 and these dependencies:

gem1, >= 1.0
gem2, >= 2.0

What Compats::Check does is trying to find another compat linked to Rails 5.0 with only gem1, >= 1.0 and one with only gem2, >= 2.0 as dependencies. If any of them exist and are marked as not compatible, the combination of both requirements cannot be compatible either. So we can mark it as incompatible without running bundle check via Travis, which is quite slow.

When none of these compats with individual dependencies exist, the check is done via Travis. When afterwards a new compat is created, again linked to Rails 5.0 and these dependencies

gem1, >= 1.0
gem3, >= 3.0

the same check is done but no compats with individual dependencies cannot be found either, thus Travis needs to be called again.

So it would make sense to, after the first compat in this example is checked and found to be incompatible, create two more compats with only gem1, >= 1.0 and gem2, >= 2.0 as dependencies and get them checked via Travis, because if one of them is marked as incompatible, this will make checking further compats with this requirement much faster.

manuelmeurer commented 4 years ago

I don't think this is necessary anymore now that we're checking dependency subsets: https://github.com/manuelmeurer/railsbump/commit/624cd531189176941006cc1f1aca6e4fd5e922ec