diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2f5beb76..02d307d6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,9 +13,10 @@ jobs: strategy: fail-fast: false + max-parallel: 8 matrix: - activerecord: ["6.1", "7.0", "7.1"] - ruby: ["3.0", "3.1", "3.2", "3.3", "head"] + activerecord: ["6.1", "7.0", "7.1", "head"] + ruby: ["3.1", "3.2", "3.3", "head"] mysql: ["5.7", "8.0"] adapter: ["mysql2", "trilogy"] exclude: @@ -23,6 +24,8 @@ jobs: ruby: head - activerecord: 7.0 ruby: head + - activerecord: head + ruby: 3.0 env: BUNDLE_GEMFILE: "${{ github.workspace }}/gemfiles/activerecord_${{ matrix.activerecord }}.gemfile" diff --git a/CHANGELOG.md b/CHANGELOG.md index 10c1815b..6959e8f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Unreleased +# 4.3.0 (Aug, 2024) +* Drop support for Ruby 3.0, as it reached its EOL +* Add support for next Rails version + # 4.2.3 (Jul, 2024) * Fix check for warnings against PKs with line breaks diff --git a/Gemfile.lock b/Gemfile.lock index 825376ae..ece21e77 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,19 +1,19 @@ PATH remote: . specs: - lhm-shopify (4.2.3) + lhm-shopify (4.3.0) retriable (>= 3.0.0) GEM remote: https://rubygems.org/ specs: - activemodel (7.1.1) - activesupport (= 7.1.1) - activerecord (7.1.1) - activemodel (= 7.1.1) - activesupport (= 7.1.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) - activesupport (7.1.1) + activesupport (7.1.3.4) base64 bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) @@ -28,22 +28,21 @@ GEM bundler rake thor (>= 0.14.0) - base64 (0.1.1) - bigdecimal (3.1.4) + base64 (0.2.0) + bigdecimal (3.1.8) byebug (11.1.3) - concurrent-ruby (1.2.2) + concurrent-ruby (1.3.3) connection_pool (2.4.1) - docile (1.4.0) - drb (2.1.1) - ruby2_keywords - i18n (1.14.1) + docile (1.4.1) + drb (2.2.1) + i18n (1.14.5) concurrent-ruby (~> 1.0) - minitest (5.22.2) - mocha (2.1.0) + minitest (5.24.1) + mocha (2.4.5) ruby2_keywords (>= 0.0.5) - mutex_m (0.1.2) - mysql2 (0.5.5) - rake (13.0.6) + mutex_m (0.2.0) + mysql2 (0.5.6) + rake (13.2.1) retriable (3.1.2) ruby2_keywords (0.0.5) simplecov (0.22.0) @@ -52,10 +51,10 @@ GEM simplecov_json_formatter (~> 0.1) simplecov-html (0.12.3) simplecov_json_formatter (0.1.4) - thor (1.2.2) - timeout (0.4.0) + thor (1.3.1) + timeout (0.4.1) toxiproxy (2.0.2) - trilogy (2.6.0) + trilogy (2.8.1) tzinfo (2.0.6) concurrent-ruby (~> 1.0) diff --git a/dev.yml b/dev.yml index aeb570f1..85430e38 100644 --- a/dev.yml +++ b/dev.yml @@ -1,9 +1,7 @@ name: lhm up: - - homebrew: - - mysql-client@5.7: - or: [mysql@5.7] - conflicts: [shopify/shopify/mysql-client, mysql-connector-c, mysql, mysql-client] + - packages: + - mysql-client@5.7 - wget - ruby - bundler diff --git a/gemfiles/activerecord_6.1.gemfile.lock b/gemfiles/activerecord_6.1.gemfile.lock index 7ba456e0..df040da1 100644 --- a/gemfiles/activerecord_6.1.gemfile.lock +++ b/gemfiles/activerecord_6.1.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - lhm-shopify (4.2.3) + lhm-shopify (4.3.0) retriable (>= 3.0.0) GEM diff --git a/gemfiles/activerecord_7.0.gemfile.lock b/gemfiles/activerecord_7.0.gemfile.lock index e6c6164c..b89fd98f 100644 --- a/gemfiles/activerecord_7.0.gemfile.lock +++ b/gemfiles/activerecord_7.0.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - lhm-shopify (4.2.3) + lhm-shopify (4.3.0) retriable (>= 3.0.0) GEM diff --git a/gemfiles/activerecord_7.1.gemfile.lock b/gemfiles/activerecord_7.1.gemfile.lock index e7a2153f..88cd40f9 100644 --- a/gemfiles/activerecord_7.1.gemfile.lock +++ b/gemfiles/activerecord_7.1.gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - lhm-shopify (4.2.3) + lhm-shopify (4.3.0) retriable (>= 3.0.0) GEM diff --git a/gemfiles/activerecord_head.gemfile b/gemfiles/activerecord_head.gemfile new file mode 100644 index 00000000..05d9d8f0 --- /dev/null +++ b/gemfiles/activerecord_head.gemfile @@ -0,0 +1,7 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "activerecord", git: "https://github.com/rails/rails.git", branch: "main" + +gemspec path: "../" diff --git a/lib/lhm/sql_helper.rb b/lib/lhm/sql_helper.rb index ce2e77bd..8e819864 100644 --- a/lib/lhm/sql_helper.rb +++ b/lib/lhm/sql_helper.rb @@ -65,7 +65,7 @@ def supports_atomic_switch? end def struct_key(struct, key) - keys = if struct.is_a? Hash + keys = if struct.respond_to?(:keys) struct.keys else struct.members diff --git a/lib/lhm/version.rb b/lib/lhm/version.rb index 4501248c..60096e2d 100644 --- a/lib/lhm/version.rb +++ b/lib/lhm/version.rb @@ -2,5 +2,5 @@ # Schmidt module Lhm - VERSION = '4.2.3' + VERSION = '4.3.0' end diff --git a/spec/integration/lhm_spec.rb b/spec/integration/lhm_spec.rb index 5be4b3ee..85814605 100644 --- a/spec/integration/lhm_spec.rb +++ b/spec/integration/lhm_spec.rb @@ -328,8 +328,7 @@ :collate => collation, }) - result = select_one('SELECT login from users') - result = result['login'] if result.respond_to?(:has_key?) + result = select_value('SELECT login from users') value(result).must_equal('a user') end end @@ -353,8 +352,7 @@ :collate => collation, }) - result = select_one('SELECT `fnord` from users') - result = result['fnord'] if result.respond_to?(:has_key?) + result = select_value('SELECT `fnord` from users') value(result).must_equal('Superfriends') end end @@ -380,8 +378,7 @@ :collate => 'utf8mb4_unicode_ci', }) - result = select_one('SELECT `user_name` from users') - result = result['user_name'] if result.respond_to?(:has_key?) + result = select_value('SELECT `user_name` from users') value(result).must_equal('a user') end end @@ -410,8 +407,7 @@ :collate => nil, }) - result = select_one('SELECT `ref` from users') - result = result['ref'] if result.respond_to?(:has_key?) + result = select_value('SELECT `ref` from users') value(result).must_equal(10) end end @@ -437,8 +433,7 @@ :collate => collation, }) - result = select_one('SELECT `fnord` from users') - result = result['fnord'] if result.respond_to?(:has_key?) + result = select_value('SELECT `fnord` from users') assert_nil(result) end end @@ -462,8 +457,7 @@ :collate => collation, }) - result = select_one('SELECT `user_name` from users') - result = result['user_name'] if result.respond_to?(:has_key?) + result = select_value('SELECT `user_name` from users') value(result).must_equal('a user') end end @@ -489,8 +483,7 @@ :collate => collation, }) - result = select_one('SELECT `user_name` from users') - result = result['user_name'] if result.respond_to?(:has_key?) + result = select_value('SELECT `user_name` from users') value(result).must_equal('a user') end end