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

[DO NOT MERGE] APPEALS-28921 - Explore update to Rails 7.0 #23592

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

Conversation

jcroteau
Copy link
Contributor

Copy link

codeclimate bot commented Nov 21, 2024

Code Climate has analyzed commit 9f2992e and detected 0 issues on this pull request.

View more on Code Climate.

@jcroteau jcroteau force-pushed the jcroteau/APPEALS-28921-explore-update-to-rails-7-0 branch from 91a0a39 to 331fcdb Compare November 21, 2024 17:20
jcroteau and others added 26 commits November 22, 2024 12:35
We're not using the `button_to` view helper anywhere currently, so it is
safe to assume the default setting.
…ault`

We currently use `stylesheet_link_tag` in a couple templates  without passing
the `media` option, so lets preserve the preexisting behavior of this helper
for now to stay on the safe side.
…st_class`

Preserve preexisting digest class for key generators.
Preserve preexisting digest class for ActiveSupport::Digest.
…with_zone_name`

Preserve existing behavior of `ActiveSupport::TimeWithZone.name`.

This will trigger a deprecation warning, but we can kick the can down the road
and resolve this before the upgrade to Rails 7.1.
We're not using ActiveStorage, so it is safe to assume the default
for this setting.
Custom scopes on the opposite association prevent automatic identification,
as do custom scopes on an association itself unless
`config.active_record.automatic_scope_inversing` is set to `true`.

Out of an abundance of caution, let's preserve the existing behavior
for now. We can revisit this setting once the Rails upgrade is
complete with a passing test suite.
…fixtures`

Out of an abundance of caution, let's preserve the existing behavior
for now. We can revisit this setting once the Rails upgrade is
complete with a passing test suite.
Out of an abundance of caution, let's preserve the existing behavior
for now. We can revisit this setting once the Rails upgrade is
complete with a passing test suite.
…cts`

Preserve existing behavior by allowing open redirects.

At some point, we should hunt down open redirects (if there are any)
and make sure we're validating the other hosts before making
this setting `true`.
We're not using ActiveStorage, so it's safe to assume the default here.
…efault`

This setting replaces the configuration in `config/initializers/wrap_parameters.rb`.

Override the default to preserve the pre-existing behavior.
…ids`

We're not using methods `Digest::UUID.uuid_v3` or `Digest::UUID.uuid_v5`,
so it should be safe to assume the default here.
Rails 7 introduces a more optimized serialization format for caching.
The old cache entry format under Rails 6.1 will be forward compatible
with Rails 7, however, the new format under Rails 7 will not be
backward compatible with Rails 6.1.

Therefore, we should wait until the app is stable on Rails 7.0 and
there is no possibility of a rollback before we can remove this
override / assume the new default.
On Rails 7, the default for `config.action_dispatch.cookies_serializer`
is :json, so we can remove `config/initializers/cookies_serializer.rb`
as that configuration is now redundant.
…dia_type_on_content_type`

Preserve preexisting behavior of `ActionDispatch::Request#content_type`.
Once the test suite is passing on Rails 7, we can consider the default
behavior and make adjustments where necessary.
…de_hidden`

We're not currently using ActiveStorage, so it's safe to assume the default here.
Now that all necessary default overrides are in place, we can bump
`config.load_defaults` for Rails 7.
The `rails` gem doesn't depend on `sprockets-rails` anymore.
Since we still use Sprockets, we must now add it explicitly.

See https://guides.rubyonrails.org/upgrading_ruby_on_rails.html#sprockets-is-now-an-optional-dependency
@jcroteau jcroteau force-pushed the jcroteau/APPEALS-28921-explore-update-to-rails-7-0 branch from 331fcdb to c17eed9 Compare November 22, 2024 17:41
After dumping the database schemas in Rails 7, there are a few differences:

  - `ActiveRecord::Schema` is now versioned: `ActiveRecord::Schema[7.0]`
  - `t.datetime` calls with option `precision: 6` will have the `precision` option removed, as 6 is now the default.
  - `t.datetime` calls without a `precision` option specified will be given `precision: nil` (fallback to the database default)

As a precaution, DDLs were generated for both the `primary` and `etl` databases before and after this change and
were checked for differences. They were found to be identical, so this change is purely cosmetic and just brings
the schema files into alignment with the new Rails 7 conventions.
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.

1 participant