Skip to content
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

Find latest compatible version when checking compatibility #49

Merged
merged 3 commits into from May 26, 2022

Conversation

arielj
Copy link

@arielj arielj commented Apr 25, 2022

  • Add an entry to CHANGELOG.md that links to this PR under the "main (unreleased)" heading.

Description:

This PR changes how we check the compatibility of gems. Currently, if the current version of a gem is not compatible with the desired Rails version, we check if the latest available version of that gem is compatible with Rails.

This is a problem, because the latest version may not be compatible with the desired Rails version, but there might be other versions between the current and the latest that are compatible.

This PR updates the compatibility check to check all versions from the latest to the current until it finds a compatible version.

How I tested this:

I really don't know how to add an automated test for this, it relies a lot on external data.

What I did to test this was:

  • created a new Rails 4.2.11 app
  • changed the version of coffee-rails from 4.1.0 to 4.0.1
  • added next_rail to the gemfile
  • ran bundle exec bundle_report compatibility --rails-version=5.0.0

Before this fix:

$ bundle exec bundle_report compatibility --rails-version=5.0.0
=> Incompatible with Rails 5.0.0 (with new versions that are compatible):
These gems will need to be upgraded before upgrading to Rails 5.0.0.

rails-dom-testing 1.0.9 - upgrade to 2.0.3

=> Incompatible with Rails 5.0.0 (with no new compatible versions):
These gems will need to be removed or replaced before upgrading to Rails 5.0.0.

coffee-rails 4.0.1 - new version, 5.0.0, is not compatible with Rails 5.0.0

2 gems incompatible with Rails 5.0.0

After this fix:

$ bundle exec bundle_report compatibility --rails-version=5.0.0
=> Incompatible with Rails 5.0.0 (with new versions that are compatible):
These gems will need to be upgraded before upgrading to Rails 5.0.0.

coffee-rails 4.0.1 - upgrade to 4.2.2
rails-dom-testing 1.0.9 - upgrade to 2.0.3

2 gems incompatible with Rails 5.0.0

As expected from the report.

Closes #9

I will abide by the code of conduct.

@arielj arielj requested a review from a team as a code owner April 25, 2022 19:58
@arielj arielj requested review from lubc and kindoflew and removed request for a team April 25, 2022 19:58
@kindoflew
Copy link

hi @cleicar, can you review this when you have a chance? thanks!

@kindoflew kindoflew requested a review from cleicar April 25, 2022 21:11
@kindoflew
Copy link

ping @cleicar :shipit:

@kindoflew
Copy link

hello @KattKit! can you review this when you have a chance? thanks!

@bronzdoc
Copy link

bronzdoc commented May 20, 2022

I will Review/QA this tomorrow :shipit: ping me if I don't :shipit:

@kindoflew
Copy link

@bronzdoc :shipit:

@bronzdoc bronzdoc merged commit a5373a8 into main May 26, 2022
@bronzdoc bronzdoc deleted the feature/find-latest-compatible-version branch May 26, 2022 00:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bundle_report indicates no compatibility with given Rails version despite there is a compatible one
3 participants