From e4e583b2aebf4939bb5c2fd8179c8451d92782b2 Mon Sep 17 00:00:00 2001 From: Nick Pezza Date: Thu, 30 May 2024 15:24:13 -0400 Subject: [PATCH] Support rails 7.2 and update gemfiles --- .github/workflows/main.yml | 4 +- Appraisals | 4 + app/models/solid_cache/entry.rb | 2 +- gemfiles/rails_7_2.gemfile | 21 ++ gemfiles/rails_7_2.gemfile.lock | 232 ++++++++++++++++++ gemfiles/rails_main.gemfile.lock | 112 ++++----- .../cache_store_compression_behavior.rb | 5 - .../cache_store_format_version_behavior.rb | 12 +- .../cache_store_compression_behavior.rb | 5 - .../cache_store_format_version_behavior.rb | 12 +- 10 files changed, 319 insertions(+), 90 deletions(-) create mode 100644 gemfiles/rails_7_2.gemfile create mode 100644 gemfiles/rails_7_2.gemfile.lock diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 114e778..42dde80 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -27,8 +27,8 @@ jobs: strategy: fail-fast: false matrix: - ruby-version: ["3.0", "3.1", "3.2", "3.3"] - gemfile: [ rails_7, rails_7_1, rails_main ] + ruby-version: ["3.1", "3.2", "3.3"] + gemfile: [ rails_7, rails_7_1, rails_7_2, rails_main ] database: [sqlite, postgres, mysql] exclude: - ruby-version: "3.0" diff --git a/Appraisals b/Appraisals index 857d069..95e6247 100644 --- a/Appraisals +++ b/Appraisals @@ -8,6 +8,10 @@ appraise "rails-7-1" do gem "railties", github: "rails/rails", branch: "7-1-stable" end +appraise "rails-7-2" do + gem "railties", github: "rails/rails", branch: "7-2-stable" +end + appraise "rails-main" do gem "railties", github: "rails/rails", branch: "main" end diff --git a/app/models/solid_cache/entry.rb b/app/models/solid_cache/entry.rb index a3d3752..a21ad85 100644 --- a/app/models/solid_cache/entry.rb +++ b/app/models/solid_cache/entry.rb @@ -66,7 +66,7 @@ def id_range private def upsert_all_no_query_cache(payloads) - args = [ self, + args = [ self.all, connection_for_insert_all, add_key_hash_and_byte_size(payloads) ].compact options = { unique_by: upsert_unique_by, diff --git a/gemfiles/rails_7_2.gemfile b/gemfiles/rails_7_2.gemfile new file mode 100644 index 0000000..6ac62ce --- /dev/null +++ b/gemfiles/rails_7_2.gemfile @@ -0,0 +1,21 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "sqlite3" +gem "mysql2" +gem "pg" +gem "sprockets-rails" +gem "appraisal" +gem "railties", branch: "7-2-stable", git: "https://github.com/rails/rails.git" + +group :rubocop do + gem "rubocop", ">= 1.25.1", require: false + gem "rubocop-minitest", require: false + gem "rubocop-packaging", require: false + gem "rubocop-performance", require: false + gem "rubocop-rails", require: false + gem "rubocop-md", require: false +end + +gemspec path: "../" diff --git a/gemfiles/rails_7_2.gemfile.lock b/gemfiles/rails_7_2.gemfile.lock new file mode 100644 index 0000000..9d5e7ea --- /dev/null +++ b/gemfiles/rails_7_2.gemfile.lock @@ -0,0 +1,232 @@ +GIT + remote: https://github.com/rails/rails.git + revision: c3eaf8707dd988ecfeb6bc5a8e6c2f2677a8356d + branch: 7-2-stable + specs: + actionpack (7.2.0.beta1) + actionview (= 7.2.0.beta1) + activesupport (= 7.2.0.beta1) + nokogiri (>= 1.8.5) + racc + 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) + actionview (7.2.0.beta1) + activesupport (= 7.2.0.beta1) + builder (~> 3.1) + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + activejob (7.2.0.beta1) + activesupport (= 7.2.0.beta1) + globalid (>= 0.3.6) + activemodel (7.2.0.beta1) + activesupport (= 7.2.0.beta1) + activerecord (7.2.0.beta1) + activemodel (= 7.2.0.beta1) + activesupport (= 7.2.0.beta1) + timeout (>= 0.4.0) + activesupport (7.2.0.beta1) + base64 + bigdecimal + concurrent-ruby (~> 1.0, >= 1.3.1) + connection_pool (>= 2.2.5) + drb + i18n (>= 1.6, < 2) + minitest (>= 5.1) + tzinfo (~> 2.0, >= 2.0.5) + railties (7.2.0.beta1) + actionpack (= 7.2.0.beta1) + activesupport (= 7.2.0.beta1) + irb (~> 1.13) + rackup (>= 1.0.0) + rake (>= 12.2) + thor (~> 1.0, >= 1.2.2) + zeitwerk (~> 2.6) + +PATH + remote: .. + specs: + solid_cache (0.6.0) + activejob (>= 7) + activerecord (>= 7) + railties (>= 7) + +GEM + remote: https://rubygems.org/ + specs: + appraisal (2.5.0) + bundler + rake + thor (>= 0.14.0) + ast (2.4.2) + base64 (0.2.0) + bigdecimal (3.1.8) + builder (3.2.4) + concurrent-ruby (1.3.1) + connection_pool (2.4.1) + crass (1.0.6) + debug (1.9.2) + irb (~> 1.10) + reline (>= 0.3.8) + drb (2.2.1) + erubi (1.12.0) + globalid (1.2.1) + activesupport (>= 6.1) + i18n (1.14.5) + concurrent-ruby (~> 1.0) + io-console (0.7.2) + irb (1.13.1) + rdoc (>= 4.0.0) + reline (>= 0.4.2) + json (2.7.2) + language_server-protocol (3.17.0.3) + loofah (2.22.0) + crass (~> 1.0.2) + nokogiri (>= 1.12.0) + minitest (5.23.1) + mocha (2.3.0) + ruby2_keywords (>= 0.0.5) + msgpack (1.7.2) + mysql2 (0.5.6) + nokogiri (1.16.5-aarch64-linux) + racc (~> 1.4) + nokogiri (1.16.5-arm-linux) + racc (~> 1.4) + nokogiri (1.16.5-arm64-darwin) + racc (~> 1.4) + nokogiri (1.16.5-x86-linux) + racc (~> 1.4) + nokogiri (1.16.5-x86_64-darwin) + racc (~> 1.4) + nokogiri (1.16.5-x86_64-linux) + racc (~> 1.4) + parallel (1.24.0) + parser (3.3.2.0) + ast (~> 2.4.1) + racc + pg (1.5.6) + psych (5.1.2) + stringio + racc (1.8.0) + rack (3.0.11) + rack-session (2.0.0) + rack (>= 3.0.0) + rack-test (2.1.0) + rack (>= 1.3) + rackup (2.1.0) + rack (>= 3) + webrick (~> 1.8) + rails-dom-testing (2.2.0) + activesupport (>= 5.0.0) + minitest + nokogiri (>= 1.6) + rails-html-sanitizer (1.6.0) + loofah (~> 2.21) + nokogiri (~> 1.14) + rainbow (3.1.1) + rake (13.2.1) + rdoc (6.7.0) + psych (>= 4.0.0) + regexp_parser (2.9.2) + reline (0.5.8) + io-console (~> 0.5) + rexml (3.2.8) + strscan (>= 3.0.9) + rubocop (1.64.0) + json (~> 2.3) + language_server-protocol (>= 3.17.0) + parallel (~> 1.10) + parser (>= 3.3.0.2) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.8, < 3.0) + rexml (>= 3.2.5, < 4.0) + rubocop-ast (>= 1.31.1, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.31.3) + parser (>= 3.3.1.0) + rubocop-md (1.2.2) + rubocop (>= 1.0) + rubocop-minitest (0.35.0) + rubocop (>= 1.61, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) + rubocop-packaging (0.5.2) + rubocop (>= 1.33, < 2.0) + rubocop-performance (1.21.0) + rubocop (>= 1.48.1, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) + rubocop-rails (2.25.0) + activesupport (>= 4.2.0) + rack (>= 1.1) + rubocop (>= 1.33.0, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) + ruby-progressbar (1.13.0) + ruby2_keywords (0.0.5) + sprockets (4.2.1) + concurrent-ruby (~> 1.0) + rack (>= 2.2.4, < 4) + sprockets-rails (3.4.2) + actionpack (>= 5.2) + activesupport (>= 5.2) + sprockets (>= 3.0.0) + sqlite3 (2.0.2-aarch64-linux-gnu) + sqlite3 (2.0.2-aarch64-linux-musl) + sqlite3 (2.0.2-arm-linux-gnu) + sqlite3 (2.0.2-arm-linux-musl) + sqlite3 (2.0.2-arm64-darwin) + sqlite3 (2.0.2-x86-linux-gnu) + sqlite3 (2.0.2-x86-linux-musl) + sqlite3 (2.0.2-x86_64-darwin) + sqlite3 (2.0.2-x86_64-linux-gnu) + sqlite3 (2.0.2-x86_64-linux-musl) + stringio (3.1.0) + strscan (3.1.0) + thor (1.3.1) + timeout (0.4.1) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + unicode-display_width (2.5.0) + useragent (0.16.10) + webrick (1.8.1) + zeitwerk (2.6.15) + +PLATFORMS + aarch64-linux + aarch64-linux-gnu + aarch64-linux-musl + arm-linux + arm-linux-gnu + arm-linux-musl + arm64-darwin + x86-linux + x86-linux-gnu + x86-linux-musl + x86_64-darwin + x86_64-linux + x86_64-linux-gnu + x86_64-linux-musl + +DEPENDENCIES + appraisal + debug + mocha + msgpack + mysql2 + pg + railties! + rubocop (>= 1.25.1) + rubocop-md + rubocop-minitest + rubocop-packaging + rubocop-performance + rubocop-rails + solid_cache! + sprockets-rails + sqlite3 + +BUNDLED WITH + 2.5.9 diff --git a/gemfiles/rails_main.gemfile.lock b/gemfiles/rails_main.gemfile.lock index 25fdd97..fc684f0 100644 --- a/gemfiles/rails_main.gemfile.lock +++ b/gemfiles/rails_main.gemfile.lock @@ -1,11 +1,11 @@ GIT remote: https://github.com/rails/rails.git - revision: 029d31ca31ab72df7bb79372f4ff057231fd0196 + revision: ea0f0a2c964659aa2f9ead9ba999f53a6cc39366 branch: main specs: - actionpack (7.2.0.alpha) - actionview (= 7.2.0.alpha) - activesupport (= 7.2.0.alpha) + actionpack (8.0.0.alpha) + actionview (= 8.0.0.alpha) + activesupport (= 8.0.0.alpha) nokogiri (>= 1.8.5) racc rack (>= 2.2.4) @@ -14,34 +14,34 @@ GIT rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) useragent (~> 0.16) - actionview (7.2.0.alpha) - activesupport (= 7.2.0.alpha) + actionview (8.0.0.alpha) + activesupport (= 8.0.0.alpha) builder (~> 3.1) erubi (~> 1.11) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - activejob (7.2.0.alpha) - activesupport (= 7.2.0.alpha) + activejob (8.0.0.alpha) + activesupport (= 8.0.0.alpha) globalid (>= 0.3.6) - activemodel (7.2.0.alpha) - activesupport (= 7.2.0.alpha) - activerecord (7.2.0.alpha) - activemodel (= 7.2.0.alpha) - activesupport (= 7.2.0.alpha) + activemodel (8.0.0.alpha) + activesupport (= 8.0.0.alpha) + activerecord (8.0.0.alpha) + activemodel (= 8.0.0.alpha) + activesupport (= 8.0.0.alpha) timeout (>= 0.4.0) - activesupport (7.2.0.alpha) + activesupport (8.0.0.alpha) base64 bigdecimal - concurrent-ruby (~> 1.0, >= 1.0.2) + concurrent-ruby (~> 1.0, >= 1.3.1) connection_pool (>= 2.2.5) drb i18n (>= 1.6, < 2) - minitest (>= 5.1, < 5.22.0) + minitest (>= 5.1) tzinfo (~> 2.0, >= 2.0.5) - railties (7.2.0.alpha) - actionpack (= 7.2.0.alpha) - activesupport (= 7.2.0.alpha) - irb + railties (8.0.0.alpha) + actionpack (= 8.0.0.alpha) + activesupport (= 8.0.0.alpha) + irb (~> 1.13) rackup (>= 1.0.0) rake (>= 12.2) thor (~> 1.0, >= 1.2.2) @@ -64,49 +64,49 @@ GEM thor (>= 0.14.0) ast (2.4.2) base64 (0.2.0) - bigdecimal (3.1.6) + bigdecimal (3.1.8) builder (3.2.4) - concurrent-ruby (1.2.3) + concurrent-ruby (1.3.1) connection_pool (2.4.1) crass (1.0.6) - debug (1.9.1) + debug (1.9.2) irb (~> 1.10) reline (>= 0.3.8) drb (2.2.1) erubi (1.12.0) globalid (1.2.1) activesupport (>= 6.1) - i18n (1.14.4) + i18n (1.14.5) concurrent-ruby (~> 1.0) io-console (0.7.2) - irb (1.12.0) - rdoc + irb (1.13.1) + rdoc (>= 4.0.0) reline (>= 0.4.2) - json (2.7.1) + json (2.7.2) language_server-protocol (3.17.0.3) loofah (2.22.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) - minitest (5.21.2) - mocha (2.1.0) + minitest (5.23.1) + mocha (2.3.0) ruby2_keywords (>= 0.0.5) msgpack (1.7.2) - mysql2 (0.5.5) - nokogiri (1.16.2-arm64-darwin) + mysql2 (0.5.6) + nokogiri (1.16.5-arm64-darwin) racc (~> 1.4) - nokogiri (1.16.2-x86_64-darwin) + nokogiri (1.16.5-x86_64-darwin) racc (~> 1.4) - nokogiri (1.16.2-x86_64-linux) + nokogiri (1.16.5-x86_64-linux) racc (~> 1.4) parallel (1.24.0) - parser (3.3.0.5) + parser (3.3.2.0) ast (~> 2.4.1) racc pg (1.5.6) psych (5.1.2) stringio - racc (1.7.3) - rack (3.0.9.1) + racc (1.8.0) + rack (3.0.11) rack-session (2.0.0) rack (>= 3.0.0) rack-test (2.1.0) @@ -122,14 +122,15 @@ GEM loofah (~> 2.21) nokogiri (~> 1.14) rainbow (3.1.1) - rake (13.1.0) - rdoc (6.6.2) + rake (13.2.1) + rdoc (6.7.0) psych (>= 4.0.0) - regexp_parser (2.9.0) - reline (0.4.3) + regexp_parser (2.9.2) + reline (0.5.8) io-console (~> 0.5) - rexml (3.2.6) - rubocop (1.62.0) + rexml (3.2.8) + strscan (>= 3.0.9) + rubocop (1.64.0) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) @@ -140,19 +141,19 @@ GEM rubocop-ast (>= 1.31.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.31.2) - parser (>= 3.3.0.4) + rubocop-ast (1.31.3) + parser (>= 3.3.1.0) rubocop-md (1.2.2) rubocop (>= 1.0) - rubocop-minitest (0.34.5) - rubocop (>= 1.39, < 2.0) - rubocop-ast (>= 1.30.0, < 2.0) + rubocop-minitest (0.35.0) + rubocop (>= 1.61, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) rubocop-packaging (0.5.2) rubocop (>= 1.33, < 2.0) - rubocop-performance (1.20.2) + rubocop-performance (1.21.0) rubocop (>= 1.48.1, < 2.0) - rubocop-ast (>= 1.30.0, < 2.0) - rubocop-rails (2.24.0) + rubocop-ast (>= 1.31.1, < 2.0) + rubocop-rails (2.25.0) activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 1.33.0, < 2.0) @@ -166,10 +167,11 @@ GEM actionpack (>= 5.2) activesupport (>= 5.2) sprockets (>= 3.0.0) - sqlite3 (1.7.2-arm64-darwin) - sqlite3 (1.7.2-x86_64-darwin) - sqlite3 (1.7.2-x86_64-linux) + sqlite3 (2.0.2-arm64-darwin) + sqlite3 (2.0.2-x86_64-darwin) + sqlite3 (2.0.2-x86_64-linux-gnu) stringio (3.1.0) + strscan (3.1.0) thor (1.3.1) timeout (0.4.1) tzinfo (2.0.6) @@ -177,7 +179,7 @@ GEM unicode-display_width (2.5.0) useragent (0.16.10) webrick (1.8.1) - zeitwerk (2.6.13) + zeitwerk (2.6.15) PLATFORMS arm64-darwin-21 @@ -206,4 +208,4 @@ DEPENDENCIES sqlite3 BUNDLED WITH - 2.3.26 + 2.5.9 diff --git a/test/unit/behaviors/cache_store_compression_behavior.rb b/test/unit/behaviors/cache_store_compression_behavior.rb index 02df1ac..870b3f3 100644 --- a/test/unit/behaviors/cache_store_compression_behavior.rb +++ b/test/unit/behaviors/cache_store_compression_behavior.rb @@ -7,11 +7,6 @@ module CacheStoreCompressionBehavior extend ActiveSupport::Concern included do - test "compression works with cache format version 6.1 (using Marshal61WithFallback)" do - @cache = with_format(6.1) { lookup_store(compress: true) } - assert_compression true - end - test "compression works with cache format version 7.0 (using Marshal70WithFallback)" do @cache = with_format(7.0) { lookup_store(compress: true) } assert_compression true diff --git a/test/unit/behaviors/cache_store_format_version_behavior.rb b/test/unit/behaviors/cache_store_format_version_behavior.rb index bf23d45..9f9d80e 100644 --- a/test/unit/behaviors/cache_store_format_version_behavior.rb +++ b/test/unit/behaviors/cache_store_format_version_behavior.rb @@ -6,10 +6,6 @@ module CacheStoreFormatVersionBehavior extend ActiveSupport::Concern FORMAT_VERSION_SIGNATURES = { - 6.1 => [ - "\x04\x08o".b, # Marshal.dump(entry) - "\x04\x08o".b, # Marshal.dump(entry.compressed(...)) - ], 7.0 => [ "\x00\x04\x08[".b, # "\x00" + Marshal.dump(entry.pack) "\x01\x78".b, # "\x01" + Zlib::Deflate.deflate(...) @@ -121,12 +117,6 @@ module CacheStoreFormatVersionBehavior private def with_format(format_version, &block) - if format_version == 6.1 - assert_deprecated(ActiveSupport.deprecator) do - ActiveSupport::Cache.with(format_version: format_version, &block) - end - else - ActiveSupport::Cache.with(format_version: format_version, &block) - end + ActiveSupport::Cache.with(format_version: format_version, &block) end end diff --git a/test/unit/behaviors_rails_7_1/cache_store_compression_behavior.rb b/test/unit/behaviors_rails_7_1/cache_store_compression_behavior.rb index 02df1ac..870b3f3 100644 --- a/test/unit/behaviors_rails_7_1/cache_store_compression_behavior.rb +++ b/test/unit/behaviors_rails_7_1/cache_store_compression_behavior.rb @@ -7,11 +7,6 @@ module CacheStoreCompressionBehavior extend ActiveSupport::Concern included do - test "compression works with cache format version 6.1 (using Marshal61WithFallback)" do - @cache = with_format(6.1) { lookup_store(compress: true) } - assert_compression true - end - test "compression works with cache format version 7.0 (using Marshal70WithFallback)" do @cache = with_format(7.0) { lookup_store(compress: true) } assert_compression true diff --git a/test/unit/behaviors_rails_7_1/cache_store_format_version_behavior.rb b/test/unit/behaviors_rails_7_1/cache_store_format_version_behavior.rb index ba2a192..04da6f6 100644 --- a/test/unit/behaviors_rails_7_1/cache_store_format_version_behavior.rb +++ b/test/unit/behaviors_rails_7_1/cache_store_format_version_behavior.rb @@ -6,10 +6,6 @@ module CacheStoreFormatVersionBehavior extend ActiveSupport::Concern FORMAT_VERSION_SIGNATURES = { - 6.1 => [ - "\x04\x08o".b, # Marshal.dump(entry) - "\x04\x08o".b, # Marshal.dump(entry.compressed(...)) - ], 7.0 => [ "\x00\x04\x08[".b, # "\x00" + Marshal.dump(entry.pack) "\x01\x78".b, # "\x01" + Zlib::Deflate.deflate(...) @@ -121,12 +117,6 @@ module CacheStoreFormatVersionBehavior private def with_format(format_version, &block) - if format_version == 6.1 - assert_deprecated(ActiveSupport.deprecator) do - ActiveSupport::Cache.with(format_version: format_version, &block) - end - else - ActiveSupport::Cache.with(format_version: format_version, &block) - end + ActiveSupport::Cache.with(format_version: format_version, &block) end end