From a33a47dee4d9f71aa19a39f16faed69a1660e76d Mon Sep 17 00:00:00 2001 From: Juli Tera Date: Tue, 27 May 2025 08:36:33 -0700 Subject: [PATCH 01/11] Bump min ruby version --- .github/workflows/ci.yml | 11 +++++------ .rubocop.yml | 2 +- CHANGELOG.md | 2 ++ Gemfile | 2 +- aws-record.gemspec | 5 ++--- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3bbbc37..3463855 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,12 +11,11 @@ on: jobs: test: - # change to ubuntu-latest once Ruby 2.5 and JRuby 9.2 is dropped - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest strategy: fail-fast: false matrix: - ruby: [2.3, 2.4, 2.5, 2.6, 2.7, '3.0', 3.1, 3.2, jruby-9.1, jruby-9.2, jruby-9.3, jruby-9.4] + ruby: [2.7, '3.0', 3.1, 3.2, 3.3, 3.4, jruby-9.4] env: [NEW_RAILS, OLD_RAILS] steps: @@ -32,7 +31,7 @@ jobs: - name: Install run: | - echo NEW_RAIS=$NEW_RAILS OLD_RAILS=$OLD_RAILS + echo NEW_RAILS=$NEW_RAILS OLD_RAILS=$OLD_RAILS bundle install --without docs - name: Test @@ -42,10 +41,10 @@ jobs: runs-on: ubuntu-latest steps: - - name: Set up Ruby 3.2 + - name: Set up Ruby 3.4 uses: ruby/setup-ruby@v1 with: - ruby-version: 3.2 + ruby-version: 3.4 - uses: actions/checkout@v2 diff --git a/.rubocop.yml b/.rubocop.yml index ccb956f..be3a6ff 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -2,7 +2,7 @@ inherit_from: .rubocop_todo.yml AllCops: NewCops: enable - TargetRubyVersion: 2.3 + TargetRubyVersion: 2.7 Exclude: - 'tasks/release/**/*' diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f56129..0b28189 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ Unreleased Changes ------------------ +* Feature - Drop Ruby runtime support for 2.5 and 2.6. + 2.13.4 (2025-05-21) ------------------ diff --git a/Gemfile b/Gemfile index d8e2a41..c38c4e6 100644 --- a/Gemfile +++ b/Gemfile @@ -17,7 +17,7 @@ group :test do if ENV['NEW_RAILS'] gem 'activemodel' else - gem 'activemodel', '< 5.0' + gem 'activemodel', '< 7.0' end end diff --git a/aws-record.gemspec b/aws-record.gemspec index d17110f..39a4391 100644 --- a/aws-record.gemspec +++ b/aws-record.gemspec @@ -13,8 +13,7 @@ Gem::Specification.new do |spec| spec.require_paths = ['lib'] spec.files = Dir['lib/**/*.rb', 'LICENSE', 'CHANGELOG.md', 'VERSION'] - # Require 1.85.0 for user_agent_frameworks config - spec.add_dependency 'aws-sdk-dynamodb', '~> 1', '>= 1.85.0' + spec.add_dependency 'aws-sdk-dynamodb', '~> 1', '>= 1.144.0' - spec.required_ruby_version = '>= 2.3' + spec.required_ruby_version = '>= 2.7' end From 529b8199cbb46031eebc65031ab0f21f3bfb0c30 Mon Sep 17 00:00:00 2001 From: Juli Tera Date: Tue, 27 May 2025 08:47:01 -0700 Subject: [PATCH 02/11] Fix CI failures --- features/transactions/step_definitions.rb | 8 +++----- lib/aws-record/record/batch_read.rb | 4 +++- spec/spec_helper.rb | 1 + 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/features/transactions/step_definitions.rb b/features/transactions/step_definitions.rb index f91333f..ca38d34 100644 --- a/features/transactions/step_definitions.rb +++ b/features/transactions/step_definitions.rb @@ -29,11 +29,9 @@ end When('we run the following code:') do |code| - begin - @arbitrary_code_ret = eval(code) - rescue StandardError => e - @arbitrary_code_exception = e - end + @arbitrary_code_ret = eval(code) +rescue StandardError => e + @arbitrary_code_exception = e end Then('we expect the code to raise an {string} exception') do |exception_class| diff --git a/lib/aws-record/record/batch_read.rb b/lib/aws-record/record/batch_read.rb index 8d7177c..b5fd619 100644 --- a/lib/aws-record/record/batch_read.rb +++ b/lib/aws-record/record/batch_read.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require 'mutex_m' + module Aws module Record class BatchRead @@ -38,7 +40,7 @@ def find(klass, key = {}) # @return [Array] an array of unordered new items def execute! operation_keys = unprocessed_keys[0..BATCH_GET_ITEM_LIMIT - 1] - @unprocessed_keys = unprocessed_keys[BATCH_GET_ITEM_LIMIT..-1] || [] + @unprocessed_keys = unprocessed_keys[BATCH_GET_ITEM_LIMIT..] || [] operations = build_operations(operation_keys) result = @client.batch_get_item(request_items: operations) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index a22cc3a..2f294eb 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -5,4 +5,5 @@ SimpleCov.start require 'aws-record' +require 'mutex_m' require 'active_model' From 93250140b00d9468e45c54aeec2d002fd28d8b3a Mon Sep 17 00:00:00 2001 From: Juli Tera Date: Tue, 27 May 2025 08:47:47 -0700 Subject: [PATCH 03/11] Remove unnecessary require --- lib/aws-record/record/batch_read.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/aws-record/record/batch_read.rb b/lib/aws-record/record/batch_read.rb index b5fd619..7aa544d 100644 --- a/lib/aws-record/record/batch_read.rb +++ b/lib/aws-record/record/batch_read.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require 'mutex_m' - module Aws module Record class BatchRead From 079c2dd82a157b5d60077b344d668fdca8c2c4af Mon Sep 17 00:00:00 2001 From: Juli Tera Date: Tue, 27 May 2025 08:49:07 -0700 Subject: [PATCH 04/11] Update gemfile to include mutex_m for 3.4 --- Gemfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Gemfile b/Gemfile index c38c4e6..2f60e1f 100644 --- a/Gemfile +++ b/Gemfile @@ -14,6 +14,8 @@ group :test do gem 'rexml' if RUBY_VERSION >= '3.0' + gem 'mutex_m' if RUBY_VERSION >= '3.4' + if ENV['NEW_RAILS'] gem 'activemodel' else From 4bee212f35cfb329c1daaacdb6a5f89b989aa6df Mon Sep 17 00:00:00 2001 From: Juli Tera Date: Tue, 27 May 2025 08:51:15 -0700 Subject: [PATCH 05/11] Unnecessary require --- spec/spec_helper.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 2f294eb..a22cc3a 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -5,5 +5,4 @@ SimpleCov.start require 'aws-record' -require 'mutex_m' require 'active_model' From bac1f9c2278520105ba57e18cd2ff71a59870fc4 Mon Sep 17 00:00:00 2001 From: Juli Tera Date: Wed, 28 May 2025 07:37:58 -0700 Subject: [PATCH 06/11] Address feedbacks --- .github/workflows/ci.yml | 4 +--- Gemfile | 7 +------ aws-record.gemspec | 3 ++- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3463855..326e441 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,8 +15,7 @@ jobs: strategy: fail-fast: false matrix: - ruby: [2.7, '3.0', 3.1, 3.2, 3.3, 3.4, jruby-9.4] - env: [NEW_RAILS, OLD_RAILS] + ruby: [2.7, '3.0', 3.1, 3.2, 3.3, 3.4, jruby-9.4, jruby-10.0] steps: - name: Setup @@ -31,7 +30,6 @@ jobs: - name: Install run: | - echo NEW_RAILS=$NEW_RAILS OLD_RAILS=$OLD_RAILS bundle install --without docs - name: Test diff --git a/Gemfile b/Gemfile index 2f60e1f..d246b7f 100644 --- a/Gemfile +++ b/Gemfile @@ -11,16 +11,11 @@ group :test do gem 'rspec' gem 'simplecov', require: false + gem 'activemodel', '< 7.0' gem 'rexml' if RUBY_VERSION >= '3.0' - gem 'mutex_m' if RUBY_VERSION >= '3.4' - if ENV['NEW_RAILS'] - gem 'activemodel' - else - gem 'activemodel', '< 7.0' - end end group :docs do diff --git a/aws-record.gemspec b/aws-record.gemspec index 39a4391..c34cbb8 100644 --- a/aws-record.gemspec +++ b/aws-record.gemspec @@ -13,7 +13,8 @@ Gem::Specification.new do |spec| spec.require_paths = ['lib'] spec.files = Dir['lib/**/*.rb', 'LICENSE', 'CHANGELOG.md', 'VERSION'] - spec.add_dependency 'aws-sdk-dynamodb', '~> 1', '>= 1.144.0' + # Require 1.85.0 for user_agent_frameworks config + spec.add_dependency 'aws-sdk-dynamodb', '~> 1', '>= 1.85.0' spec.required_ruby_version = '>= 2.7' end From 5c0723d953424881742c5d2dfd2fe3fd677c8e21 Mon Sep 17 00:00:00 2001 From: Juli Tera Date: Wed, 28 May 2025 07:40:09 -0700 Subject: [PATCH 07/11] Fix CI --- .github/workflows/ci.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 326e441..9ea35ef 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,6 +15,7 @@ jobs: strategy: fail-fast: false matrix: + # jruby-10.0 expected to fail until fix is live: https://github.com/jruby/jruby/issues/8847 ruby: [2.7, '3.0', 3.1, 3.2, 3.3, 3.4, jruby-9.4, jruby-10.0] steps: @@ -25,9 +26,6 @@ jobs: - uses: actions/checkout@v2 - - name: Environment - run: echo "${{ matrix.env }}=1" >> $GITHUB_ENV - - name: Install run: | bundle install --without docs From c85a77d29f26d7270526a1e8206117aed8294dfe Mon Sep 17 00:00:00 2001 From: Juli Tera Date: Wed, 28 May 2025 07:42:07 -0700 Subject: [PATCH 08/11] Appease rubocop --- Gemfile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index d246b7f..d4239e0 100644 --- a/Gemfile +++ b/Gemfile @@ -10,12 +10,11 @@ group :test do gem 'cucumber' gem 'rspec' - gem 'simplecov', require: false gem 'activemodel', '< 7.0' + gem 'simplecov', require: false - gem 'rexml' if RUBY_VERSION >= '3.0' gem 'mutex_m' if RUBY_VERSION >= '3.4' - + gem 'rexml' if RUBY_VERSION >= '3.0' end group :docs do From 709184fd7d51c49de1f597ae90f462b05197dec6 Mon Sep 17 00:00:00 2001 From: Juli Tera Date: Wed, 28 May 2025 07:44:52 -0700 Subject: [PATCH 09/11] Remove Jruby comment --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9ea35ef..89aa07d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,6 @@ jobs: strategy: fail-fast: false matrix: - # jruby-10.0 expected to fail until fix is live: https://github.com/jruby/jruby/issues/8847 ruby: [2.7, '3.0', 3.1, 3.2, 3.3, 3.4, jruby-9.4, jruby-10.0] steps: From 82eac63832df3ca0d4194742031a1b318ad02e79 Mon Sep 17 00:00:00 2001 From: Juli Tera Date: Wed, 28 May 2025 07:57:13 -0700 Subject: [PATCH 10/11] Address feedback --- Gemfile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index d4239e0..a81b219 100644 --- a/Gemfile +++ b/Gemfile @@ -7,12 +7,10 @@ gemspec gem 'rake', require: false group :test do + gem 'activemodel' gem 'cucumber' gem 'rspec' - - gem 'activemodel', '< 7.0' gem 'simplecov', require: false - gem 'mutex_m' if RUBY_VERSION >= '3.4' gem 'rexml' if RUBY_VERSION >= '3.0' end From b9ce6fc40e10d7e3384591faaa2a9b77c0ab76d0 Mon Sep 17 00:00:00 2001 From: Juli Tera Date: Wed, 28 May 2025 08:00:51 -0700 Subject: [PATCH 11/11] Rubocop --- Gemfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index a81b219..0ace478 100644 --- a/Gemfile +++ b/Gemfile @@ -7,10 +7,12 @@ gemspec gem 'rake', require: false group :test do - gem 'activemodel' gem 'cucumber' gem 'rspec' gem 'simplecov', require: false + + gem 'activemodel' + gem 'mutex_m' if RUBY_VERSION >= '3.4' gem 'rexml' if RUBY_VERSION >= '3.0' end