Skip to content

Upgrade rails to 7.2.2.2#4718

Closed
Bubballoo3 wants to merge 11 commits intomasterfrom
upgrade-rails-to-7_2_2_2-4147
Closed

Upgrade rails to 7.2.2.2#4718
Bubballoo3 wants to merge 11 commits intomasterfrom
upgrade-rails-to-7_2_2_2-4147

Conversation

@Bubballoo3
Copy link
Contributor

@Bubballoo3 Bubballoo3 commented Oct 23, 2025

Fixes #4147. Upgrades rails from 7.1.5.2 to 7.2.2.2. Several of the updated changes go from single quotes to double quotes in config files, apparently a change in Rails 7 explained in https://discuss.rubyonrails.org/t/why-rails-7-replaces-all-single-quotes-with-double-quotes-in-config/81483. This quotes from the rails git history

We’re getting rid of all single quote usage, unless it serves a specific purpose, as per the general style guide.

However this does not align with my own understanding of string formatting, where single quotes are preferred unless you need double quote features, and although this is not directly listed in our contributor guide, it is the current linting policy, as demonstrated in #4700. I included these modifications to start this conversation, but have no issue removing them (keeping single quotes) if we decide to.

Rails 7.2 also wanted to enable missing callback errors, of which we have several, so I have opened #4716 to take care of that at a future date.

I have not currently enabled any of the 7.2 config defaults, which are detailed in apps/dashboard/config/initializers/new_framework_defaults_7_2.rb, because the current defaults are being pulled from 7.0 instead of 7.1

config.load_defaults(7.0)

Bumping this to 7.1 breaks things, so we will have to sequentially enable 7.1 defaults before moving to 7.2. Since we don't have the automatically generated helper file (though it will not be hard to find) I have decided to skip this part of the update as well. As long as we do this step before updating to 8.0, we should be alright so I am comfortable delaying that until after 4.1. That helper file can be deleted if this is the consensus.

Overall, I tried to respect the incoming changes from rails and incorporate these, except in cases where this would make logs more verbose, prevent warnings, etc. If you would like to compare directly the rails changes with the ones included here, those changes have been collected in this branch comparison and are located in the branch upgrade-rails-temp.

@Bubballoo3
Copy link
Contributor Author

Bubballoo3 commented Oct 23, 2025

I thought we were ok on ruby since my dev dashboard was running 3.3, but it looks like the CI is trying to use 3.0.7 (no longer supported)

@Bubballoo3
Copy link
Contributor Author

It looks like even after updating the ruby version in the unit tests, there is a ruby version error in the ubuntu 22.04 E2E test. Strangely enough, the Setup ruby using Bundler here step shows the ruby version being 3.3.6. It still fails during the build step though, which prints

Bundler::SolveFailure: Could not find compatible versions

Because rails >= 7.2.0.beta1, < 8.0.0.beta1 depends on Ruby >= 3.1.0
  and Gemfile depends on rails = 7.2.2.2,
  Ruby >= 3.1.0 is required.
So, because current Ruby version is = 3.0.2,
  version solving has failed.

(source)
Not sure how to explain or fix this discrepancy.

@Bubballoo3
Copy link
Contributor Author

After hearing from @treydock, it looks like Ubuntu 22.04 only supports ruby 3.0, so this will effectively end support for that os. Hopefully after removing that from the CI and looking into the remaining tests that fail there won't be any big surprises

@johrstrom
Copy link
Contributor

WRT to the quoting issue, yes let's continue to use single quotes.

@johrstrom
Copy link
Contributor

After hearing from @treydock, it looks like Ubuntu 22.04 only supports ruby 3.0, so this will effectively end support for that os.

Ubuntu 22.04 has an EOL of April 2027, so I don't know if we should drop support for that OS given it's so far in the future.

The underlying ticket here is a gem dependency issue, so maybe, ultimately the fix will be to just include those gems with a comment about removing them once we can upgrade to 7.2 successfully.

@Bubballoo3
Copy link
Contributor Author

Sounds good, closing this for now and will open a new PR with the gem dependency fix.

@Bubballoo3 Bubballoo3 closed this Oct 24, 2025
@github-project-automation github-project-automation bot moved this from Awaiting Review to Merged/Closed in PR Review Pipeline Oct 24, 2025
@Bubballoo3
Copy link
Contributor Author

Bubballoo3 commented Oct 24, 2025

I will be leaving both the upgrade-rails-to-7_2_2_2-4147 and upgrade-rails-temp branches as they will be helpful when we do make the upgrade

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Gem/Ruby warnings on Dashboard start (4.0.0)

3 participants