From e02bd2ca2aedc67b258b70a7c7a8bbc8d857131a Mon Sep 17 00:00:00 2001 From: Felix Clack Date: Tue, 27 Aug 2024 10:24:37 +0100 Subject: [PATCH] Revert "Upgrade to Rails 7.2.1" This reverts commit b9f02799363a95f6b59e4c1ae3729d4599d73440. --- Gemfile | 2 +- Gemfile.lock | 134 +++++++++--------- bin/start-review-app.sh | 0 config/environments/test.rb | 2 - config/initializers/assets.rb | 7 - .../new_framework_defaults_7_2.rb | 70 --------- ..._to_active_storage_blobs.active_storage.rb | 22 --- ..._storage_variant_records.active_storage.rb | 27 ---- ...e_storage_blobs_checksum.active_storage.rb | 8 -- db/schema.rb | 2 +- 10 files changed, 70 insertions(+), 204 deletions(-) mode change 100755 => 100644 bin/start-review-app.sh delete mode 100644 config/initializers/assets.rb delete mode 100644 config/initializers/new_framework_defaults_7_2.rb delete mode 100644 db/migrate/20240822092517_add_service_name_to_active_storage_blobs.active_storage.rb delete mode 100644 db/migrate/20240822092518_create_active_storage_variant_records.active_storage.rb delete mode 100644 db/migrate/20240822092519_remove_not_null_on_active_storage_blobs_checksum.active_storage.rb diff --git a/Gemfile b/Gemfile index 6c5d6bf9..cc78174b 100644 --- a/Gemfile +++ b/Gemfile @@ -33,7 +33,7 @@ gem "pagy" gem "pg", "~> 1.5" gem "propshaft" gem "puma", "~> 6.4" -gem "rails", "~> 7.2.0" +gem "rails", "~> 7.1.3" gem "rails_semantic_logger" gem "sentry-rails", "~> 5.18" gem "sidekiq", "< 7" #7 requires Redis >6.2 which isn't available on Azure currently diff --git a/Gemfile.lock b/Gemfile.lock index 6fec6a78..7d7aeeae 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -34,58 +34,63 @@ GIT GEM remote: https://rubygems.org/ specs: - actioncable (7.2.1) - actionpack (= 7.2.1) - activesupport (= 7.2.1) + actioncable (7.1.3.4) + actionpack (= 7.1.3.4) + activesupport (= 7.1.3.4) nio4r (~> 2.0) websocket-driver (>= 0.6.1) zeitwerk (~> 2.6) - actionmailbox (7.2.1) - actionpack (= 7.2.1) - activejob (= 7.2.1) - activerecord (= 7.2.1) - activestorage (= 7.2.1) - activesupport (= 7.2.1) - mail (>= 2.8.0) - actionmailer (7.2.1) - actionpack (= 7.2.1) - actionview (= 7.2.1) - activejob (= 7.2.1) - activesupport (= 7.2.1) - mail (>= 2.8.0) + actionmailbox (7.1.3.4) + actionpack (= 7.1.3.4) + activejob (= 7.1.3.4) + activerecord (= 7.1.3.4) + activestorage (= 7.1.3.4) + activesupport (= 7.1.3.4) + mail (>= 2.7.1) + net-imap + net-pop + net-smtp + actionmailer (7.1.3.4) + actionpack (= 7.1.3.4) + actionview (= 7.1.3.4) + activejob (= 7.1.3.4) + activesupport (= 7.1.3.4) + mail (~> 2.5, >= 2.5.4) + net-imap + net-pop + net-smtp rails-dom-testing (~> 2.2) - actionpack (7.2.1) - actionview (= 7.2.1) - activesupport (= 7.2.1) + actionpack (7.1.3.4) + actionview (= 7.1.3.4) + activesupport (= 7.1.3.4) nokogiri (>= 1.8.5) racc - rack (>= 2.2.4, < 3.2) + rack (>= 2.2.4) rack-session (>= 1.0.1) rack-test (>= 0.6.3) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - useragent (~> 0.16) - actiontext (7.2.1) - actionpack (= 7.2.1) - activerecord (= 7.2.1) - activestorage (= 7.2.1) - activesupport (= 7.2.1) + actiontext (7.1.3.4) + actionpack (= 7.1.3.4) + activerecord (= 7.1.3.4) + activestorage (= 7.1.3.4) + activesupport (= 7.1.3.4) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.2.1) - activesupport (= 7.2.1) + actionview (7.1.3.4) + activesupport (= 7.1.3.4) builder (~> 3.1) erubi (~> 1.11) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - activejob (7.2.1) - activesupport (= 7.2.1) + activejob (7.1.3.4) + activesupport (= 7.1.3.4) globalid (>= 0.3.6) - activemodel (7.2.1) - activesupport (= 7.2.1) - activerecord (7.2.1) - activemodel (= 7.2.1) - activesupport (= 7.2.1) + activemodel (7.1.3.4) + activesupport (= 7.1.3.4) + activerecord (7.1.3.4) + activemodel (= 7.1.3.4) + activesupport (= 7.1.3.4) timeout (>= 0.4.0) activerecord-session_store (2.1.0) actionpack (>= 6.1) @@ -94,23 +99,22 @@ GEM multi_json (~> 1.11, >= 1.11.2) rack (>= 2.0.8, < 4) railties (>= 6.1) - activestorage (7.2.1) - actionpack (= 7.2.1) - activejob (= 7.2.1) - activerecord (= 7.2.1) - activesupport (= 7.2.1) + activestorage (7.1.3.4) + actionpack (= 7.1.3.4) + activejob (= 7.1.3.4) + activerecord (= 7.1.3.4) + activesupport (= 7.1.3.4) marcel (~> 1.0) - activesupport (7.2.1) + activesupport (7.1.3.4) base64 bigdecimal - concurrent-ruby (~> 1.0, >= 1.3.1) + concurrent-ruby (~> 1.0, >= 1.0.2) connection_pool (>= 2.2.5) drb i18n (>= 1.6, < 2) - logger (>= 1.4.2) minitest (>= 5.1) - securerandom (>= 0.3) - tzinfo (~> 2.0, >= 2.0.5) + mutex_m + tzinfo (~> 2.0) addressable (2.8.7) public_suffix (>= 2.0.2, < 7.0) aes_key_wrap (1.1.0) @@ -308,7 +312,7 @@ GEM matrix (0.4.2) method_source (1.1.0) mini_mime (1.1.5) - minitest (5.25.1) + minitest (5.25.0) msgpack (1.7.2) multi_json (1.15.0) multi_xml (0.6.0) @@ -416,20 +420,20 @@ GEM rackup (1.0.0) rack (< 3) webrick - rails (7.2.1) - actioncable (= 7.2.1) - actionmailbox (= 7.2.1) - actionmailer (= 7.2.1) - actionpack (= 7.2.1) - actiontext (= 7.2.1) - actionview (= 7.2.1) - activejob (= 7.2.1) - activemodel (= 7.2.1) - activerecord (= 7.2.1) - activestorage (= 7.2.1) - activesupport (= 7.2.1) + rails (7.1.3.4) + actioncable (= 7.1.3.4) + actionmailbox (= 7.1.3.4) + actionmailer (= 7.1.3.4) + actionpack (= 7.1.3.4) + actiontext (= 7.1.3.4) + actionview (= 7.1.3.4) + activejob (= 7.1.3.4) + activemodel (= 7.1.3.4) + activerecord (= 7.1.3.4) + activestorage (= 7.1.3.4) + activesupport (= 7.1.3.4) bundler (>= 1.15.0) - railties (= 7.2.1) + railties (= 7.1.3.4) rails-dom-testing (2.2.0) activesupport (>= 5.0.0) minitest @@ -441,10 +445,10 @@ GEM rack railties (>= 5.1) semantic_logger (~> 4.16) - railties (7.2.1) - actionpack (= 7.2.1) - activesupport (= 7.2.1) - irb (~> 1.13) + railties (7.1.3.4) + actionpack (= 7.1.3.4) + activesupport (= 7.1.3.4) + irb rackup (>= 1.0.0) rake (>= 12.2) thor (~> 1.0, >= 1.2.2) @@ -527,7 +531,6 @@ GEM rubocop (~> 1.61) ruby-progressbar (1.13.0) ruby2_keywords (0.0.5) - securerandom (0.3.1) semantic_logger (4.16.0) concurrent-ruby (~> 1.0) sentry-rails (5.18.2) @@ -609,7 +612,6 @@ GEM uber (0.1.0) unicode-display_width (2.5.0) uri (0.13.0) - useragent (0.16.10) validate_url (1.0.15) activemodel (>= 3.0.0) public_suffix @@ -684,7 +686,7 @@ DEPENDENCIES propshaft pry-nav puma (~> 6.4) - rails (~> 7.2.0) + rails (~> 7.1.3) rails_semantic_logger rladr rspec diff --git a/bin/start-review-app.sh b/bin/start-review-app.sh old mode 100755 new mode 100644 diff --git a/config/environments/test.rb b/config/environments/test.rb index c2c94cf8..749c69ba 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -49,6 +49,4 @@ config.action_mailer.delivery_method = :test config.action_mailer.default_options = { from: "mail@example.com" } config.action_mailer.default_url_options = { host: "localhost", port: 3000 } - - config.active_job.queue_adapter = :test end diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb deleted file mode 100644 index 48732442..00000000 --- a/config/initializers/assets.rb +++ /dev/null @@ -1,7 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Version of your assets, change this if you want to expire all your assets. -Rails.application.config.assets.version = "1.0" - -# Add additional assets to the asset load path. -# Rails.application.config.assets.paths << Emoji.images_path diff --git a/config/initializers/new_framework_defaults_7_2.rb b/config/initializers/new_framework_defaults_7_2.rb deleted file mode 100644 index b549c4a2..00000000 --- a/config/initializers/new_framework_defaults_7_2.rb +++ /dev/null @@ -1,70 +0,0 @@ -# Be sure to restart your server when you modify this file. -# -# This file eases your Rails 7.2 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.2`. -# -# Read the Guide for Upgrading Ruby on Rails for more info on each option. -# https://guides.rubyonrails.org/upgrading_ruby_on_rails.html - -### -# Controls whether Active Job's `#perform_later` and similar methods automatically defer -# the job queuing to after the current Active Record transaction is committed. -# -# Example: -# Topic.transaction do -# topic = Topic.create(...) -# NewTopicNotificationJob.perform_later(topic) -# end -# -# In this example, if the configuration is set to `:never`, the job will -# be enqueued immediately, even though the `Topic` hasn't been committed yet. -# Because of this, if the job is picked up almost immediately, or if the -# transaction doesn't succeed for some reason, the job will fail to find this -# topic in the database. -# -# If `enqueue_after_transaction_commit` is set to `:default`, the queue adapter -# will define the behaviour. -# -# Note: Active Job backends can disable this feature. This is generally done by -# backends that use the same database as Active Record as a queue, hence they -# don't need this feature. -#++ -# Rails.application.config.active_job.enqueue_after_transaction_commit = :default - -### -# Adds image/webp to the list of content types Active Storage considers as an image -# Prevents automatic conversion to a fallback PNG, and assumes clients support WebP, as they support gif, jpeg, and png. -# This is possible due to broad browser support for WebP, but older browsers and email clients may still not support -# WebP. Requires imagemagick/libvips built with WebP support. -#++ -# Rails.application.config.active_storage.web_image_content_types = %w[image/png image/jpeg image/gif image/webp] - -### -# Enable validation of migration timestamps. When set, an ActiveRecord::InvalidMigrationTimestampError -# will be raised if the timestamp prefix for a migration is more than a day ahead of the timestamp -# associated with the current time. This is done to prevent forward-dating of migration files, which can -# impact migration generation and other migration commands. -# -# Applications with existing timestamped migrations that do not adhere to the -# expected format can disable validation by setting this config to `false`. -#++ -# Rails.application.config.active_record.validate_migration_timestamps = true - -### -# Controls whether the PostgresqlAdapter should decode dates automatically with manual queries. -# -# Example: -# ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.select_value("select '2024-01-01'::date") #=> Date -# -# This query used to return a `String`. -#++ -# Rails.application.config.active_record.postgresql_adapter_decode_dates = true - -### -# Enables YJIT as of Ruby 3.3, to bring sizeable performance improvements. If you are -# deploying to a memory constrained environment you may want to set this to `false`. -#++ -# Rails.application.config.yjit = true diff --git a/db/migrate/20240822092517_add_service_name_to_active_storage_blobs.active_storage.rb b/db/migrate/20240822092517_add_service_name_to_active_storage_blobs.active_storage.rb deleted file mode 100644 index 0267f128..00000000 --- a/db/migrate/20240822092517_add_service_name_to_active_storage_blobs.active_storage.rb +++ /dev/null @@ -1,22 +0,0 @@ -# This migration comes from active_storage (originally 20190112182829) -class AddServiceNameToActiveStorageBlobs < ActiveRecord::Migration[6.0] - def up - return unless table_exists?(:active_storage_blobs) - - unless column_exists?(:active_storage_blobs, :service_name) - add_column :active_storage_blobs, :service_name, :string - - if (configured_service = ActiveStorage::Blob.service.name) - ActiveStorage::Blob.unscoped.update_all(service_name: configured_service) - end - - change_column :active_storage_blobs, :service_name, :string, null: false - end - end - - def down - return unless table_exists?(:active_storage_blobs) - - remove_column :active_storage_blobs, :service_name - end -end diff --git a/db/migrate/20240822092518_create_active_storage_variant_records.active_storage.rb b/db/migrate/20240822092518_create_active_storage_variant_records.active_storage.rb deleted file mode 100644 index 94ac83af..00000000 --- a/db/migrate/20240822092518_create_active_storage_variant_records.active_storage.rb +++ /dev/null @@ -1,27 +0,0 @@ -# This migration comes from active_storage (originally 20191206030411) -class CreateActiveStorageVariantRecords < ActiveRecord::Migration[6.0] - def change - return unless table_exists?(:active_storage_blobs) - - # Use Active Record's configured type for primary key - create_table :active_storage_variant_records, id: primary_key_type, if_not_exists: true do |t| - t.belongs_to :blob, null: false, index: false, type: blobs_primary_key_type - t.string :variation_digest, null: false - - t.index %i[ blob_id variation_digest ], name: "index_active_storage_variant_records_uniqueness", unique: true - t.foreign_key :active_storage_blobs, column: :blob_id - end - end - - private - def primary_key_type - config = Rails.configuration.generators - config.options[config.orm][:primary_key_type] || :primary_key - end - - def blobs_primary_key_type - pkey_name = connection.primary_key(:active_storage_blobs) - pkey_column = connection.columns(:active_storage_blobs).find { |c| c.name == pkey_name } - pkey_column.bigint? ? :bigint : pkey_column.type - end -end diff --git a/db/migrate/20240822092519_remove_not_null_on_active_storage_blobs_checksum.active_storage.rb b/db/migrate/20240822092519_remove_not_null_on_active_storage_blobs_checksum.active_storage.rb deleted file mode 100644 index 93c8b85a..00000000 --- a/db/migrate/20240822092519_remove_not_null_on_active_storage_blobs_checksum.active_storage.rb +++ /dev/null @@ -1,8 +0,0 @@ -# This migration comes from active_storage (originally 20211119233751) -class RemoveNotNullOnActiveStorageBlobsChecksum < ActiveRecord::Migration[6.0] - def change - return unless table_exists?(:active_storage_blobs) - - change_column_null(:active_storage_blobs, :checksum, true) - end -end diff --git a/db/schema.rb b/db/schema.rb index 8b2ce912..0067ea10 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.2].define(version: 2024_08_22_092519) do +ActiveRecord::Schema[7.1].define(version: 2024_07_17_113527) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql"