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

Feature: Rails 7 #1147

Merged
merged 18 commits into from
Jan 8, 2025
Merged

Feature: Rails 7 #1147

merged 18 commits into from
Jan 8, 2025

Conversation

PhilipDeFraties
Copy link
Collaborator

@PhilipDeFraties PhilipDeFraties commented Dec 20, 2024

JIRA issue link

Description - what does this code do?

Updates rails gem to 7.0

Numerous updates to various config files via app:update command.

I went through and reviewed each file updated line by line, reverting changes that needed to be kept (ie keeping the settings for redis caching in the environment config files). Many changes were just adding/updating commented instructions and examples in the config files or replacing single quotes with double.

One notable change was the adding of default precision values for timestamp columns on in the schema, which occurred automatically in the process of running the app:update command and unfortunately removed the existing precision settings that needed to be subsequently added back via migration in the second commit. Note: the va_facilities and visns tables' timestamp columns were previously set to a precision of 11 which is (and was) outside the supported range of 0-6 so I reimplemented at the max of 6. Going forward on this version of rails, any time there is an update to the schema there it will automatically add precision: nil to any timestamp column that doesn't already have it explicitly set. There is no specific place in the documentation that explains this change, the best I could find is this issue where the change is discussed.

Another change of note is the new cookie_rotator initializer added to ensure backwards compatibility with cookies generated prior to the upgrade which includes a change to the key generator from SHA1 to SHA256. The initializer implemented was taken directly from the rails upgrade documentation seen here.

Testing done - how did you test it/steps on how can another person can test it

Screenshots, Gifs, Videos from application (if applicable)

Link to mock-ups/mock ups (image file if you have it) (if applicable)

Acceptance criteria

  • [ ]

Definition of done

  • Unit tests written (if applicable)
  • e2e/accessibility tests written (if applicable)
  • Events are logged appropriately
  • Documentation has been updated, if applicable
  • A link has been provided to the originating JIRA issue
  • No sensitive information (i.e. PII/credentials/internal URLs/etc.) is captured in logging, hardcoded, or specs

@camillevilla camillevilla changed the title Upgrade spring gem in preparation for Rails 7 Feature: Rails 7 Dec 20, 2024
* Apply changes from Rails 7 app:update

- Updated configuration files to align with Rails 7 defaults, many are just updating commented examples/instructions or replacing single quotes with double.
- Updated Redis caching configuration in development and test environments.
- remove sidekiq as queue adapted in env configs
- Applied updates to logging, caching, and middleware configurations for improved performance and maintainability.
- Updated schema.rb to reflect changes introduced by Rails 7, previously set precision values removed will be added back via migration in next commit

* Reapply timestamp precision values

precision values were removed via app:update command as per rails 7 update

va_facilities and visns tables previously had precision set to 11 which is outside the supported range of 0-6, so reimplementing with the max of 6
* enable rails 7 button_to config update

* enable rails 7 config apply_stylesheet_media_default setting

* add cookie_rotator initializer as per rails 7 upgrade guide:

https://guides.rubyonrails.org/v7.0/upgrading_ruby_on_rails.html#key-generator-digest-class-changing-to-use-sha256

* update active_support.key_generator_hash_digest_class to enable SHA256 encryption

* update active_support.hash_digest_class to enable SHA256 encryption

* update active_support.remove_deprecated_time_with_zone_name config to true

* enable active_support.executor_around_test_case in default configs file

* set action_mailer.smtp_timeout in default configs file

* set config.active_storage.video_preview_arguments as per rails 7 defaults

* set config.active_record.automatic_scope_inversing as per rails 7 defaults

* set config.active_record.verify_foreign_keys_for_fixtures as per rails 7 defaults

* set config.active_record.partial_inserts as per rails 7 defaults

* set config.action_controller.raise_on_open_redirects as per rails 7 defaults

* set config.active_storage.variant_processor as per rails 7 defaults

* set config.action_controller.wrap_parameters_by_defaultas per rails 7 defaults

* set config.active_support.use_rfc4122_namespaced_uuids per rails 7 defaults

* set config.action_dispatch.default_headers per rails 7 defaults

* set config.active_support.cache_format_version per rails 7 defaults

* set config.action_dispatch.cookies_serializer per rails 7 defaults

* set config.action_dispatch.return_only_request_media_type_on_content_type per rails 7 defaults

* set config.active_storage.multiple_file_field_include_hidden as per rails 7 defaults

* set config.active_support.disable_to_s_conversion as per rails 7 defaults

* remove temporary config settings and bump config.load_defaults to 7.0

* remove new_framework_defaults_7_0 file

* add bottom blank line
@PhilipDeFraties PhilipDeFraties marked this pull request as ready for review January 7, 2025 22:50
@PhilipDeFraties PhilipDeFraties merged commit 39f2d7b into master Jan 8, 2025
3 of 5 checks passed
@PhilipDeFraties PhilipDeFraties deleted the rails-7 branch January 8, 2025 22:22
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.

2 participants