fastruby / next_rails

A toolkit to upgrade your next Rails application
https://www.fastruby.io/blog/upgrade-rails/dual-boot/dual-boot-with-rails-6-0-beta.html?utm_source=github&utm_medium=description&utm_campaign=github&utm_term=next-rails
MIT License
489 stars 31 forks source link

Fix bundle report compatibility error #79

Closed sean-dickinson closed 1 year ago

sean-dickinson commented 1 year ago

Description

Motivation and Context

I will say I'm not completely clear on the logic in #find_latest_compatible. I don't know enough about the shape of the spec objects and the edge cases surrounding them. It appears to me that the error state is caused when there are specs found by the Gem::SpecFetcher but none of them are compatible with the version of Rails given. This will execute #find_latest_compatible but never set the @latest_compatible_version instance variable. It's a bit confusing as there is a null object pattern being used along with a nil state and it's hard to parse the meaning behind each without more context.

I'd be happy to adjust the solution if this is more of a band-aid than a true fix.

How Has This Been Tested?

I will abide by the code of conduct

rishijain commented 1 year ago

hey @sean-dickinson thank you for the PR. :heart:

Do you mind checking the build as it is failing? I think it is due to: The safe navigation operator (&.) was added in Ruby 2.3.0.

So the spec for ruby versions below 2.3.0 are failing. Can you fix those?

rishijain commented 1 year ago

Looks good to me @sean-dickinson ! thanks for working on this. I am marking this as approved, but not merging yet for someone from the team to also look at it.

KostiantynPopovych commented 1 year ago

Hey @hmdros! May you have a quick look at this PR if you have some free time?