From c139cec0c3018be88f2c49183faa73724a8a0736 Mon Sep 17 00:00:00 2001 From: Nony Dutton Date: Sat, 17 Jun 2023 17:41:14 +0200 Subject: [PATCH] Test Rails 7.0 with mysql2 and trilogy Removes mysql2 as a direct dependency and creates two separate Rails 7.0 gemfiles, one with `mysql2`, one with `activerecord-trilogy-adapter`. Adds both gemfiles to CI to test each. --- .github/workflows/ci.yml | 3 +- active_record_host_pool.gemspec | 1 - gemfiles/rails5.1.gemfile.lock | 1 - gemfiles/rails5.2.gemfile.lock | 1 - gemfiles/rails6.0.gemfile.lock | 1 - gemfiles/rails6.1.gemfile.lock | 1 - ...ils7.0.gemfile => rails7.0_mysql2.gemfile} | 0 ...file.lock => rails7.0_mysql2.gemfile.lock} | 35 ++++---- gemfiles/rails7.0_trilogy.gemfile | 10 +++ gemfiles/rails7.0_trilogy.gemfile.lock | 86 +++++++++++++++++++ 10 files changed, 116 insertions(+), 23 deletions(-) rename gemfiles/{rails7.0.gemfile => rails7.0_mysql2.gemfile} (100%) rename gemfiles/{rails7.0.gemfile.lock => rails7.0_mysql2.gemfile.lock} (77%) create mode 100644 gemfiles/rails7.0_trilogy.gemfile create mode 100644 gemfiles/rails7.0_trilogy.gemfile.lock diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3e814f9e..4b9d43c7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,7 +38,8 @@ jobs: - "3.2" gemfile: - rails6.1 - - rails7.0 + - rails7.0_mysql2 + - rails7.0_trilogy legacy_connection_handling: - "false" - "true" diff --git a/active_record_host_pool.gemspec b/active_record_host_pool.gemspec index 181b5cd4..5c1ba256 100644 --- a/active_record_host_pool.gemspec +++ b/active_record_host_pool.gemspec @@ -29,5 +29,4 @@ Gem::Specification.new do |s| s.required_ruby_version = ">= 2.7.0" s.add_runtime_dependency("activerecord", ">= 5.1.0", "< 7.1") - s.add_runtime_dependency("mysql2") end diff --git a/gemfiles/rails5.1.gemfile.lock b/gemfiles/rails5.1.gemfile.lock index aa982c5a..f99f73a0 100644 --- a/gemfiles/rails5.1.gemfile.lock +++ b/gemfiles/rails5.1.gemfile.lock @@ -3,7 +3,6 @@ PATH specs: active_record_host_pool (1.2.4) activerecord (>= 5.1.0, < 7.1) - mysql2 GEM remote: https://rubygems.org/ diff --git a/gemfiles/rails5.2.gemfile.lock b/gemfiles/rails5.2.gemfile.lock index 8b6342e9..0082ff9e 100644 --- a/gemfiles/rails5.2.gemfile.lock +++ b/gemfiles/rails5.2.gemfile.lock @@ -3,7 +3,6 @@ PATH specs: active_record_host_pool (1.2.4) activerecord (>= 5.1.0, < 7.1) - mysql2 GEM remote: https://rubygems.org/ diff --git a/gemfiles/rails6.0.gemfile.lock b/gemfiles/rails6.0.gemfile.lock index 9d6c41d2..bcc56d0b 100644 --- a/gemfiles/rails6.0.gemfile.lock +++ b/gemfiles/rails6.0.gemfile.lock @@ -3,7 +3,6 @@ PATH specs: active_record_host_pool (1.2.4) activerecord (>= 5.1.0, < 7.1) - mysql2 GEM remote: https://rubygems.org/ diff --git a/gemfiles/rails6.1.gemfile.lock b/gemfiles/rails6.1.gemfile.lock index ade736a1..231b8433 100644 --- a/gemfiles/rails6.1.gemfile.lock +++ b/gemfiles/rails6.1.gemfile.lock @@ -3,7 +3,6 @@ PATH specs: active_record_host_pool (1.2.4) activerecord (>= 5.1.0, < 7.1) - mysql2 GEM remote: https://rubygems.org/ diff --git a/gemfiles/rails7.0.gemfile b/gemfiles/rails7.0_mysql2.gemfile similarity index 100% rename from gemfiles/rails7.0.gemfile rename to gemfiles/rails7.0_mysql2.gemfile diff --git a/gemfiles/rails7.0.gemfile.lock b/gemfiles/rails7.0_mysql2.gemfile.lock similarity index 77% rename from gemfiles/rails7.0.gemfile.lock rename to gemfiles/rails7.0_mysql2.gemfile.lock index dbfafab5..ef44e5c8 100644 --- a/gemfiles/rails7.0.gemfile.lock +++ b/gemfiles/rails7.0_mysql2.gemfile.lock @@ -3,17 +3,16 @@ PATH specs: active_record_host_pool (1.2.4) activerecord (>= 5.1.0, < 7.1) - mysql2 GEM remote: https://rubygems.org/ specs: - activemodel (7.0.4.3) - activesupport (= 7.0.4.3) - activerecord (7.0.4.3) - activemodel (= 7.0.4.3) - activesupport (= 7.0.4.3) - activesupport (7.0.4.3) + activemodel (7.0.5) + activesupport (= 7.0.5) + activerecord (7.0.5) + activemodel (= 7.0.5) + activesupport (= 7.0.5) + activesupport (7.0.5) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) @@ -21,22 +20,23 @@ GEM ast (2.4.2) byebug (11.1.3) coderay (1.1.3) - concurrent-ruby (1.1.10) - i18n (1.12.0) + concurrent-ruby (1.2.2) + i18n (1.14.1) concurrent-ruby (~> 1.0) - jaro_winkler (1.5.4) + jaro_winkler (1.5.6) method_source (1.0.0) - minitest (5.16.3) + minitest (5.18.1) minitest-fail-fast (0.1.0) minitest (~> 5) minitest-line (0.6.5) minitest (~> 5.0) minitest-mock_expectations (1.1.3) mysql2 (0.5.5) - parallel (1.22.1) - parser (3.1.2.1) + parallel (1.23.0) + parser (3.2.2.3) ast (~> 2.4.1) - phenix (1.0.1) + racc + phenix (1.1.0) activerecord (>= 4.2, < 7.1) bundler pry (0.14.2) @@ -45,6 +45,7 @@ GEM pry-byebug (3.10.1) byebug (~> 11.0) pry (>= 0.13, < 0.15) + racc (1.7.1) rainbow (3.1.1) rake (13.0.6) rexml (3.2.5) @@ -56,8 +57,8 @@ GEM rexml ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 1.7) - ruby-progressbar (1.11.0) - tzinfo (2.0.5) + ruby-progressbar (1.13.0) + tzinfo (2.0.6) concurrent-ruby (~> 1.0) unicode-display_width (1.6.1) @@ -79,4 +80,4 @@ DEPENDENCIES rubocop (~> 0.80.0) BUNDLED WITH - 2.4.8 + 2.4.13 diff --git a/gemfiles/rails7.0_trilogy.gemfile b/gemfiles/rails7.0_trilogy.gemfile new file mode 100644 index 00000000..4bfb75cb --- /dev/null +++ b/gemfiles/rails7.0_trilogy.gemfile @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +source 'https://rubygems.org' + +gemspec path: '../' + +gem 'activerecord', '~> 7.0.0' +gem 'activerecord-trilogy-adapter', '>= 3.0' + +eval_gemfile 'common.rb' diff --git a/gemfiles/rails7.0_trilogy.gemfile.lock b/gemfiles/rails7.0_trilogy.gemfile.lock new file mode 100644 index 00000000..eb431b62 --- /dev/null +++ b/gemfiles/rails7.0_trilogy.gemfile.lock @@ -0,0 +1,86 @@ +PATH + remote: .. + specs: + active_record_host_pool (1.2.4) + activerecord (>= 5.1.0, < 7.1) + +GEM + remote: https://rubygems.org/ + specs: + activemodel (7.0.5) + activesupport (= 7.0.5) + activerecord (7.0.5) + activemodel (= 7.0.5) + activesupport (= 7.0.5) + activerecord-trilogy-adapter (3.0.0) + activerecord (>= 7.0, < 7.1a) + trilogy (>= 2.4.0) + activesupport (7.0.5) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 1.6, < 2) + minitest (>= 5.1) + tzinfo (~> 2.0) + ast (2.4.2) + byebug (11.1.3) + coderay (1.1.3) + concurrent-ruby (1.2.2) + i18n (1.14.1) + concurrent-ruby (~> 1.0) + jaro_winkler (1.5.6) + method_source (1.0.0) + minitest (5.18.1) + minitest-fail-fast (0.1.0) + minitest (~> 5) + minitest-line (0.6.5) + minitest (~> 5.0) + minitest-mock_expectations (1.1.3) + parallel (1.23.0) + parser (3.2.2.3) + ast (~> 2.4.1) + racc + phenix (1.1.0) + activerecord (>= 4.2, < 7.1) + bundler + pry (0.14.2) + coderay (~> 1.1) + method_source (~> 1.0) + pry-byebug (3.10.1) + byebug (~> 11.0) + pry (>= 0.13, < 0.15) + racc (1.7.1) + rainbow (3.1.1) + rake (13.0.6) + rexml (3.2.5) + rubocop (0.80.1) + jaro_winkler (~> 1.5.1) + parallel (~> 1.10) + parser (>= 2.7.0.1) + rainbow (>= 2.2.2, < 4.0) + rexml + ruby-progressbar (~> 1.7) + unicode-display_width (>= 1.4.0, < 1.7) + ruby-progressbar (1.13.0) + trilogy (2.4.1) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + unicode-display_width (1.6.1) + +PLATFORMS + ruby + +DEPENDENCIES + active_record_host_pool! + activerecord (~> 7.0.0) + activerecord-trilogy-adapter (>= 3.0) + byebug + minitest (>= 5.10.0) + minitest-fail-fast + minitest-line + minitest-mock_expectations (~> 1.1.3) + phenix (>= 1.0.1) + pry-byebug (~> 3.9) + rake (>= 12.0.0) + rubocop (~> 0.80.0) + +BUNDLED WITH + 2.4.13