From 4d0b402ad38de79601c311a0fb3b06cbe497e124 Mon Sep 17 00:00:00 2001 From: Piotr Kuczynski Date: Tue, 8 Jul 2025 11:56:04 +0200 Subject: [PATCH 1/8] ci: bump rails to the latest versions and add missing deps --- Appraisals | 10 +++++++--- gemfiles/rails_6.1.gemfile | 4 +++- gemfiles/rails_7.0.gemfile | 4 +++- gemfiles/rails_7.1.gemfile | 2 +- spec/spec_helper.rb | 1 + 5 files changed, 15 insertions(+), 6 deletions(-) diff --git a/Appraisals b/Appraisals index 918e575c..630712ce 100644 --- a/Appraisals +++ b/Appraisals @@ -21,7 +21,9 @@ end appraise 'rails-6.1' do gem 'activerecord-jdbcsqlite3-adapter', '~> 61.1', platform: :jruby gem 'bootsnap', '>= 1.4.4' - gem 'rails', '6.1.7.6' + gem 'drb', '~> 2.2' if RUBY_VERSION >= '3.4' + gem 'mutex_m', '~> 0.2.0' if RUBY_VERSION >= '3.4' + gem 'rails', '6.1.7.10' gem 'rspec-rails', '~> 5.0' gem 'sqlite3', '~> 1.4', platform: :ruby gem 'psych', '>= 4' @@ -35,7 +37,9 @@ if RUBY_ENGINE == 'ruby' && RUBY_VERSION >= '2.7' gem 'activerecord-jdbcsqlite3-adapter', '~> 70.1', platform: :jruby gem 'sqlite3', '~> 1.6.4', platform: :ruby gem 'bootsnap', '>= 1.4.4' - gem 'rails', '7.0.8' + gem 'drb', '~> 2.2' if RUBY_VERSION >= '3.4' + gem 'mutex_m', '~> 0.2.0' if RUBY_VERSION >= '3.4' + gem 'rails', '7.0.8.7' gem 'rspec-rails', '~> 6.0.3' gem 'sprockets-rails', '~> 3.4.2' gem 'psych', '>= 4' @@ -45,7 +49,7 @@ if RUBY_ENGINE == 'ruby' && RUBY_VERSION >= '2.7' gem 'activerecord-jdbcsqlite3-adapter', '~> 70.1', platform: :jruby gem 'sqlite3', '~> 1.6.6', platform: :ruby gem 'bootsnap', '>= 1.16.0' - gem 'rails', '7.1.0' + gem 'rails', '7.1.5.1' gem 'rspec-rails', '~> 6.0.3' gem 'sprockets-rails', '~> 3.4.2' gem 'psych', '>= 4' diff --git a/gemfiles/rails_6.1.gemfile b/gemfiles/rails_6.1.gemfile index 98b26b00..e54e2587 100644 --- a/gemfiles/rails_6.1.gemfile +++ b/gemfiles/rails_6.1.gemfile @@ -4,7 +4,9 @@ source "https://rubygems.org" gem "activerecord-jdbcsqlite3-adapter", "~> 61.1", platform: :jruby gem "bootsnap", ">= 1.4.4" -gem "rails", "6.1.7.6" +gem "drb", "~> 2.2" +gem "mutex_m", "~> 0.2.0" +gem "rails", "6.1.7.10" gem "rspec-rails", "~> 5.0" gem "sqlite3", "~> 1.4", platform: :ruby gem "psych", ">= 4" diff --git a/gemfiles/rails_7.0.gemfile b/gemfiles/rails_7.0.gemfile index cd2643ce..8b4f31eb 100644 --- a/gemfiles/rails_7.0.gemfile +++ b/gemfiles/rails_7.0.gemfile @@ -5,7 +5,9 @@ source "https://rubygems.org" gem "activerecord-jdbcsqlite3-adapter", "~> 70.1", platform: :jruby gem "sqlite3", "~> 1.6.4", platform: :ruby gem "bootsnap", ">= 1.4.4" -gem "rails", "7.0.8" +gem "drb", "~> 2.2" +gem "mutex_m", "~> 0.2.0" +gem "rails", "7.0.8.7" gem "rspec-rails", "~> 6.0.3" gem "sprockets-rails", "~> 3.4.2" gem "psych", ">= 4" diff --git a/gemfiles/rails_7.1.gemfile b/gemfiles/rails_7.1.gemfile index 416cfea2..3e561123 100644 --- a/gemfiles/rails_7.1.gemfile +++ b/gemfiles/rails_7.1.gemfile @@ -5,7 +5,7 @@ source "https://rubygems.org" gem "activerecord-jdbcsqlite3-adapter", "~> 70.1", platform: :jruby gem "sqlite3", "~> 1.6.6", platform: :ruby gem "bootsnap", ">= 1.16.0" -gem "rails", "7.1.0" +gem "rails", "7.1.5.1" gem "rspec-rails", "~> 6.0.3" gem "sprockets-rails", "~> 3.4.2" gem "psych", ">= 4" diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index ca0739e7..9becdaa4 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -33,6 +33,7 @@ case app_framework when 'rails' # Load Rails + require 'logger' require_relative "app/#{app_name}/config/environment" APP_RAKEFILE = File.expand_path("../app/#{app_name}/Rakefile", __FILE__) From fdb1197a69f446b7ccc12a85bb3e0d27cfc779ea Mon Sep 17 00:00:00 2001 From: Piotr Kuczynski Date: Tue, 8 Jul 2025 12:25:23 +0200 Subject: [PATCH 2/8] try to fix jruby --- lib/config/dry_validation_requirements.rb | 4 +--- spec/validation_spec.rb | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/config/dry_validation_requirements.rb b/lib/config/dry_validation_requirements.rb index e1ddc5b5..54064ea9 100644 --- a/lib/config/dry_validation_requirements.rb +++ b/lib/config/dry_validation_requirements.rb @@ -14,9 +14,7 @@ def self.load_dry_validation! raise LoadError end rescue LoadError - raise ::Config::Error, 'Could not find a dry-validation version' \ - ' matching requirements' \ - " (#{VERSIONS.map(&:inspect) * ','})" + raise ::Config::Error, "Could not find a dry-validation version matching requirements (#{VERSIONS.map(&:inspect) * ','})" end require 'dry/validation' diff --git a/spec/validation_spec.rb b/spec/validation_spec.rb index 204f55d9..d04fd6a0 100644 --- a/spec/validation_spec.rb +++ b/spec/validation_spec.rb @@ -1,5 +1,5 @@ require 'spec_helper' -require 'dry-validation' +require 'dry/validation' describe Config do context 'validation' do From 95a1893a9a780ce028e8e574b051f4b04630d5e3 Mon Sep 17 00:00:00 2001 From: Piotr Kuczynski Date: Tue, 8 Jul 2025 12:56:55 +0200 Subject: [PATCH 3/8] dry-validation is needed now only for testing --- config.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.gemspec b/config.gemspec index dfb0c2dc..89ccaaf2 100644 --- a/config.gemspec +++ b/config.gemspec @@ -30,11 +30,11 @@ Gem::Specification.new do |s| s.add_dependency 'deep_merge', '~> 1.2', '>= 1.2.1' s.add_dependency 'ostruct' - s.add_development_dependency 'dry-validation', *Config::DryValidationRequirements::VERSIONS s.add_development_dependency 'rake', '~> 12.0', '>= 12.0.0' # Testing s.add_development_dependency 'appraisal', '~> 2.5', '>= 2.5.0' + s.add_development_dependency 'dry-validation', *Config::DryValidationRequirements::VERSIONS s.add_development_dependency 'rspec', '~> 3.9', '>= 3.9.0' # Default RSpec run will test against latest Rails app From 989ea126596ac06c63aafd863e723958d728ebee Mon Sep 17 00:00:00 2001 From: Piotr Kuczynski Date: Tue, 8 Jul 2025 13:00:04 +0200 Subject: [PATCH 4/8] req dry/core ony for jruby? --- spec/validation_spec.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/spec/validation_spec.rb b/spec/validation_spec.rb index d04fd6a0..e9a3bc1b 100644 --- a/spec/validation_spec.rb +++ b/spec/validation_spec.rb @@ -1,4 +1,5 @@ require 'spec_helper' +require 'dry/core' if RUBY_ENGINE == 'jruby' require 'dry/validation' describe Config do From a8812ce445d92a269f8a49f20410981f6a02c682 Mon Sep 17 00:00:00 2001 From: Piotr Kuczynski Date: Tue, 8 Jul 2025 13:09:58 +0200 Subject: [PATCH 5/8] revert --- spec/validation_spec.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/spec/validation_spec.rb b/spec/validation_spec.rb index e9a3bc1b..d04fd6a0 100644 --- a/spec/validation_spec.rb +++ b/spec/validation_spec.rb @@ -1,5 +1,4 @@ require 'spec_helper' -require 'dry/core' if RUBY_ENGINE == 'jruby' require 'dry/validation' describe Config do From 34a13495bfb74473a3728eabd7f90ccd3b3be33f Mon Sep 17 00:00:00 2001 From: Piotr Kuczynski Date: Wed, 9 Jul 2025 13:36:13 +0200 Subject: [PATCH 6/8] switch to jruby-9 --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8290ee8c..dcdaa42e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -23,7 +23,7 @@ jobs: - 3.1 - 3.2 - 3.3 - - jruby + - jruby-9 - truffleruby steps: - name: Checkout From e077de77a7be204b717fb56d83ec99fcc8b24f2f Mon Sep 17 00:00:00 2001 From: Piotr Kuczynski Date: Wed, 9 Jul 2025 13:51:59 +0200 Subject: [PATCH 7/8] check this --- Appraisals | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Appraisals b/Appraisals index 630712ce..38bded74 100644 --- a/Appraisals +++ b/Appraisals @@ -21,8 +21,8 @@ end appraise 'rails-6.1' do gem 'activerecord-jdbcsqlite3-adapter', '~> 61.1', platform: :jruby gem 'bootsnap', '>= 1.4.4' - gem 'drb', '~> 2.2' if RUBY_VERSION >= '3.4' - gem 'mutex_m', '~> 0.2.0' if RUBY_VERSION >= '3.4' + gem 'drb', '~> 2.2' if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.4') + gem 'mutex_m', '~> 0.2.0' if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.4') gem 'rails', '6.1.7.10' gem 'rspec-rails', '~> 5.0' gem 'sqlite3', '~> 1.4', platform: :ruby @@ -32,13 +32,13 @@ end # Temporarily exclude Truffleruby and JRuby from testing in Rails 7.x until they fix the issues upstream. # See https://github.com/rubyconfig/config/pull/344#issuecomment-1766209753 # if (RUBY_ENGINE == 'ruby' && RUBY_VERSION >= '2.7') || RUBY_ENGINE != 'ruby' -if RUBY_ENGINE == 'ruby' && RUBY_VERSION >= '2.7' +if RUBY_ENGINE == 'ruby' && if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.7') appraise 'rails-7.0' do gem 'activerecord-jdbcsqlite3-adapter', '~> 70.1', platform: :jruby gem 'sqlite3', '~> 1.6.4', platform: :ruby gem 'bootsnap', '>= 1.4.4' - gem 'drb', '~> 2.2' if RUBY_VERSION >= '3.4' - gem 'mutex_m', '~> 0.2.0' if RUBY_VERSION >= '3.4' + gem 'drb', '~> 2.2' if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.4') + gem 'mutex_m', '~> 0.2.0' if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.4') gem 'rails', '7.0.8.7' gem 'rspec-rails', '~> 6.0.3' gem 'sprockets-rails', '~> 3.4.2' From 3018576d793cc90ec6624f2e11011b84f6956113 Mon Sep 17 00:00:00 2001 From: Piotr Kuczynski Date: Wed, 9 Jul 2025 13:59:20 +0200 Subject: [PATCH 8/8] Revert "check this" This reverts commit e077de77a7be204b717fb56d83ec99fcc8b24f2f. --- Appraisals | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Appraisals b/Appraisals index 38bded74..630712ce 100644 --- a/Appraisals +++ b/Appraisals @@ -21,8 +21,8 @@ end appraise 'rails-6.1' do gem 'activerecord-jdbcsqlite3-adapter', '~> 61.1', platform: :jruby gem 'bootsnap', '>= 1.4.4' - gem 'drb', '~> 2.2' if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.4') - gem 'mutex_m', '~> 0.2.0' if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.4') + gem 'drb', '~> 2.2' if RUBY_VERSION >= '3.4' + gem 'mutex_m', '~> 0.2.0' if RUBY_VERSION >= '3.4' gem 'rails', '6.1.7.10' gem 'rspec-rails', '~> 5.0' gem 'sqlite3', '~> 1.4', platform: :ruby @@ -32,13 +32,13 @@ end # Temporarily exclude Truffleruby and JRuby from testing in Rails 7.x until they fix the issues upstream. # See https://github.com/rubyconfig/config/pull/344#issuecomment-1766209753 # if (RUBY_ENGINE == 'ruby' && RUBY_VERSION >= '2.7') || RUBY_ENGINE != 'ruby' -if RUBY_ENGINE == 'ruby' && if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.7') +if RUBY_ENGINE == 'ruby' && RUBY_VERSION >= '2.7' appraise 'rails-7.0' do gem 'activerecord-jdbcsqlite3-adapter', '~> 70.1', platform: :jruby gem 'sqlite3', '~> 1.6.4', platform: :ruby gem 'bootsnap', '>= 1.4.4' - gem 'drb', '~> 2.2' if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.4') - gem 'mutex_m', '~> 0.2.0' if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.4') + gem 'drb', '~> 2.2' if RUBY_VERSION >= '3.4' + gem 'mutex_m', '~> 0.2.0' if RUBY_VERSION >= '3.4' gem 'rails', '7.0.8.7' gem 'rspec-rails', '~> 6.0.3' gem 'sprockets-rails', '~> 3.4.2'