foreman icon indicating copy to clipboard operation
foreman copied to clipboard

Rails 7 & Ruby 3.1

Open ekohl opened this issue 3 years ago • 18 comments

This is what I had to do to get Rails 7 to at least migrate and start up on Ruby 3.1. Then I noticed https://github.com/theforeman/foreman/pull/9287 does a lot of the same work.

There's also a bunch of gem updates prepended to this which can be submitted separately. Split off PRs:

  • https://github.com/theforeman/foreman/pull/9329
  • https://github.com/theforeman/foreman/pull/9330
  • https://github.com/theforeman/foreman/pull/9331
  • https://github.com/theforeman/foreman/pull/9332
  • https://github.com/theforeman/foreman/pull/9333
  • https://github.com/theforeman/foreman/pull/9370
  • https://github.com/theforeman/foreman/pull/9371
  • https://github.com/theforeman/foreman/pull/9372
  • https://github.com/theforeman/foreman/pull/9373
  • https://github.com/theforeman/foreman/pull/9374
  • https://github.com/theforeman/foreman/pull/9376
  • https://github.com/theforeman/foreman/pull/9377
  • https://github.com/theforeman/foreman/pull/9378
  • https://github.com/theforeman/foreman/pull/9380
  • https://github.com/theforeman/foreman/pull/9381
  • https://github.com/theforeman/foreman/pull/9382 https://github.com/theforeman/foreman/pull/9748
  • https://github.com/theforeman/foreman/pull/9771
  • https://github.com/theforeman/foreman/pull/9770
  • https://github.com/theforeman/foreman/pull/10076
  • https://github.com/theforeman/foreman/pull/10140

ekohl avatar Jul 30 '22 18:07 ekohl

Issues: #32685

theforeman-bot avatar Jul 30 '22 18:07 theforeman-bot

Rebased since some preparation work was merged. No real change compared to the previous version.

My plan is to submit the gem updates after branching, which would give us a much more solid base to work on. Then we can also look at the Zeitwerk changes in more detail.

ekohl avatar Aug 02 '22 11:08 ekohl

@ekohl, this pull request is currently not mergeable. Please rebase against the develop branch and push again.

If you have a remote called 'upstream' that points to this repository, you can do this by running:

    $ git pull --rebase upstream develop

This message was auto-generated by Foreman's prprocessor

theforeman-bot avatar Aug 25 '22 10:08 theforeman-bot

@ekohl, this pull request is currently not mergeable. Please rebase against the develop branch and push again.

If you have a remote called 'upstream' that points to this repository, you can do this by running:

    $ git pull --rebase upstream develop

This message was auto-generated by Foreman's prprocessor

theforeman-bot avatar Aug 25 '22 10:08 theforeman-bot

@ekohl, this pull request is currently not mergeable. Please rebase against the develop branch and push again.

If you have a remote called 'upstream' that points to this repository, you can do this by running:

    $ git pull --rebase upstream develop

This message was auto-generated by Foreman's prprocessor

theforeman-bot avatar Aug 25 '22 10:08 theforeman-bot

@ekohl, this pull request is currently not mergeable. Please rebase against the develop branch and push again.

If you have a remote called 'upstream' that points to this repository, you can do this by running:

    $ git pull --rebase upstream develop

This message was auto-generated by Foreman's prprocessor

theforeman-bot avatar Aug 25 '22 10:08 theforeman-bot

@ekohl, this pull request is currently not mergeable. Please rebase against the develop branch and push again.

If you have a remote called 'upstream' that points to this repository, you can do this by running:

    $ git pull --rebase upstream develop

This message was auto-generated by Foreman's prprocessor

theforeman-bot avatar Aug 31 '22 11:08 theforeman-bot

This is still not ready for consumption, but since a lot of preparation work has been merged I've rebased this to make the PR a bit easier to grasp.

ekohl avatar Sep 28 '22 09:09 ekohl

Katello needs to update:

[2022-09-28T09:51:13.727Z] Bundler could not find compatible versions for gem "railties":
[2022-09-28T09:51:13.727Z]   In Gemfile:
[2022-09-28T09:51:13.727Z]     katello was resolved to 4.7.0.pre.master, which depends on
[2022-09-28T09:51:13.727Z]       angular-rails-templates (~> 1.1.0) was resolved to 1.1.0, which depends on
[2022-09-28T09:51:13.727Z]         railties (< 7, >= 4.2)
[2022-09-28T09:51:13.727Z] 
[2022-09-28T09:51:13.727Z]     rails (~> 7.0.3) was resolved to 7.0.3, which depends on
[2022-09-28T09:51:13.727Z]       railties (= 7.0.3)

Version 1.2 of that gem does support Rails 7.

ekohl avatar Sep 28 '22 09:09 ekohl

Thank you for your contribution, @ekohl! This PR has been inactive for 3 months, closing for now. Feel free to reopen when you return to it. This is an automated process.

theforeman-bot avatar Dec 29 '22 01:12 theforeman-bot

Rebased now that the Rails 6.1 defaults work has been merged.

ekohl avatar Jul 07 '23 14:07 ekohl

This now includes #9771 & #9770 but with that:

$ be rake zeitwerk:check
2023-07-07T18:37:25 [I|app|] Rails cache backend: File
2023-07-07T18:37:25 [W|app|] You are trying to replace import_subnets from . Adding allowed actions from plugin permissions to the existing one.
/home/ekohl/dev/foreman/app/models/user.rb:20: warning: already initialized constant User::ANONYMOUS_ADMIN
/home/ekohl/dev/foreman/app/models/user.rb:20: warning: previous definition of ANONYMOUS_ADMIN was here
/home/ekohl/dev/foreman/app/models/user.rb:21: warning: already initialized constant User::ANONYMOUS_API_ADMIN
/home/ekohl/dev/foreman/app/models/user.rb:21: warning: previous definition of ANONYMOUS_API_ADMIN was here
/home/ekohl/dev/foreman/app/models/user.rb:22: warning: already initialized constant User::ANONYMOUS_CONSOLE_ADMIN
/home/ekohl/dev/foreman/app/models/user.rb:22: warning: previous definition of ANONYMOUS_CONSOLE_ADMIN was here
Hold on, I am eager loading the application.

WARNING: The following directories will only be checked if you configure
them to be eager loaded:

  /home/ekohl/dev/foreman/app/models/auth_sources
  /home/ekohl/dev/foreman/app/models/compute_resources
  /home/ekohl/dev/foreman/app/models/fact_names
  /home/ekohl/dev/foreman/app/models/lookup_keys
  /home/ekohl/dev/foreman/app/models/operatingsystems
  /home/ekohl/dev/foreman/app/models/parameters
  /home/ekohl/dev/foreman/app/models/taxonomies
  /home/ekohl/dev/foreman/app/models/mail_notifications

You may verify them manually, or add them to config.eager_load_paths
in config/application.rb and run zeitwerk:check again.

Otherwise, all is good!

ekohl avatar Jul 07 '23 16:07 ekohl

Thank you for your contribution! This PR has been inactive for 3 months, closing for now. Feel free to reopen when you return to it. This is an automated process.

github-actions[bot] avatar Nov 06 '23 01:11 github-actions[bot]

Rebased to drop now irrelevant. No real changes compared to the previous one.

ekohl avatar Nov 16 '23 18:11 ekohl

Thank you for your contribution! This PR has been inactive for 3 months, closing for now. Feel free to reopen when you return to it. This is an automated process.

github-actions[bot] avatar Feb 24 '24 01:02 github-actions[bot]

Needs a rebase now that #9770 is merged, but I've opened https://github.com/theforeman/foreman/pull/10076 which is a part of the Zeitwerk work commit that's included here. To avoid continuously rebasing, I'm waiting for that to be merged.

ekohl avatar Mar 04 '24 13:03 ekohl