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

Commits on Nov 22, 2024

  1. Configuration menu
    Copy the full SHA
    fe89821 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b9ebd82 View commit details
    Browse the repository at this point in the history
  3. 🔧 Assume default for config.action_view.button_to_generates_button_tag

    We're not using the `button_to` view helper anywhere currently, so it is
    safe to assume the default setting.
    jcroteau committed Nov 22, 2024
    Configuration menu
    Copy the full SHA
    5b8822f View commit details
    Browse the repository at this point in the history
  4. 🔧 Override default for `config.action_view.apply_stylesheet_media_def…

    …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.
    jcroteau committed Nov 22, 2024
    Configuration menu
    Copy the full SHA
    4875b09 View commit details
    Browse the repository at this point in the history
  5. 🔧 Override default for `config.active_support.key_generator_hash_dige…

    …st_class`
    
    Preserve preexisting digest class for key generators.
    jcroteau committed Nov 22, 2024
    Configuration menu
    Copy the full SHA
    d198831 View commit details
    Browse the repository at this point in the history
  6. 🔧 Override default for config.active_support.hash_digest_class

    Preserve preexisting digest class for ActiveSupport::Digest.
    jcroteau committed Nov 22, 2024
    Configuration menu
    Copy the full SHA
    3a726c3 View commit details
    Browse the repository at this point in the history
  7. 🔧 Override default for `config.active_support.remove_deprecated_time_…

    …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.
    jcroteau committed Nov 22, 2024
    Configuration menu
    Copy the full SHA
    a82aa1d View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    97e694a View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    754c73f View commit details
    Browse the repository at this point in the history
  10. 🔧 Assume default for config.active_storage.video_preview_arguments

    We're not using ActiveStorage, so it is safe to assume the default
    for this setting.
    jcroteau committed Nov 22, 2024
    Configuration menu
    Copy the full SHA
    0a8f171 View commit details
    Browse the repository at this point in the history
  11. 🔧 Override default for config.active_record.automatic_scope_inversing

    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.
    jcroteau committed Nov 22, 2024
    Configuration menu
    Copy the full SHA
    f194815 View commit details
    Browse the repository at this point in the history
  12. 🔧 Override default for `config.active_record.verify_foreign_keys_for_…

    …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.
    jcroteau committed Nov 22, 2024
    Configuration menu
    Copy the full SHA
    cb50a75 View commit details
    Browse the repository at this point in the history
  13. 🔧 Override default for config.active_record.partial_inserts

    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.
    jcroteau committed Nov 22, 2024
    Configuration menu
    Copy the full SHA
    0628daf View commit details
    Browse the repository at this point in the history
  14. 🔧 Override default for `config.action_controller.raise_on_open_redire…

    …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`.
    jcroteau committed Nov 22, 2024
    Configuration menu
    Copy the full SHA
    da8861c View commit details
    Browse the repository at this point in the history
  15. 🔧 Assume default for config.active_storage.variant_processor

    We're not using ActiveStorage, so it's safe to assume the default here.
    jcroteau committed Nov 22, 2024
    Configuration menu
    Copy the full SHA
    ecbc5c3 View commit details
    Browse the repository at this point in the history
  16. 🔧 Override default for `config.action_controller.wrap_parameters_by_d…

    …efault`
    
    This setting replaces the configuration in `config/initializers/wrap_parameters.rb`.
    
    Override the default to preserve the pre-existing behavior.
    jcroteau committed Nov 22, 2024
    Configuration menu
    Copy the full SHA
    e3628d6 View commit details
    Browse the repository at this point in the history
  17. 🔧 Assume default for `config.active_support.use_rfc4122_namespaced_uu…

    …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.
    jcroteau committed Nov 22, 2024
    Configuration menu
    Copy the full SHA
    9a36060 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    2f37ed9 View commit details
    Browse the repository at this point in the history
  19. 🔧 Override default for config.active_support.cache_format_version

    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.
    jcroteau committed Nov 22, 2024
    Configuration menu
    Copy the full SHA
    5d67d35 View commit details
    Browse the repository at this point in the history
  20. 🔧 Assume default for config.action_dispatch.cookies_serializer

    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.
    jcroteau committed Nov 22, 2024
    Configuration menu
    Copy the full SHA
    f4544d3 View commit details
    Browse the repository at this point in the history
  21. 🔧 Override default for `config.action_dispatch.return_only_request_me…

    …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.
    jcroteau committed Nov 22, 2024
    Configuration menu
    Copy the full SHA
    f95cced View commit details
    Browse the repository at this point in the history
  22. 🔧 Assume default for `config.active_storage.multiple_file_field_inclu…

    …de_hidden`
    
    We're not currently using ActiveStorage, so it's safe to assume the default here.
    jcroteau committed Nov 22, 2024
    Configuration menu
    Copy the full SHA
    9d37faf View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    25e2509 View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    ddd4e72 View commit details
    Browse the repository at this point in the history
  25. 🔧 Bump config.load_defaults to 7.0

    Now that all necessary default overrides are in place, we can bump
    `config.load_defaults` for Rails 7.
    jcroteau committed Nov 22, 2024
    Configuration menu
    Copy the full SHA
    70172a3 View commit details
    Browse the repository at this point in the history
  26. ➕ Add sprockets-rails dependency

    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 committed Nov 22, 2024
    Configuration menu
    Copy the full SHA
    c17eed9 View commit details
    Browse the repository at this point in the history

Commits on Nov 23, 2024

  1. ♻️ Dump DB schema files into Rails 7 format

    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.
    jcroteau committed Nov 23, 2024
    Configuration menu
    Copy the full SHA
    9f2992e View commit details
    Browse the repository at this point in the history