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

Add support for Rails 8.0 #2705

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Add support for Rails 8.0 #2705

wants to merge 2 commits into from

Conversation

nickcharlton
Copy link
Member

@nickcharlton
Copy link
Member Author

So far, this is just a quick first-pass at opening up support, so we can make a little bit of progress with each additional change.

As of right now, we're stuck here, as rails-i18n is missing Rails 8.0 support: svenfuchs/rails-i18n#1130

$ setup
The Gemfile's dependencies are satisfied
>> bundle check --gemfile='/Users/nickcharlton/projects/thoughtbot/administrate/gemfiles/rails60.gemfile' || bundle install --gemfile='/Users/nickcharlton/projects/thoughtbot/administrate/gemfiles/rails60.gemfile' --retry 1
The Gemfile's dependencies are satisfied
>> bundle check --gemfile='/Users/nickcharlton/projects/thoughtbot/administrate/gemfiles/rails61.gemfile' || bundle install --gemfile='/Users/nickcharlton/projects/thoughtbot/administrate/gemfiles/rails61.gemfile' --retry 1
The Gemfile's dependencies are satisfied
>> bundle check --gemfile='/Users/nickcharlton/projects/thoughtbot/administrate/gemfiles/rails70.gemfile' || bundle install --gemfile='/Users/nickcharlton/projects/thoughtbot/administrate/gemfiles/rails70.gemfile' --retry 1
The Gemfile's dependencies are satisfied
>> bundle check --gemfile='/Users/nickcharlton/projects/thoughtbot/administrate/gemfiles/rails80.gemfile' || bundle install --gemfile='/Users/nickcharlton/projects/thoughtbot/administrate/gemfiles/rails80.gemfile' --retry 1
Bundler can't satisfy your Gemfile's dependencies.
Install missing gems with `bundle install`.
Fetching gem metadata from https://rubygems.org/..........
Resolving dependencies...
Could not find compatible versions

Because rails-i18n < 0.1.6 depends on activesupport ~> 3
  and rails-i18n >= 0.1.6, < 4.0.0 depends on i18n ~> 0.5,
  rails-i18n < 4.0.0 requires activesupport ~> 3 or i18n ~> 0.5.
And because rails-i18n >= 4.0.0, < 4.0.6 depends on i18n ~> 0.6,
  rails-i18n < 4.0.6 requires activesupport ~> 3 or i18n >= 0.5, < 1.A.
And because rails-i18n >= 4.0.6, < 5.1.0 depends on i18n ~> 0.7
  and rails-i18n >= 5.1.0, < 6.0.0 depends on railties >= 5.0, < 6,
  rails-i18n < 6.0.0 requires activesupport ~> 3 or i18n >= 0.5, < 1.A or railties >= 5.0, < 6.
And because rails-i18n >= 6.0.0, < 7.0.1 depends on railties >= 6.0.0, < 7
  and activesupport >= 6.1.0 depends on i18n >= 1.6, < 2,
  if activesupport >= 6.1.0 and rails-i18n < 7.0.1 then railties >= 5.0, < 7.
And because rails-i18n >= 7.0.1 depends on railties >= 6.0.0, < 8
  and rails >= 8.0.0 depends on activesupport = 8.0.0,
  rails >= 8.0.0 requires railties >= 5.0, < 8.
So, because rails >= 8.0.0 depends on railties = 8.0.0
  and rails80.gemfile depends on rails ~> 8.0,
  version solving has failed.

@mpvosseller
Copy link

@nickcharlton looks like the rails-i18n gem has been updated & released. 🎉

@nickcharlton
Copy link
Member Author

With rails-i18n released, I've been able to run through and do a bunch more of the Rails 8.0 upgrade.

I've done a bunch of it, now I'm going to wait for CI to fail and see what else we need to do.

@nickcharlton
Copy link
Member Author

I'm left fighting with Ruby, Rails versions and testing the combination along with Appraisal on CI.

However, those are details in the scheme of getting this PR merged. If someone would like to test it out on their Rails 8.0 upgrade, feel free to go ahead — I'd be especially interested if there are any issues you see which might mean this takes longer than getting CI right.

We needed to:

* Bring over quite a few things from `rails app:update`, which hopefully
  should make future upgrades easier,
* Fix a change to the `enum` `ActiveModel` signature, which changed
  between Rails 6.0 and 7.0,
* Add a version check from 7.0 for `raise_on_missing_callback_actions`

https://rubyonrails.org/2024/11/7/rails-8-no-paas-required

Closes #2703
@nickcharlton
Copy link
Member Author

I'd started down the path of messing about with running Appraisals differently, because it was failing for various reasons. But remembered I'd actually started on this back in Feb as #2524.

I've now merged that, so we're back in Ruby vs. Rails expected compatibility.

It's time to drop some Ruby versions ahead of cutting the final version of v1, but unless this takes longer than today, I'd like to do that after this PR is merged. We'll see how it goes.

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.

Rails 8.0 support
2 participants