govuk-infrastructure icon indicating copy to clipboard operation
govuk-infrastructure copied to clipboard

Upgrade our apps to rails 7.2

Open AgaDufrat opened this issue 5 months ago • 0 comments

How

https://guides.rubyonrails.org/upgrading_ruby_on_rails.html#upgrading-from-rails-7-1-to-rails-7-2

  • Run rails app:update command and review changes
  • Use 7.2 defaults
  • Fix deprecation warnings
### Tasks
- [ ] https://github.com/alphagov/support-api/pull/1054
- [ ] Content Data Admin
- [ ] Content Data API
- [ ] Release
- [ ] Support

Suggested steps we followed for Rails 7.0 upgrades

  1. Update Rails version
  • Run rails app:update and accept all changes (press a).
  • Run rubocop -A to auto-fix any stylistic differences between the Rails defaults and our linter rules.
  • Review in git and keep/discard changes as appropriate.
  • Try to retain any config values that seem to have been set for a reason, while keeping new values that replace old defaults. Git blame is helpful here – for example to determine if particular lines were set for a reason, or if they haven’t been touched since the codebase was first generated.
  • Run the test suite to make sure it still passes – ignore deprecation notices, we'll fix them in the next step.
  • Commit changes: git commit -am "Run rails app:update"
  1. Fix deprecation notices
  • Run the test suite and look out for deprecation notices shown in the console.
  • Fix all deprecations. Note that some deprecations may come from other GOV.UK gems, which will need to be resolved in a separate piece of work. It's worth taking a note of them, though, as they can be turned into Trello cards.
  • Commit changes: git commit -am "Fix deprecation notices"

AgaDufrat avatar Sep 12 '24 09:09 AgaDufrat