From d7e652a106997a2390db28f2a8416169923a3fa7 Mon Sep 17 00:00:00 2001 From: Stephen Nelson Date: Mon, 16 Sep 2024 15:27:09 +0930 Subject: [PATCH 1/6] Churn: update dependencies --- .ruby-version | 2 +- Gemfile.lock | 68 +++++++++-------- yarn.lock | 202 +++++++++++++++++++++++++------------------------- 3 files changed, 135 insertions(+), 137 deletions(-) diff --git a/.ruby-version b/.ruby-version index a0891f5..fa7adc7 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.3.4 +3.3.5 diff --git a/Gemfile.lock b/Gemfile.lock index ddf8c07..4755623 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -134,7 +134,7 @@ GEM rubocop (>= 1) smart_properties erubi (1.13.0) - factory_bot (6.4.6) + factory_bot (6.5.0) activesupport (>= 5.0.0) factory_bot_rails (6.4.3) factory_bot (~> 6.4) @@ -150,15 +150,15 @@ GEM ffi (1.17.0-x86_64-linux-gnu) globalid (1.2.1) activesupport (>= 6.1) - google-protobuf (4.27.3-arm64-darwin) + google-protobuf (4.28.1-arm64-darwin) bigdecimal rake (>= 13) - google-protobuf (4.27.3-x86_64-linux) + google-protobuf (4.28.1-x86_64-linux) bigdecimal rake (>= 13) html-attributes-utils (1.0.2) activesupport (>= 6.1.4.4) - i18n (1.14.5) + i18n (1.14.6) concurrent-ruby (~> 1.0) image_processing (1.13.0) mini_magick (>= 4.9.5, < 5) @@ -183,7 +183,7 @@ GEM katalyst-html-attributes view_component language_server-protocol (3.17.0.3) - logger (1.6.0) + logger (1.6.1) loofah (2.22.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) @@ -199,7 +199,7 @@ GEM mini_mime (1.1.5) minitest (5.25.1) mutex_m (0.2.0) - net-imap (0.4.14) + net-imap (0.4.16) date net-protocol net-pop (0.1.2) @@ -214,10 +214,10 @@ GEM nokogiri (1.16.7-x86_64-linux) racc (~> 1.4) parallel (1.26.3) - parser (3.3.4.2) + parser (3.3.5.0) ast (~> 2.4.1) racc - propshaft (0.9.1) + propshaft (1.0.0) actionpack (>= 7.0.0) activesupport (>= 7.0.0) rack @@ -274,45 +274,44 @@ GEM rdoc (6.7.0) psych (>= 4.0.0) regexp_parser (2.9.2) - reline (0.5.9) + reline (0.5.10) io-console (~> 0.5) - rexml (3.3.6) - strscan - rspec-core (3.13.0) + rexml (3.3.7) + rspec-core (3.13.1) rspec-support (~> 3.13.0) - rspec-expectations (3.13.2) + rspec-expectations (3.13.3) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) rspec-mocks (3.13.1) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) - rspec-rails (6.1.4) - actionpack (>= 6.1) - activesupport (>= 6.1) - railties (>= 6.1) + rspec-rails (7.0.1) + actionpack (>= 7.0) + activesupport (>= 7.0) + railties (>= 7.0) rspec-core (~> 3.13) rspec-expectations (~> 3.13) rspec-mocks (~> 3.13) rspec-support (~> 3.13) rspec-support (3.13.1) - rubocop (1.65.1) + rubocop (1.66.1) 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 (>= 2.4, < 3.0) - rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.31.1, < 2.0) + rubocop-ast (>= 1.32.2, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.32.1) + rubocop-ast (1.32.3) parser (>= 3.3.1.0) rubocop-capybara (2.21.0) rubocop (~> 1.41) rubocop-factory_bot (2.26.1) rubocop (~> 1.61) - rubocop-katalyst (2.0.5) + rubocop-katalyst (2.1.0) + rexml rubocop rubocop-capybara rubocop-factory_bot @@ -324,14 +323,14 @@ GEM rubocop-performance (1.21.1) rubocop (>= 1.48.1, < 2.0) rubocop-ast (>= 1.31.1, < 2.0) - rubocop-rails (2.26.0) + rubocop-rails (2.26.1) activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 1.52.0, < 2.0) rubocop-ast (>= 1.31.1, < 2.0) rubocop-rake (0.6.0) rubocop (~> 1.0) - rubocop-rspec (3.0.4) + rubocop-rspec (3.0.5) rubocop (~> 1.61) rubocop-rspec_rails (2.30.0) rubocop (~> 1.61) @@ -340,10 +339,10 @@ GEM ruby-vips (2.2.2) ffi (~> 1.12) logger - sass-embedded (1.77.8-arm64-darwin) - google-protobuf (~> 4.26) - sass-embedded (1.77.8-x86_64-linux-gnu) - google-protobuf (~> 4.26) + sass-embedded (1.78.0-arm64-darwin) + google-protobuf (~> 4.27) + sass-embedded (1.78.0-x86_64-linux-gnu) + google-protobuf (~> 4.27) shoulda-matchers (6.4.0) activesupport (>= 5.2.0) smart_properties (1.17.0) @@ -352,17 +351,16 @@ GEM stimulus-rails (1.3.4) railties (>= 6.0.0) stringio (3.1.1) - strscan (3.1.0) - thor (1.3.1) + thor (1.3.2) timeout (0.4.1) - turbo-rails (2.0.6) + turbo-rails (2.0.7) actionpack (>= 6.0.0) activejob (>= 6.0.0) railties (>= 6.0.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unicode-display_width (2.5.0) - view_component (3.13.0) + unicode-display_width (2.6.0) + view_component (3.14.0) activesupport (>= 5.2.0, < 8.0) concurrent-ruby (~> 1.0) method_source (~> 1.0) @@ -372,7 +370,7 @@ GEM websocket-extensions (0.1.5) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.6.17) + zeitwerk (2.6.18) PLATFORMS arm64-darwin-20 @@ -410,4 +408,4 @@ DEPENDENCIES turbo-rails BUNDLED WITH - 2.5.17 + 2.5.18 diff --git a/yarn.lock b/yarn.lock index 44a792d..b5b113c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -72,85 +72,85 @@ estree-walker "^2.0.2" picomatch "^2.3.1" -"@rollup/rollup-android-arm-eabi@4.21.0": - version "4.21.0" - resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.21.0.tgz#d941173f82f9b041c61b0dc1a2a91dcd06e4b31e" - integrity sha512-WTWD8PfoSAJ+qL87lE7votj3syLavxunWhzCnx3XFxFiI/BA/r3X7MUM8dVrH8rb2r4AiO8jJsr3ZjdaftmnfA== - -"@rollup/rollup-android-arm64@4.21.0": - version "4.21.0" - resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.21.0.tgz#7e7157c8543215245ceffc445134d9e843ba51c0" - integrity sha512-a1sR2zSK1B4eYkiZu17ZUZhmUQcKjk2/j9Me2IDjk1GHW7LB5Z35LEzj9iJch6gtUfsnvZs1ZNyDW2oZSThrkA== - -"@rollup/rollup-darwin-arm64@4.21.0": - version "4.21.0" - resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.21.0.tgz#f0a18a4fc8dc6eb1e94a51fa2adb22876f477947" - integrity sha512-zOnKWLgDld/svhKO5PD9ozmL6roy5OQ5T4ThvdYZLpiOhEGY+dp2NwUmxK0Ld91LrbjrvtNAE0ERBwjqhZTRAA== - -"@rollup/rollup-darwin-x64@4.21.0": - version "4.21.0" - resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.21.0.tgz#34b7867613e5cc42d2b85ddc0424228cc33b43f0" - integrity sha512-7doS8br0xAkg48SKE2QNtMSFPFUlRdw9+votl27MvT46vo44ATBmdZdGysOevNELmZlfd+NEa0UYOA8f01WSrg== - -"@rollup/rollup-linux-arm-gnueabihf@4.21.0": - version "4.21.0" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.21.0.tgz#422b19ff9ae02b05d3395183d1d43b38c7c8be0b" - integrity sha512-pWJsfQjNWNGsoCq53KjMtwdJDmh/6NubwQcz52aEwLEuvx08bzcy6tOUuawAOncPnxz/3siRtd8hiQ32G1y8VA== - -"@rollup/rollup-linux-arm-musleabihf@4.21.0": - version "4.21.0" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.21.0.tgz#568aa29195ef6fc57ec6ed3f518923764406a8ee" - integrity sha512-efRIANsz3UHZrnZXuEvxS9LoCOWMGD1rweciD6uJQIx2myN3a8Im1FafZBzh7zk1RJ6oKcR16dU3UPldaKd83w== - -"@rollup/rollup-linux-arm64-gnu@4.21.0": - version "4.21.0" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.21.0.tgz#22309c8bcba9a73114f69165c72bc94b2fbec085" - integrity sha512-ZrPhydkTVhyeGTW94WJ8pnl1uroqVHM3j3hjdquwAcWnmivjAwOYjTEAuEDeJvGX7xv3Z9GAvrBkEzCgHq9U1w== - -"@rollup/rollup-linux-arm64-musl@4.21.0": - version "4.21.0" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.21.0.tgz#c93c388af6d33f082894b8a60839d7265b2b9bc5" - integrity sha512-cfaupqd+UEFeURmqNP2eEvXqgbSox/LHOyN9/d2pSdV8xTrjdg3NgOFJCtc1vQ/jEke1qD0IejbBfxleBPHnPw== - -"@rollup/rollup-linux-powerpc64le-gnu@4.21.0": - version "4.21.0" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.21.0.tgz#493c5e19e395cf3c6bd860c7139c8a903dea72b4" - integrity sha512-ZKPan1/RvAhrUylwBXC9t7B2hXdpb/ufeu22pG2psV7RN8roOfGurEghw1ySmX/CmDDHNTDDjY3lo9hRlgtaHg== - -"@rollup/rollup-linux-riscv64-gnu@4.21.0": - version "4.21.0" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.21.0.tgz#a2eab4346fbe5909165ce99adb935ba30c9fb444" - integrity sha512-H1eRaCwd5E8eS8leiS+o/NqMdljkcb1d6r2h4fKSsCXQilLKArq6WS7XBLDu80Yz+nMqHVFDquwcVrQmGr28rg== - -"@rollup/rollup-linux-s390x-gnu@4.21.0": - version "4.21.0" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.21.0.tgz#0bc49a79db4345d78d757bb1b05e73a1b42fa5c3" - integrity sha512-zJ4hA+3b5tu8u7L58CCSI0A9N1vkfwPhWd/puGXwtZlsB5bTkwDNW/+JCU84+3QYmKpLi+XvHdmrlwUwDA6kqw== - -"@rollup/rollup-linux-x64-gnu@4.21.0": - version "4.21.0" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.21.0.tgz#4fd36a6a41f3406d8693321b13d4f9b7658dd4b9" - integrity sha512-e2hrvElFIh6kW/UNBQK/kzqMNY5mO+67YtEh9OA65RM5IJXYTWiXjX6fjIiPaqOkBthYF1EqgiZ6OXKcQsM0hg== - -"@rollup/rollup-linux-x64-musl@4.21.0": - version "4.21.0" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.21.0.tgz#10ebb13bd4469cbad1a5d9b073bd27ec8a886200" - integrity sha512-1vvmgDdUSebVGXWX2lIcgRebqfQSff0hMEkLJyakQ9JQUbLDkEaMsPTLOmyccyC6IJ/l3FZuJbmrBw/u0A0uCQ== - -"@rollup/rollup-win32-arm64-msvc@4.21.0": - version "4.21.0" - resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.21.0.tgz#2fef1a90f1402258ef915ae5a94cc91a5a1d5bfc" - integrity sha512-s5oFkZ/hFcrlAyBTONFY1TWndfyre1wOMwU+6KCpm/iatybvrRgmZVM+vCFwxmC5ZhdlgfE0N4XorsDpi7/4XQ== - -"@rollup/rollup-win32-ia32-msvc@4.21.0": - version "4.21.0" - resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.21.0.tgz#a18ad47a95c5f264defb60acdd8c27569f816fc1" - integrity sha512-G9+TEqRnAA6nbpqyUqgTiopmnfgnMkR3kMukFBDsiyy23LZvUCpiUwjTRx6ezYCjJODXrh52rBR9oXvm+Fp5wg== - -"@rollup/rollup-win32-x64-msvc@4.21.0": - version "4.21.0" - resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.21.0.tgz#20c09cf44dcb082140cc7f439dd679fe4bba3375" - integrity sha512-2jsCDZwtQvRhejHLfZ1JY6w6kEuEtfF9nzYsZxzSlNVKDX+DpsDJ+Rbjkm74nvg2rdx0gwBS+IMdvwJuq3S9pQ== +"@rollup/rollup-android-arm-eabi@4.21.3": + version "4.21.3" + resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.21.3.tgz#155c7d82c1b36c3ad84d9adf9b3cd520cba81a0f" + integrity sha512-MmKSfaB9GX+zXl6E8z4koOr/xU63AMVleLEa64v7R0QF/ZloMs5vcD1sHgM64GXXS1csaJutG+ddtzcueI/BLg== + +"@rollup/rollup-android-arm64@4.21.3": + version "4.21.3" + resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.21.3.tgz#b94b6fa002bd94a9cbd8f9e47e23b25e5bd113ba" + integrity sha512-zrt8ecH07PE3sB4jPOggweBjJMzI1JG5xI2DIsUbkA+7K+Gkjys6eV7i9pOenNSDJH3eOr/jLb/PzqtmdwDq5g== + +"@rollup/rollup-darwin-arm64@4.21.3": + version "4.21.3" + resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.21.3.tgz#0934126cf9cbeadfe0eb7471ab5d1517e8cd8dcc" + integrity sha512-P0UxIOrKNBFTQaXTxOH4RxuEBVCgEA5UTNV6Yz7z9QHnUJ7eLX9reOd/NYMO3+XZO2cco19mXTxDMXxit4R/eQ== + +"@rollup/rollup-darwin-x64@4.21.3": + version "4.21.3" + resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.21.3.tgz#0ce8e1e0f349778938c7c90e4bdc730640e0a13e" + integrity sha512-L1M0vKGO5ASKntqtsFEjTq/fD91vAqnzeaF6sfNAy55aD+Hi2pBI5DKwCO+UNDQHWsDViJLqshxOahXyLSh3EA== + +"@rollup/rollup-linux-arm-gnueabihf@4.21.3": + version "4.21.3" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.21.3.tgz#5669d34775ad5d71e4f29ade99d0ff4df523afb6" + integrity sha512-btVgIsCjuYFKUjopPoWiDqmoUXQDiW2A4C3Mtmp5vACm7/GnyuprqIDPNczeyR5W8rTXEbkmrJux7cJmD99D2g== + +"@rollup/rollup-linux-arm-musleabihf@4.21.3": + version "4.21.3" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.21.3.tgz#f6d1a0e1da4061370cb2f4244fbdd727c806dd88" + integrity sha512-zmjbSphplZlau6ZTkxd3+NMtE4UKVy7U4aVFMmHcgO5CUbw17ZP6QCgyxhzGaU/wFFdTfiojjbLG3/0p9HhAqA== + +"@rollup/rollup-linux-arm64-gnu@4.21.3": + version "4.21.3" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.21.3.tgz#ed96a05e99743dee4d23cc4913fc6e01a0089c88" + integrity sha512-nSZfcZtAnQPRZmUkUQwZq2OjQciR6tEoJaZVFvLHsj0MF6QhNMg0fQ6mUOsiCUpTqxTx0/O6gX0V/nYc7LrgPw== + +"@rollup/rollup-linux-arm64-musl@4.21.3": + version "4.21.3" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.21.3.tgz#057ea26eaa7e537a06ded617d23d57eab3cecb58" + integrity sha512-MnvSPGO8KJXIMGlQDYfvYS3IosFN2rKsvxRpPO2l2cum+Z3exiExLwVU+GExL96pn8IP+GdH8Tz70EpBhO0sIQ== + +"@rollup/rollup-linux-powerpc64le-gnu@4.21.3": + version "4.21.3" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.21.3.tgz#6e6e1f9404c9bf3fbd7d51cd11cd288a9a2843aa" + integrity sha512-+W+p/9QNDr2vE2AXU0qIy0qQE75E8RTwTwgqS2G5CRQ11vzq0tbnfBd6brWhS9bCRjAjepJe2fvvkvS3dno+iw== + +"@rollup/rollup-linux-riscv64-gnu@4.21.3": + version "4.21.3" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.21.3.tgz#eef1536a53f6e6658a2a778130e6b1a4a41cb439" + integrity sha512-yXH6K6KfqGXaxHrtr+Uoy+JpNlUlI46BKVyonGiaD74ravdnF9BUNC+vV+SIuB96hUMGShhKV693rF9QDfO6nQ== + +"@rollup/rollup-linux-s390x-gnu@4.21.3": + version "4.21.3" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.21.3.tgz#2b28fb89ca084efaf8086f435025d96b4a966957" + integrity sha512-R8cwY9wcnApN/KDYWTH4gV/ypvy9yZUHlbJvfaiXSB48JO3KpwSpjOGqO4jnGkLDSk1hgjYkTbTt6Q7uvPf8eg== + +"@rollup/rollup-linux-x64-gnu@4.21.3": + version "4.21.3" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.21.3.tgz#5226cde6c6b495b04a3392c1d2c572844e42f06b" + integrity sha512-kZPbX/NOPh0vhS5sI+dR8L1bU2cSO9FgxwM8r7wHzGydzfSjLRCFAT87GR5U9scj2rhzN3JPYVC7NoBbl4FZ0g== + +"@rollup/rollup-linux-x64-musl@4.21.3": + version "4.21.3" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.21.3.tgz#2c2412982e6c2a00a2ecac6d548ebb02f0aa6ca4" + integrity sha512-S0Yq+xA1VEH66uiMNhijsWAafffydd2X5b77eLHfRmfLsRSpbiAWiRHV6DEpz6aOToPsgid7TI9rGd6zB1rhbg== + +"@rollup/rollup-win32-arm64-msvc@4.21.3": + version "4.21.3" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.21.3.tgz#fbb6ef5379199e2ec0103ef32877b0985c773a55" + integrity sha512-9isNzeL34yquCPyerog+IMCNxKR8XYmGd0tHSV+OVx0TmE0aJOo9uw4fZfUuk2qxobP5sug6vNdZR6u7Mw7Q+Q== + +"@rollup/rollup-win32-ia32-msvc@4.21.3": + version "4.21.3" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.21.3.tgz#d50e2082e147e24d87fe34abbf6246525ec3845a" + integrity sha512-nMIdKnfZfzn1Vsk+RuOvl43ONTZXoAPUUxgcU0tXooqg4YrAqzfKzVenqqk2g5efWh46/D28cKFrOzDSW28gTA== + +"@rollup/rollup-win32-x64-msvc@4.21.3": + version "4.21.3" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.21.3.tgz#4115233aa1bd5a2060214f96d8511f6247093212" + integrity sha512-fOvu7PCQjAj4eWDEuD8Xz5gpzFqXzGlxHZozHP4b9Jxv9APtdxL6STqztDzMLuRXEc4UpXGGhx029Xgm91QBeA== "@types/estree@1.0.5", "@types/estree@^1.0.0": version "1.0.5" @@ -260,28 +260,28 @@ resolve@^1.22.1: supports-preserve-symlinks-flag "^1.0.0" rollup@^4.13.2: - version "4.21.0" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-4.21.0.tgz#28db5f5c556a5180361d35009979ccc749560b9d" - integrity sha512-vo+S/lfA2lMS7rZ2Qoubi6I5hwZwzXeUIctILZLbHI+laNtvhhOIon2S1JksA5UEDQ7l3vberd0fxK44lTYjbQ== + version "4.21.3" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-4.21.3.tgz#c64ba119e6aeb913798a6f7eef2780a0df5a0821" + integrity sha512-7sqRtBNnEbcBtMeRVc6VRsJMmpI+JU1z9VTvW8D4gXIYQFz0aLcsE6rRkyghZkLfEgUZgVvOG7A5CVz/VW5GIA== dependencies: "@types/estree" "1.0.5" optionalDependencies: - "@rollup/rollup-android-arm-eabi" "4.21.0" - "@rollup/rollup-android-arm64" "4.21.0" - "@rollup/rollup-darwin-arm64" "4.21.0" - "@rollup/rollup-darwin-x64" "4.21.0" - "@rollup/rollup-linux-arm-gnueabihf" "4.21.0" - "@rollup/rollup-linux-arm-musleabihf" "4.21.0" - "@rollup/rollup-linux-arm64-gnu" "4.21.0" - "@rollup/rollup-linux-arm64-musl" "4.21.0" - "@rollup/rollup-linux-powerpc64le-gnu" "4.21.0" - "@rollup/rollup-linux-riscv64-gnu" "4.21.0" - "@rollup/rollup-linux-s390x-gnu" "4.21.0" - "@rollup/rollup-linux-x64-gnu" "4.21.0" - "@rollup/rollup-linux-x64-musl" "4.21.0" - "@rollup/rollup-win32-arm64-msvc" "4.21.0" - "@rollup/rollup-win32-ia32-msvc" "4.21.0" - "@rollup/rollup-win32-x64-msvc" "4.21.0" + "@rollup/rollup-android-arm-eabi" "4.21.3" + "@rollup/rollup-android-arm64" "4.21.3" + "@rollup/rollup-darwin-arm64" "4.21.3" + "@rollup/rollup-darwin-x64" "4.21.3" + "@rollup/rollup-linux-arm-gnueabihf" "4.21.3" + "@rollup/rollup-linux-arm-musleabihf" "4.21.3" + "@rollup/rollup-linux-arm64-gnu" "4.21.3" + "@rollup/rollup-linux-arm64-musl" "4.21.3" + "@rollup/rollup-linux-powerpc64le-gnu" "4.21.3" + "@rollup/rollup-linux-riscv64-gnu" "4.21.3" + "@rollup/rollup-linux-s390x-gnu" "4.21.3" + "@rollup/rollup-linux-x64-gnu" "4.21.3" + "@rollup/rollup-linux-x64-musl" "4.21.3" + "@rollup/rollup-win32-arm64-msvc" "4.21.3" + "@rollup/rollup-win32-ia32-msvc" "4.21.3" + "@rollup/rollup-win32-x64-msvc" "4.21.3" fsevents "~2.3.2" safe-buffer@^5.1.0: @@ -320,9 +320,9 @@ supports-preserve-symlinks-flag@^1.0.0: integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== terser@^5.17.4: - version "5.31.6" - resolved "https://registry.yarnpkg.com/terser/-/terser-5.31.6.tgz#c63858a0f0703988d0266a82fcbf2d7ba76422b1" - integrity sha512-PQ4DAriWzKj+qgehQ7LK5bQqCFNMmlhjR2PFFLuqGCpuCAauxemVBWwWOxo3UIwWQx8+Pr61Df++r76wDmkQBg== + version "5.32.0" + resolved "https://registry.yarnpkg.com/terser/-/terser-5.32.0.tgz#ee811c0d2d6b741c1cc34a2bc5bcbfc1b5b1f96c" + integrity sha512-v3Gtw3IzpBJ0ugkxEX8U0W6+TnPKRRCWGh1jC/iM/e3Ki5+qvO1L1EAZ56bZasc64aXHwRHNIQEzm6//i5cemQ== dependencies: "@jridgewell/source-map" "^0.3.3" acorn "^8.8.2" From 50205155b6d17547cd7aa02141b1a699d1ab0e52 Mon Sep 17 00:00:00 2001 From: Stephen Nelson Date: Mon, 16 Sep 2024 15:42:35 +0930 Subject: [PATCH 2/6] Upgrade dummy app to 7.1 --- .rubocop.yml | 6 +- spec/dummy/Rakefile | 3 +- spec/dummy/bin/rails | 2 + spec/dummy/bin/rake | 2 + spec/dummy/bin/setup | 6 +- spec/dummy/config.ru | 2 + spec/dummy/config/application.rb | 9 +- spec/dummy/config/boot.rb | 2 + spec/dummy/config/environment.rb | 2 + spec/dummy/config/environments/development.rb | 13 +-- spec/dummy/config/environments/production.rb | 87 ------------------- spec/dummy/config/environments/test.rb | 24 +++-- spec/dummy/config/initializers/assets.rb | 7 +- .../initializers/content_security_policy.rb | 6 +- .../initializers/filter_parameter_logging.rb | 12 +-- spec/dummy/config/initializers/inflections.rb | 2 + .../config/initializers/permissions_policy.rb | 22 +++-- spec/dummy/config/puma.rb | 10 ++- spec/dummy/config/routes.rb | 4 +- .../db/migrate/20220912053954_create_pages.rb | 2 + ...te_active_storage_tables.active_storage.rb | 24 ++--- ...7_create_action_text_tables.action_text.rb | 19 ++-- ..._to_active_storage_blobs.active_storage.rb | 26 ++++++ ..._storage_variant_records.active_storage.rb | 30 +++++++ ...e_storage_blobs_checksum.active_storage.rb | 10 +++ spec/dummy/db/schema.rb | 5 +- 26 files changed, 181 insertions(+), 156 deletions(-) delete mode 100644 spec/dummy/config/environments/production.rb create mode 100644 spec/dummy/db/migrate/20240916060729_add_service_name_to_active_storage_blobs.active_storage.rb create mode 100644 spec/dummy/db/migrate/20240916060730_create_active_storage_variant_records.active_storage.rb create mode 100644 spec/dummy/db/migrate/20240916060731_remove_not_null_on_active_storage_blobs_checksum.active_storage.rb diff --git a/.rubocop.yml b/.rubocop.yml index 312fbb9..546a645 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -9,10 +9,6 @@ AllCops: TargetRubyVersion: 3.2 Exclude: # Dummy app - - spec/dummy/* - - spec/dummy/bin/* - - spec/dummy/config/**/* - - spec/dummy/db/**/* - - spec/dummy/deploy/* + - spec/dummy/tmp/**/* - spec/dummy/node_modules/**/* - spec/dummy/vendor/bundle/**/* diff --git a/spec/dummy/Rakefile b/spec/dummy/Rakefile index 85c797e..3ca8cb9 100644 --- a/spec/dummy/Rakefile +++ b/spec/dummy/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Add your own tasks in files placed in lib/tasks ending in .rake, # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. @@ -8,4 +10,3 @@ namespace :test do end Rails.application.load_tasks - diff --git a/spec/dummy/bin/rails b/spec/dummy/bin/rails index efc0377..22f2d8d 100755 --- a/spec/dummy/bin/rails +++ b/spec/dummy/bin/rails @@ -1,4 +1,6 @@ #!/usr/bin/env ruby +# frozen_string_literal: true + APP_PATH = File.expand_path("../config/application", __dir__) require_relative "../config/boot" require "rails/commands" diff --git a/spec/dummy/bin/rake b/spec/dummy/bin/rake index 4fbf10b..e436ea5 100755 --- a/spec/dummy/bin/rake +++ b/spec/dummy/bin/rake @@ -1,4 +1,6 @@ #!/usr/bin/env ruby +# frozen_string_literal: true + require_relative "../config/boot" require "rake" Rake.application.run diff --git a/spec/dummy/bin/setup b/spec/dummy/bin/setup index ec47b79..322c583 100755 --- a/spec/dummy/bin/setup +++ b/spec/dummy/bin/setup @@ -1,11 +1,13 @@ #!/usr/bin/env ruby +# frozen_string_literal: true + require "fileutils" # path to your application root. APP_ROOT = File.expand_path("..", __dir__) -def system!(*args) - system(*args) || abort("\n== Command #{args} failed ==") +def system!(*) + system(*, exception: true) end FileUtils.chdir APP_ROOT do diff --git a/spec/dummy/config.ru b/spec/dummy/config.ru index 4a3c09a..2e03084 100644 --- a/spec/dummy/config.ru +++ b/spec/dummy/config.ru @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This file is used by Rack-based servers to start the application. require_relative "config/environment" diff --git a/spec/dummy/config/application.rb b/spec/dummy/config/application.rb index 76914ac..25b0b07 100644 --- a/spec/dummy/config/application.rb +++ b/spec/dummy/config/application.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "boot" require "rails" @@ -21,10 +23,13 @@ module Dummy class Application < Rails::Application + # Initialize configuration defaults for originally generated Rails version. config.load_defaults Rails::VERSION::STRING.to_f - # For compatibility with applications that use this config - config.action_controller.include_all_helpers = false + # Please, add to the `ignore` list any other `lib` subdirectories that do + # not contain `.rb` files, or that should not be reloaded or eager loaded. + # Common ones are `templates`, `generators`, or `middleware`, for example. + config.autoload_lib(ignore: %w(assets tasks)) # Configuration for the application, engines, and railties goes here. # diff --git a/spec/dummy/config/boot.rb b/spec/dummy/config/boot.rb index 116591a..59459d4 100644 --- a/spec/dummy/config/boot.rb +++ b/spec/dummy/config/boot.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Set up gems listed in the Gemfile. ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../../Gemfile", __dir__) diff --git a/spec/dummy/config/environment.rb b/spec/dummy/config/environment.rb index cac5315..7df99e8 100644 --- a/spec/dummy/config/environment.rb +++ b/spec/dummy/config/environment.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Load the Rails application. require_relative "application" diff --git a/spec/dummy/config/environments/development.rb b/spec/dummy/config/environments/development.rb index deadb27..5c852f4 100644 --- a/spec/dummy/config/environments/development.rb +++ b/spec/dummy/config/environments/development.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "active_support/core_ext/integer/time" Rails.application.configure do @@ -6,7 +8,7 @@ # In the development environment your application's code is reloaded any time # it changes. This slows down response time but is perfect for development # since you don't have to restart the web server when you make code changes. - config.cache_classes = false + config.enable_reloading = true # Do not eager load code on boot. config.eager_load = false @@ -25,7 +27,7 @@ config.cache_store = :memory_store config.public_file_server.headers = { - "Cache-Control" => "public, max-age=#{2.days.to_i}" + "Cache-Control" => "public, max-age=#{2.days.to_i}", } else config.action_controller.perform_caching = false @@ -51,8 +53,8 @@ # Highlight code that triggered database queries in logs. config.active_record.verbose_query_logs = true - # Suppress logger output for asset requests. - config.assets.quiet = true + # Highlight code that enqueued background job in logs. + config.active_job.verbose_enqueue_logs = true # Raises error for missing translations. # config.i18n.raise_on_missing_translations = true @@ -63,5 +65,6 @@ # Uncomment if you wish to allow Action Cable access from any origin. # config.action_cable.disable_request_forgery_protection = true - config.hosts << "development" + # Raise error when a before_action's only/except options reference missing actions + config.action_controller.raise_on_missing_callback_actions = true end diff --git a/spec/dummy/config/environments/production.rb b/spec/dummy/config/environments/production.rb deleted file mode 100644 index 68e27d4..0000000 --- a/spec/dummy/config/environments/production.rb +++ /dev/null @@ -1,87 +0,0 @@ -require "active_support/core_ext/integer/time" - -Rails.application.configure do - # Settings specified here will take precedence over those in config/application.rb. - - # Code is not reloaded between requests. - config.cache_classes = true - - # Eager load code on boot. This eager loads most of Rails and - # your application in memory, allowing both threaded web servers - # and those relying on copy on write to perform better. - # Rake tasks automatically ignore this option for performance. - config.eager_load = true - - # Full error reports are disabled and caching is turned on. - config.consider_all_requests_local = false - config.action_controller.perform_caching = true - - # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"] - # or in config/master.key. This key is used to decrypt credentials (and other encrypted files). - # config.require_master_key = true - - # Disable serving static files from the `/public` folder by default since - # Apache or NGINX already handles this. - config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present? - - # Compress CSS using a preprocessor. - # config.assets.css_compressor = :sass - - # Do not fallback to assets pipeline if a precompiled asset is missed. - config.assets.compile = false - - # Enable serving of images, stylesheets, and JavaScripts from an asset server. - # config.asset_host = "http://assets.example.com" - - # Specifies the header that your server uses for sending files. - # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache - # config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX - - # Store uploaded files on the local file system (see config/storage.yml for options). - config.active_storage.service = :local - - # Mount Action Cable outside main process or domain. - # config.action_cable.mount_path = nil - # config.action_cable.url = "wss://example.com/cable" - # config.action_cable.allowed_request_origins = [ "http://example.com", /http:\/\/example.*/ ] - - # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. - # config.force_ssl = true - - # Include generic and useful information about system operation, but avoid logging too much - # information to avoid inadvertent exposure of personally identifiable information (PII). - config.log_level = :info - - # Prepend all log lines with the following tags. - config.log_tags = [ :request_id ] - - # Use a different cache store in production. - # config.cache_store = :mem_cache_store - - # Use a real queuing backend for Active Job (and separate queues per environment). - # config.active_job.queue_adapter = :resque - # config.active_job.queue_name_prefix = "dummy_production" - - # Enable locale fallbacks for I18n (makes lookups for any locale fall back to - # the I18n.default_locale when a translation cannot be found). - config.i18n.fallbacks = true - - # Don't log any deprecations. - config.active_support.report_deprecations = false - - # Use default logging formatter so that PID and timestamp are not suppressed. - config.log_formatter = ::Logger::Formatter.new - - # Use a different logger for distributed setups. - # require "syslog/logger" - # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new "app-name") - - if ENV["RAILS_LOG_TO_STDOUT"].present? - logger = ActiveSupport::Logger.new(STDOUT) - logger.formatter = config.log_formatter - config.logger = ActiveSupport::TaggedLogging.new(logger) - end - - # Do not dump schema after migrations. - config.active_record.dump_schema_after_migration = false -end diff --git a/spec/dummy/config/environments/test.rb b/spec/dummy/config/environments/test.rb index 4b69e21..7925e72 100644 --- a/spec/dummy/config/environments/test.rb +++ b/spec/dummy/config/environments/test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "active_support/core_ext/integer/time" # The test environment is used exclusively to run your application's @@ -8,27 +10,28 @@ Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. - # Turn false under Spring and add config.action_view.cache_template_loading = true. - config.cache_classes = true + # While tests run files are not watched, reloading is not necessary. + config.enable_reloading = 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. + # Eager loading loads your entire application. When running a single test locally, + # this is usually not necessary, and can slow down your test suite. However, it's + # recommended that you enable it in continuous integration systems to ensure eager + # loading is working properly 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 config.public_file_server.headers = { - "Cache-Control" => "public, max-age=#{1.hour.to_i}" + "Cache-Control" => "public, max-age=#{1.hour.to_i}", } # Show full error reports and disable caching. - config.consider_all_requests_local = true + config.consider_all_requests_local = true config.action_controller.perform_caching = false config.cache_store = :null_store - # Raise exceptions instead of rendering exception templates. - config.action_dispatch.show_exceptions = :none + # Render exception templates for rescuable exceptions and raise for other exceptions. + config.action_dispatch.show_exceptions = :rescuable # Disable request forgery protection in test environment. config.action_controller.allow_forgery_protection = false @@ -50,4 +53,7 @@ # Annotate rendered view with file names. # config.action_view.annotate_rendered_view_with_filenames = true + + # Raise error when a before_action's only/except options reference missing actions + config.action_controller.raise_on_missing_callback_actions = true end diff --git a/spec/dummy/config/initializers/assets.rb b/spec/dummy/config/initializers/assets.rb index 2eeef96..8544c07 100644 --- a/spec/dummy/config/initializers/assets.rb +++ b/spec/dummy/config/initializers/assets.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # 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. @@ -5,8 +7,3 @@ # Add additional assets to the asset load path. # Rails.application.config.assets.paths << Emoji.images_path - -# Precompile additional assets. -# application.js, application.css, and all non-JS/CSS in the app/assets -# folder are already added. -# Rails.application.config.assets.precompile += %w( admin.js admin.css ) diff --git a/spec/dummy/config/initializers/content_security_policy.rb b/spec/dummy/config/initializers/content_security_policy.rb index 54f47cf..35ab3fd 100644 --- a/spec/dummy/config/initializers/content_security_policy.rb +++ b/spec/dummy/config/initializers/content_security_policy.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Be sure to restart your server when you modify this file. # Define an application-wide content security policy. @@ -16,9 +18,9 @@ # # policy.report_uri "/csp-violation-report-endpoint" # end # -# # Generate session nonces for permitted importmap and inline scripts +# # Generate session nonces for permitted importmap, inline scripts, and inline styles. # config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s } -# config.content_security_policy_nonce_directives = %w(script-src) +# config.content_security_policy_nonce_directives = %w(script-src style-src) # # # Report violations without enforcing the policy. # # config.content_security_policy_report_only = true diff --git a/spec/dummy/config/initializers/filter_parameter_logging.rb b/spec/dummy/config/initializers/filter_parameter_logging.rb index adc6568..c416e6a 100644 --- a/spec/dummy/config/initializers/filter_parameter_logging.rb +++ b/spec/dummy/config/initializers/filter_parameter_logging.rb @@ -1,8 +1,10 @@ +# frozen_string_literal: true + # Be sure to restart your server when you modify this 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 += [ - :passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn +# Configure parameters to be partially matched (e.g. passw matches password) and 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[ + passw secret token _key crypt salt certificate otp ssn ] diff --git a/spec/dummy/config/initializers/inflections.rb b/spec/dummy/config/initializers/inflections.rb index 3860f65..9e049dc 100644 --- a/spec/dummy/config/initializers/inflections.rb +++ b/spec/dummy/config/initializers/inflections.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Be sure to restart your server when you modify this file. # Add new inflection rules using the following format. Inflections diff --git a/spec/dummy/config/initializers/permissions_policy.rb b/spec/dummy/config/initializers/permissions_policy.rb index 00f64d7..e8d0b2a 100644 --- a/spec/dummy/config/initializers/permissions_policy.rb +++ b/spec/dummy/config/initializers/permissions_policy.rb @@ -1,11 +1,15 @@ +# frozen_string_literal: true + +# Be sure to restart your server when you modify this file. + # Define an application-wide HTTP permissions policy. For further -# information see https://developers.google.com/web/updates/2018/06/feature-policy -# -# Rails.application.config.permissions_policy do |f| -# f.camera :none -# f.gyroscope :none -# f.microphone :none -# f.usb :none -# f.fullscreen :self -# f.payment :self, "https://secure.example.com" +# information see: https://developers.google.com/web/updates/2018/06/feature-policy + +# Rails.application.config.permissions_policy do |policy| +# policy.camera :none +# policy.gyroscope :none +# policy.microphone :none +# policy.usb :none +# policy.fullscreen :self +# policy.payment :self, "https://secure.example.com" # end diff --git a/spec/dummy/config/puma.rb b/spec/dummy/config/puma.rb index daaf036..de5feec 100644 --- a/spec/dummy/config/puma.rb +++ b/spec/dummy/config/puma.rb @@ -1,10 +1,12 @@ +# frozen_string_literal: true + # Puma can serve each request in a thread from an internal thread pool. # The `threads` method setting takes two numbers: a minimum and maximum. # Any libraries that use thread pools should be configured to match # the maximum value specified for Puma. Default is set to 5 threads for minimum # and maximum; this matches the default thread size of Active Record. # -max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 } +max_threads_count = ENV.fetch("RAILS_MAX_THREADS", 5) min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count } threads min_threads_count, max_threads_count @@ -15,14 +17,14 @@ # Specifies the `port` that Puma will listen on to receive requests; default is 3000. # -port ENV.fetch("PORT") { 3000 } +port ENV.fetch("PORT", 3000) # Specifies the `environment` that Puma will run in. # -environment ENV.fetch("RAILS_ENV") { "development" } +environment ENV.fetch("RAILS_ENV", "development") # Specifies the `pidfile` that Puma will use. -pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" } +pidfile ENV.fetch("PIDFILE", "tmp/pids/server.pid") # Specifies the number of `workers` to boot in clustered mode. # Workers are forked web server processes. If using threads and workers together diff --git a/spec/dummy/config/routes.rb b/spec/dummy/config/routes.rb index d876276..2fa92b0 100644 --- a/spec/dummy/config/routes.rb +++ b/spec/dummy/config/routes.rb @@ -1,7 +1,9 @@ +# frozen_string_literal: true + Rails.application.routes.draw do mount Katalyst::Content::Engine, at: "content" - resources :home, only: [:index, :show] + resources :home, only: %i[index show] namespace :admin do resources :pages diff --git a/spec/dummy/db/migrate/20220912053954_create_pages.rb b/spec/dummy/db/migrate/20220912053954_create_pages.rb index 89d6296..d17ad90 100644 --- a/spec/dummy/db/migrate/20220912053954_create_pages.rb +++ b/spec/dummy/db/migrate/20220912053954_create_pages.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreatePages < ActiveRecord::Migration[7.0] def change create_table :pages do |t| diff --git a/spec/dummy/db/migrate/20220913043836_create_active_storage_tables.active_storage.rb b/spec/dummy/db/migrate/20220913043836_create_active_storage_tables.active_storage.rb index 8a7bfe1..7e01405 100644 --- a/spec/dummy/db/migrate/20220913043836_create_active_storage_tables.active_storage.rb +++ b/spec/dummy/db/migrate/20220913043836_create_active_storage_tables.active_storage.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This migration comes from active_storage (originally 20170806125915) class CreateActiveStorageTables < ActiveRecord::Migration[5.2] def change @@ -19,7 +21,7 @@ def change t.datetime :created_at, null: false end - t.index [ :key ], unique: true + t.index [:key], unique: true end create_table :active_storage_attachments, id: primary_key_type do |t| @@ -33,7 +35,8 @@ def change t.datetime :created_at, null: false end - t.index [ :record_type, :record_id, :name, :blob_id ], name: :index_active_storage_attachments_uniqueness, unique: true + t.index %i[record_type record_id name blob_id], name: :index_active_storage_attachments_uniqueness, + unique: true t.foreign_key :active_storage_blobs, column: :blob_id end @@ -41,17 +44,18 @@ def change t.belongs_to :blob, null: false, index: false, type: foreign_key_type t.string :variation_digest, null: false - t.index [ :blob_id, :variation_digest ], name: :index_active_storage_variant_records_uniqueness, unique: true + 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_and_foreign_key_types - config = Rails.configuration.generators - setting = config.options[config.orm][:primary_key_type] - primary_key_type = setting || :primary_key - foreign_key_type = setting || :bigint - [primary_key_type, foreign_key_type] - end + + def primary_and_foreign_key_types + config = Rails.configuration.generators + setting = config.options[config.orm][:primary_key_type] + primary_key_type = setting || :primary_key + foreign_key_type = setting || :bigint + [primary_key_type, foreign_key_type] + end end diff --git a/spec/dummy/db/migrate/20220913043837_create_action_text_tables.action_text.rb b/spec/dummy/db/migrate/20220913043837_create_action_text_tables.action_text.rb index 1be48d7..3ec6c7f 100644 --- a/spec/dummy/db/migrate/20220913043837_create_action_text_tables.action_text.rb +++ b/spec/dummy/db/migrate/20220913043837_create_action_text_tables.action_text.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This migration comes from action_text (originally 20180528164100) class CreateActionTextTables < ActiveRecord::Migration[6.0] def change @@ -11,16 +13,17 @@ def change t.timestamps - t.index [ :record_type, :record_id, :name ], name: "index_action_text_rich_texts_uniqueness", unique: true + t.index %i[record_type record_id name], name: "index_action_text_rich_texts_uniqueness", unique: true end end private - def primary_and_foreign_key_types - config = Rails.configuration.generators - setting = config.options[config.orm][:primary_key_type] - primary_key_type = setting || :primary_key - foreign_key_type = setting || :bigint - [primary_key_type, foreign_key_type] - end + + def primary_and_foreign_key_types + config = Rails.configuration.generators + setting = config.options[config.orm][:primary_key_type] + primary_key_type = setting || :primary_key + foreign_key_type = setting || :bigint + [primary_key_type, foreign_key_type] + end end diff --git a/spec/dummy/db/migrate/20240916060729_add_service_name_to_active_storage_blobs.active_storage.rb b/spec/dummy/db/migrate/20240916060729_add_service_name_to_active_storage_blobs.active_storage.rb new file mode 100644 index 0000000..06d648b --- /dev/null +++ b/spec/dummy/db/migrate/20240916060729_add_service_name_to_active_storage_blobs.active_storage.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# 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 + + # rubocop:disable Rails/SkipsModelValidations + if configured_service = ActiveStorage::Blob.service.name + ActiveStorage::Blob.unscoped.update_all(service_name: configured_service) + end + # rubocop:enable Rails/SkipsModelValidations + + 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/spec/dummy/db/migrate/20240916060730_create_active_storage_variant_records.active_storage.rb b/spec/dummy/db/migrate/20240916060730_create_active_storage_variant_records.active_storage.rb new file mode 100644 index 0000000..6068380 --- /dev/null +++ b/spec/dummy/db/migrate/20240916060730_create_active_storage_variant_records.active_storage.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# 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/spec/dummy/db/migrate/20240916060731_remove_not_null_on_active_storage_blobs_checksum.active_storage.rb b/spec/dummy/db/migrate/20240916060731_remove_not_null_on_active_storage_blobs_checksum.active_storage.rb new file mode 100644 index 0000000..6f31822 --- /dev/null +++ b/spec/dummy/db/migrate/20240916060731_remove_not_null_on_active_storage_blobs_checksum.active_storage.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +# 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/spec/dummy/db/schema.rb b/spec/dummy/db/schema.rb index 4f10563..b148343 100644 --- a/spec/dummy/db/schema.rb +++ b/spec/dummy/db/schema.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This file is auto-generated from the current state of the database. Instead # of editing this file, please use the migrations feature of Active Record to # incrementally modify your database, and then regenerate this schema definition. @@ -28,7 +30,8 @@ t.bigint "blob_id", null: false t.datetime "created_at", null: false t.index ["blob_id"], name: "index_active_storage_attachments_on_blob_id" - t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true + t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", + unique: true end create_table "active_storage_blobs", force: :cascade do |t| From 6fbd31e1b08561083531c518de93cbf6d1178f59 Mon Sep 17 00:00:00 2001 From: Stephen Nelson Date: Tue, 17 Sep 2024 15:13:01 +0930 Subject: [PATCH 3/6] Upgrade to Rails 7.2 --- Gemfile.lock | 133 +++++++++++++++++++-------------------- katalyst-content.gemspec | 2 +- spec/dummy/db/schema.rb | 2 +- 3 files changed, 67 insertions(+), 70 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 4755623..fc982f1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -3,7 +3,7 @@ PATH specs: katalyst-content (2.6.2) active_storage_validations - activerecord (>= 7.0, < 7.2) + activerecord katalyst-html-attributes katalyst-kpop view_component @@ -11,51 +11,46 @@ PATH GEM remote: https://rubygems.org/ specs: - actioncable (7.1.4) - actionpack (= 7.1.4) - activesupport (= 7.1.4) + actioncable (7.2.1) + actionpack (= 7.2.1) + activesupport (= 7.2.1) nio4r (~> 2.0) websocket-driver (>= 0.6.1) zeitwerk (~> 2.6) - actionmailbox (7.1.4) - actionpack (= 7.1.4) - activejob (= 7.1.4) - activerecord (= 7.1.4) - activestorage (= 7.1.4) - activesupport (= 7.1.4) - mail (>= 2.7.1) - net-imap - net-pop - net-smtp - actionmailer (7.1.4) - actionpack (= 7.1.4) - actionview (= 7.1.4) - activejob (= 7.1.4) - activesupport (= 7.1.4) - mail (~> 2.5, >= 2.5.4) - net-imap - net-pop - net-smtp + 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) rails-dom-testing (~> 2.2) - actionpack (7.1.4) - actionview (= 7.1.4) - activesupport (= 7.1.4) + actionpack (7.2.1) + actionview (= 7.2.1) + activesupport (= 7.2.1) nokogiri (>= 1.8.5) racc - rack (>= 2.2.4) + rack (>= 2.2.4, < 3.2) rack-session (>= 1.0.1) rack-test (>= 0.6.3) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - actiontext (7.1.4) - actionpack (= 7.1.4) - activerecord (= 7.1.4) - activestorage (= 7.1.4) - activesupport (= 7.1.4) + useragent (~> 0.16) + actiontext (7.2.1) + actionpack (= 7.2.1) + activerecord (= 7.2.1) + activestorage (= 7.2.1) + activesupport (= 7.2.1) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.1.4) - activesupport (= 7.1.4) + actionview (7.2.1) + activesupport (= 7.2.1) builder (~> 3.1) erubi (~> 1.11) rails-dom-testing (~> 2.2) @@ -65,31 +60,32 @@ GEM activemodel (>= 5.2.0) activestorage (>= 5.2.0) activesupport (>= 5.2.0) - activejob (7.1.4) - activesupport (= 7.1.4) + activejob (7.2.1) + activesupport (= 7.2.1) globalid (>= 0.3.6) - activemodel (7.1.4) - activesupport (= 7.1.4) - activerecord (7.1.4) - activemodel (= 7.1.4) - activesupport (= 7.1.4) + activemodel (7.2.1) + activesupport (= 7.2.1) + activerecord (7.2.1) + activemodel (= 7.2.1) + activesupport (= 7.2.1) timeout (>= 0.4.0) - activestorage (7.1.4) - actionpack (= 7.1.4) - activejob (= 7.1.4) - activerecord (= 7.1.4) - activesupport (= 7.1.4) + activestorage (7.2.1) + actionpack (= 7.2.1) + activejob (= 7.2.1) + activerecord (= 7.2.1) + activesupport (= 7.2.1) marcel (~> 1.0) - activesupport (7.1.4) + activesupport (7.2.1) 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) + logger (>= 1.4.2) minitest (>= 5.1) - mutex_m - tzinfo (~> 2.0) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) addressable (2.8.7) public_suffix (>= 2.0.2, < 7.0) ast (2.4.2) @@ -198,7 +194,6 @@ GEM mini_magick (4.13.2) mini_mime (1.1.5) minitest (5.25.1) - mutex_m (0.2.0) net-imap (0.4.16) date net-protocol @@ -236,20 +231,20 @@ GEM rackup (2.1.0) rack (>= 3) webrick (~> 1.8) - rails (7.1.4) - actioncable (= 7.1.4) - actionmailbox (= 7.1.4) - actionmailer (= 7.1.4) - actionpack (= 7.1.4) - actiontext (= 7.1.4) - actionview (= 7.1.4) - activejob (= 7.1.4) - activemodel (= 7.1.4) - activerecord (= 7.1.4) - activestorage (= 7.1.4) - activesupport (= 7.1.4) + 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) bundler (>= 1.15.0) - railties (= 7.1.4) + railties (= 7.2.1) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) @@ -261,10 +256,10 @@ GEM rails-html-sanitizer (1.6.0) loofah (~> 2.21) nokogiri (~> 1.14) - railties (7.1.4) - actionpack (= 7.1.4) - activesupport (= 7.1.4) - irb + railties (7.2.1) + actionpack (= 7.2.1) + activesupport (= 7.2.1) + irb (~> 1.13) rackup (>= 1.0.0) rake (>= 12.2) thor (~> 1.0, >= 1.2.2) @@ -343,6 +338,7 @@ GEM google-protobuf (~> 4.27) sass-embedded (1.78.0-x86_64-linux-gnu) google-protobuf (~> 4.27) + securerandom (0.3.1) shoulda-matchers (6.4.0) activesupport (>= 5.2.0) smart_properties (1.17.0) @@ -360,6 +356,7 @@ GEM tzinfo (2.0.6) concurrent-ruby (~> 1.0) unicode-display_width (2.6.0) + useragent (0.16.10) view_component (3.14.0) activesupport (>= 5.2.0, < 8.0) concurrent-ruby (~> 1.0) diff --git a/katalyst-content.gemspec b/katalyst-content.gemspec index 0e80152..a875739 100644 --- a/katalyst-content.gemspec +++ b/katalyst-content.gemspec @@ -15,7 +15,7 @@ Gem::Specification.new do |spec| spec.require_paths = ["lib"] spec.metadata["rubygems_mfa_required"] = "true" - spec.add_dependency "activerecord", ">= 7.0", "< 7.2" + spec.add_dependency "activerecord" spec.add_dependency "active_storage_validations" spec.add_dependency "katalyst-html-attributes" spec.add_dependency "katalyst-kpop" diff --git a/spec/dummy/db/schema.rb b/spec/dummy/db/schema.rb index b148343..eebd0b8 100644 --- a/spec/dummy/db/schema.rb +++ b/spec/dummy/db/schema.rb @@ -12,7 +12,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.1].define(version: 2024_08_26_042004) do +ActiveRecord::Schema[7.2].define(version: 2024_09_16_060731) do create_table "action_text_rich_texts", force: :cascade do |t| t.string "name", null: false t.text "body" From 71b534ca8c2fd026c7fa00394c23821a6a813c05 Mon Sep 17 00:00:00 2001 From: Stephen Nelson Date: Tue, 17 Sep 2024 15:15:20 +0930 Subject: [PATCH 4/6] Workaround for Rails#49769 https://github.com/rails/rails/pull/49769 --- .../concerns/katalyst/content/container.rb | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/app/models/concerns/katalyst/content/container.rb b/app/models/concerns/katalyst/content/container.rb index 8771551..ca8900a 100644 --- a/app/models/concerns/katalyst/content/container.rb +++ b/app/models/concerns/katalyst/content/container.rb @@ -49,8 +49,24 @@ def inactive dependent: :destroy, validate: true + # Rails 7.2 dropped support for ActiveModel enums. This is a temporary workaround. + # Intended behaviour: + # attribute :state, :string + # enum :state, %i[published draft unpublished].index_with(&:to_s) attribute :state, :string - enum :state, %i[published draft unpublished].index_with(&:to_s) + + # Returns true if there is a published version. Note that this includes drafts. + def published? + %w[published draft].include?(state) + end + + def draft? + state == "draft" + end + + def unpublished? + state == "unpublished" + end # Find records by their state scope :state, ->(values) do @@ -98,11 +114,6 @@ def inactive order(stmt.public_send(dir)).order(updated_at: dir) end - # Returns true if there is a published version. Note that this includes drafts. - def published? - super || draft? - end - def state=(_) raise NotImplementedError, "state cannot be set directly, use publish!, revert! etc" end From cb528467914bb2a8f60803edfd66f174ab15ebaa Mon Sep 17 00:00:00 2001 From: Stephen Nelson Date: Tue, 17 Sep 2024 16:03:17 +0930 Subject: [PATCH 5/6] Fix #71: Form uploads in Rails 7.2 --- .../katalyst/content/items_controller.rb | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/app/controllers/katalyst/content/items_controller.rb b/app/controllers/katalyst/content/items_controller.rb index 8ed51fa..5862aaa 100644 --- a/app/controllers/katalyst/content/items_controller.rb +++ b/app/controllers/katalyst/content/items_controller.rb @@ -87,15 +87,32 @@ def render_editor(**) # # This mimics the behaviour of direct uploads without requiring the JS # integration. + # + # Note: this idea comes from various blogs who have documented this approach, such as + # https://medium.com/@TETRA2000/active-storage-how-to-retain-uploaded-files-on-form-resubmission-91b57be78d53 + # + # In Rails 7.2 the simple version of this approach was broken to work around a bug that Rails plans to address + # in a future release. + # https://github.com/rails/rails/commit/82d4ad5da336a18a55a05a50b851e220032369a0 + # + # The work around is to decouple the blobs from their attachments before saving by duping + # them. This approach feels a bit hairy and might need to be replaced by a 'standard' direct upload approach + # in the future. + # + # The reason we use this approach currently is to avoid needing a separate direct upload controller for + # content which would potentially introduce a back door where un-trusted users are allowed to upload + # attachments. def store_attachments(item) item.attachment_changes.each_value do |change| case change when ActiveStorage::Attached::Changes::CreateOne change.upload - change.blob.save! + change.attachment.blob = change.blob.dup.tap(&:save!) when ActiveStorage::Attached::Changes::CreateMany change.upload - change.blobs.each(&:save!) + change.attachments.zip(change.blobs).each do |attachment, blob| + attachment.blob = blob.dup.tap(&:save!) + end end end end From 11b8bcbbe32299c2a882fdfcd4809d892e61b815 Mon Sep 17 00:00:00 2001 From: Stephen Nelson Date: Tue, 17 Sep 2024 16:07:59 +0930 Subject: [PATCH 6/6] Release 2.7.0 Rails 7.2 compatibility. --- Gemfile.lock | 2 +- katalyst-content.gemspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index fc982f1..d489117 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - katalyst-content (2.6.2) + katalyst-content (2.7.0) active_storage_validations activerecord katalyst-html-attributes diff --git a/katalyst-content.gemspec b/katalyst-content.gemspec index a875739..f423efb 100644 --- a/katalyst-content.gemspec +++ b/katalyst-content.gemspec @@ -2,7 +2,7 @@ Gem::Specification.new do |spec| spec.name = "katalyst-content" - spec.version = "2.6.2" + spec.version = "2.7.0" spec.authors = ["Katalyst Interactive"] spec.email = ["developers@katalyst.com.au"]