From 1ba3e7cd2091dcf4e80208cff16210802bae7e02 Mon Sep 17 00:00:00 2001 From: Brian Shand Date: Mon, 4 Nov 2024 10:49:30 +0000 Subject: [PATCH 1/8] Bump rails to 7.0.8.6 [NDRS2-2253] --- Gemfile | 10 +- Gemfile.lock | 134 ++++++++-------- config/environments/test.rb | 13 +- .../initializers/content_security_policy.rb | 6 +- .../initializers/filter_parameter_logging.rb | 4 +- .../new_framework_defaults_7_0.rb | 145 ++++++++++++++++++ db/schema.rb | 2 +- vendor/cache/actioncable-6.1.7.10.gem | Bin 42496 -> 0 bytes vendor/cache/actioncable-7.0.8.6.gem | Bin 0 -> 44544 bytes vendor/cache/actionmailbox-6.1.7.10.gem | Bin 22528 -> 0 bytes vendor/cache/actionmailbox-7.0.8.6.gem | Bin 0 -> 22528 bytes vendor/cache/actionmailer-6.1.7.10.gem | Bin 31232 -> 0 bytes vendor/cache/actionmailer-7.0.8.6.gem | Bin 0 -> 30720 bytes vendor/cache/actionpack-6.1.7.10.gem | Bin 227328 -> 0 bytes vendor/cache/actionpack-7.0.8.6.gem | Bin 0 -> 233984 bytes vendor/cache/actiontext-6.1.7.10.gem | Bin 19456 -> 0 bytes vendor/cache/actiontext-7.0.8.6.gem | Bin 0 -> 83968 bytes vendor/cache/actionview-6.1.7.10.gem | Bin 172544 -> 0 bytes vendor/cache/actionview-7.0.8.6.gem | Bin 0 -> 180224 bytes vendor/cache/activejob-6.1.7.10.gem | Bin 32768 -> 0 bytes vendor/cache/activejob-7.0.8.6.gem | Bin 0 -> 33792 bytes vendor/cache/activemodel-6.1.7.10.gem | Bin 62976 -> 0 bytes vendor/cache/activemodel-7.0.8.6.gem | Bin 0 -> 61952 bytes vendor/cache/activemodel-caution-6.1.7.6.gem | Bin 14848 -> 0 bytes vendor/cache/activemodel-caution-7.0.8.0.gem | Bin 0 -> 14848 bytes vendor/cache/activerecord-6.1.7.10.gem | Bin 434176 -> 0 bytes vendor/cache/activerecord-7.0.8.6.gem | Bin 0 -> 480256 bytes vendor/cache/activestorage-6.1.7.10.gem | Bin 58368 -> 0 bytes vendor/cache/activestorage-7.0.8.6.gem | Bin 0 -> 66560 bytes vendor/cache/activesupport-6.1.7.10.gem | Bin 221184 -> 0 bytes vendor/cache/activesupport-7.0.8.6.gem | Bin 0 -> 226816 bytes vendor/cache/rails-6.1.7.10.gem | Bin 6656 -> 0 bytes vendor/cache/rails-7.0.8.6.gem | Bin 0 -> 7168 bytes vendor/cache/railties-6.1.7.10.gem | Bin 457216 -> 0 bytes vendor/cache/railties-7.0.8.6.gem | Bin 0 -> 162304 bytes 35 files changed, 239 insertions(+), 75 deletions(-) create mode 100644 config/initializers/new_framework_defaults_7_0.rb delete mode 100644 vendor/cache/actioncable-6.1.7.10.gem create mode 100644 vendor/cache/actioncable-7.0.8.6.gem delete mode 100644 vendor/cache/actionmailbox-6.1.7.10.gem create mode 100644 vendor/cache/actionmailbox-7.0.8.6.gem delete mode 100644 vendor/cache/actionmailer-6.1.7.10.gem create mode 100644 vendor/cache/actionmailer-7.0.8.6.gem delete mode 100644 vendor/cache/actionpack-6.1.7.10.gem create mode 100644 vendor/cache/actionpack-7.0.8.6.gem delete mode 100644 vendor/cache/actiontext-6.1.7.10.gem create mode 100644 vendor/cache/actiontext-7.0.8.6.gem delete mode 100644 vendor/cache/actionview-6.1.7.10.gem create mode 100644 vendor/cache/actionview-7.0.8.6.gem delete mode 100644 vendor/cache/activejob-6.1.7.10.gem create mode 100644 vendor/cache/activejob-7.0.8.6.gem delete mode 100644 vendor/cache/activemodel-6.1.7.10.gem create mode 100644 vendor/cache/activemodel-7.0.8.6.gem delete mode 100644 vendor/cache/activemodel-caution-6.1.7.6.gem create mode 100644 vendor/cache/activemodel-caution-7.0.8.0.gem delete mode 100644 vendor/cache/activerecord-6.1.7.10.gem create mode 100644 vendor/cache/activerecord-7.0.8.6.gem delete mode 100644 vendor/cache/activestorage-6.1.7.10.gem create mode 100644 vendor/cache/activestorage-7.0.8.6.gem delete mode 100644 vendor/cache/activesupport-6.1.7.10.gem create mode 100644 vendor/cache/activesupport-7.0.8.6.gem delete mode 100644 vendor/cache/rails-6.1.7.10.gem create mode 100644 vendor/cache/rails-7.0.8.6.gem delete mode 100644 vendor/cache/railties-6.1.7.10.gem create mode 100644 vendor/cache/railties-7.0.8.6.gem diff --git a/Gemfile b/Gemfile index 267c55d4..d0f750e9 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,13 @@ source 'https://rubygems.org' -gem 'activemodel-caution', '6.1.7.6' # Supports rails ~> 6.1.7.0 -gem 'rails', '~> 6.1.0', '>= 6.1.7.5' +# The activemodel-cautions gem is ours, so not available rubygems.org. +# The .gem file is in vendor/cache - if this is lost, or the gem needs +# updating, the source (along with development instructions in the +# README) is available at: +# https://github.com/NHSDigital/activemodel-caution.git + +gem 'activemodel-caution', '7.0.8' # Supports rails ~> 7.0.8.0 +gem 'rails', '~> 7.0.4', '>= 7.0.8.1' # Use old psych for YAML on Ruby 3.1 until we move to Rails 7.0.4 # so that we can continue to use aliases in config/locales/en.yml diff --git a/Gemfile.lock b/Gemfile.lock index a13d671a..5907b9dd 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -10,71 +10,77 @@ GEM remote: https://rubygems.org/ specs: Ascii85 (1.1.0) - actioncable (6.1.7.10) - actionpack (= 6.1.7.10) - activesupport (= 6.1.7.10) + actioncable (7.0.8.6) + actionpack (= 7.0.8.6) + activesupport (= 7.0.8.6) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (6.1.7.10) - actionpack (= 6.1.7.10) - activejob (= 6.1.7.10) - activerecord (= 6.1.7.10) - activestorage (= 6.1.7.10) - activesupport (= 6.1.7.10) + actionmailbox (7.0.8.6) + actionpack (= 7.0.8.6) + activejob (= 7.0.8.6) + activerecord (= 7.0.8.6) + activestorage (= 7.0.8.6) + activesupport (= 7.0.8.6) mail (>= 2.7.1) - actionmailer (6.1.7.10) - actionpack (= 6.1.7.10) - actionview (= 6.1.7.10) - activejob (= 6.1.7.10) - activesupport (= 6.1.7.10) + net-imap + net-pop + net-smtp + actionmailer (7.0.8.6) + actionpack (= 7.0.8.6) + actionview (= 7.0.8.6) + activejob (= 7.0.8.6) + activesupport (= 7.0.8.6) mail (~> 2.5, >= 2.5.4) + net-imap + net-pop + net-smtp rails-dom-testing (~> 2.0) - actionpack (6.1.7.10) - actionview (= 6.1.7.10) - activesupport (= 6.1.7.10) - rack (~> 2.0, >= 2.0.9) + actionpack (7.0.8.6) + actionview (= 7.0.8.6) + activesupport (= 7.0.8.6) + rack (~> 2.0, >= 2.2.4) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (6.1.7.10) - actionpack (= 6.1.7.10) - activerecord (= 6.1.7.10) - activestorage (= 6.1.7.10) - activesupport (= 6.1.7.10) + actiontext (7.0.8.6) + actionpack (= 7.0.8.6) + activerecord (= 7.0.8.6) + activestorage (= 7.0.8.6) + activesupport (= 7.0.8.6) + globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (6.1.7.10) - activesupport (= 6.1.7.10) + actionview (7.0.8.6) + activesupport (= 7.0.8.6) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (6.1.7.10) - activesupport (= 6.1.7.10) + activejob (7.0.8.6) + activesupport (= 7.0.8.6) globalid (>= 0.3.6) - activemodel (6.1.7.10) - activesupport (= 6.1.7.10) - activemodel-caution (6.1.7.6) - actionpack (~> 6.1.7.0) - activemodel (~> 6.1.7.0) - activerecord (~> 6.1.7.0) - activesupport (~> 6.1.7.0) - railties (~> 6.1.7.0) - activerecord (6.1.7.10) - activemodel (= 6.1.7.10) - activesupport (= 6.1.7.10) - activestorage (6.1.7.10) - actionpack (= 6.1.7.10) - activejob (= 6.1.7.10) - activerecord (= 6.1.7.10) - activesupport (= 6.1.7.10) + activemodel (7.0.8.6) + activesupport (= 7.0.8.6) + activemodel-caution (7.0.8.0) + actionpack (~> 7.0.8.0) + activemodel (~> 7.0.8.0) + activerecord (~> 7.0.8.0) + activesupport (~> 7.0.8.0) + railties (~> 7.0.8.0) + activerecord (7.0.8.6) + activemodel (= 7.0.8.6) + activesupport (= 7.0.8.6) + activestorage (7.0.8.6) + actionpack (= 7.0.8.6) + activejob (= 7.0.8.6) + activerecord (= 7.0.8.6) + activesupport (= 7.0.8.6) marcel (~> 1.0) mini_mime (>= 1.1.0) - activesupport (6.1.7.10) + activesupport (7.0.8.6) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) tzinfo (~> 2.0) - zeitwerk (~> 2.3) addressable (2.8.5) public_suffix (>= 2.0.2, < 6.0) afm (0.2.2) @@ -381,21 +387,20 @@ GEM rack-test (2.1.0) rack (>= 1.3) railroady (1.6.0) - rails (6.1.7.10) - actioncable (= 6.1.7.10) - actionmailbox (= 6.1.7.10) - actionmailer (= 6.1.7.10) - actionpack (= 6.1.7.10) - actiontext (= 6.1.7.10) - actionview (= 6.1.7.10) - activejob (= 6.1.7.10) - activemodel (= 6.1.7.10) - activerecord (= 6.1.7.10) - activestorage (= 6.1.7.10) - activesupport (= 6.1.7.10) + rails (7.0.8.6) + actioncable (= 7.0.8.6) + actionmailbox (= 7.0.8.6) + actionmailer (= 7.0.8.6) + actionpack (= 7.0.8.6) + actiontext (= 7.0.8.6) + actionview (= 7.0.8.6) + activejob (= 7.0.8.6) + activemodel (= 7.0.8.6) + activerecord (= 7.0.8.6) + activestorage (= 7.0.8.6) + activesupport (= 7.0.8.6) bundler (>= 1.15.0) - railties (= 6.1.7.10) - sprockets-rails (>= 2.0.0) + railties (= 7.0.8.6) rails-dom-testing (2.2.0) activesupport (>= 5.0.0) minitest @@ -403,12 +408,13 @@ GEM rails-html-sanitizer (1.6.0) loofah (~> 2.21) nokogiri (~> 1.14) - railties (6.1.7.10) - actionpack (= 6.1.7.10) - activesupport (= 6.1.7.10) + railties (7.0.8.6) + actionpack (= 7.0.8.6) + activesupport (= 7.0.8.6) method_source rake (>= 12.2) thor (~> 1.0) + zeitwerk (~> 2.5) rainbow (3.1.1) rake (13.0.6) rb-fsevent (0.11.2) @@ -538,7 +544,7 @@ PLATFORMS x86_64-linux DEPENDENCIES - activemodel-caution (= 6.1.7.6) + activemodel-caution (= 7.0.8) bootstrap-table-rails (~> 1.20.2) byebug cancancan (~> 3.0) @@ -586,7 +592,7 @@ DEPENDENCIES puma-daemon rack-mini-profiler railroady - rails (~> 6.1.0, >= 6.1.7.5) + rails (~> 7.0.4, >= 7.0.8.1) rainbow regexp-examples sass-rails diff --git a/config/environments/test.rb b/config/environments/test.rb index 351bbec4..19810e36 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -25,12 +25,13 @@ config.cache_classes = true end + # Turn false under Spring and add config.action_view.cache_template_loading = true. config.cache_classes = true - # Do not eager load code on boot. This avoids loading your whole application - # just for the purpose of running a single test. If you are using a tool that - # preloads Rails for running tests, you may have to set it to true. - config.eager_load = false + # Eager loading loads your whole application. When running a single test locally, + # this probably isn't necessary. It's a good idea to do in a continuous integration + # system, or in some way before deploying your code. + config.eager_load = ENV['CI'].present? # Configure public file server for tests with Cache-Control for performance. config.public_file_server.enabled = true @@ -48,6 +49,10 @@ # Disable request forgery protection in test environment. config.action_controller.allow_forgery_protection = false + + # Store uploaded files on the local file system in a temporary directory. + # config.active_storage.service = :test + config.action_mailer.perform_caching = false # Tell Action Mailer not to deliver emails to the real world. diff --git a/config/initializers/content_security_policy.rb b/config/initializers/content_security_policy.rb index 46eec3d0..44a2dd30 100644 --- a/config/initializers/content_security_policy.rb +++ b/config/initializers/content_security_policy.rb @@ -1,8 +1,8 @@ # Be sure to restart your server when you modify this file. -# Define an application-wide content security policy -# For further information see the following documentation -# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy +# Define an application-wide content security policy. +# See the Securing Rails Applications Guide for more information: +# https://guides.rubyonrails.org/security.html#content-security-policy-header Rails.application.config.content_security_policy do |policy| # policy.default_src :self, :https diff --git a/config/initializers/filter_parameter_logging.rb b/config/initializers/filter_parameter_logging.rb index fd60d015..63d4f8be 100644 --- a/config/initializers/filter_parameter_logging.rb +++ b/config/initializers/filter_parameter_logging.rb @@ -1,6 +1,8 @@ # Be sure to restart your server when you modify this file. -# Configure sensitive parameters which will be filtered from the log file. +# Configure parameters to be filtered from the log file. Use this to limit dissemination of +# sensitive information. See the ActiveSupport::ParameterFilter documentation for supported +# notations and behaviors. Rails.application.config.filter_parameters += %i[ password passw secret token _key crypt salt certificate otp ssn ] diff --git a/config/initializers/new_framework_defaults_7_0.rb b/config/initializers/new_framework_defaults_7_0.rb new file mode 100644 index 00000000..099df580 --- /dev/null +++ b/config/initializers/new_framework_defaults_7_0.rb @@ -0,0 +1,145 @@ +# rubocop:disable Layout/LineLength, Layout/EmptyLines +# Be sure to restart your server when you modify this file. +# +# This file eases your Rails 7.0 framework defaults upgrade. +# +# Uncomment each configuration one by one to switch to the new default. +# Once your application is ready to run with all new defaults, you can remove +# this file and set the `config.load_defaults` to `7.0`. +# +# Read the Guide for Upgrading Ruby on Rails for more info on each option. +# https://guides.rubyonrails.org/upgrading_ruby_on_rails.html + +# `button_to` view helper will render `