From 1d33bac607988918b7a1ad2cf7e4836afa41af87 Mon Sep 17 00:00:00 2001 From: John Bolliger Date: Mon, 20 Jul 2026 16:22:30 -0700 Subject: [PATCH 1/3] Add Rails 8.0, 8.1 support --- .github/workflows/main.yml | 14 ++++++++++---- .gitignore | 1 + Appraisals | 16 ++++++++++++++++ CHANGELOG.md | 6 ++++++ Gemfile | 2 ++ active_remote.gemspec | 6 +++--- gemfiles/rails_7.2.gemfile | 16 ++++++++++++++++ gemfiles/rails_8.0.gemfile | 16 ++++++++++++++++ gemfiles/rails_8.1.gemfile | 16 ++++++++++++++++ spec/lib/active_remote/association_spec.rb | 8 ++++---- 10 files changed, 90 insertions(+), 11 deletions(-) create mode 100644 Appraisals create mode 100644 gemfiles/rails_7.2.gemfile create mode 100644 gemfiles/rails_8.0.gemfile create mode 100644 gemfiles/rails_8.1.gemfile diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8602d98..f6ceb48 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 with: - ruby-version: "3.1" + ruby-version: "3.2" bundler-cache: true - run: bundle exec standardrb --parallel --format github test: @@ -23,12 +23,18 @@ jobs: strategy: fail-fast: false matrix: - ruby: [3.1, 3.2, head, debug, jruby-head, truffleruby-head] - continue-on-error: ${{ endsWith(matrix.ruby, 'head') || matrix.ruby == 'debug' }} + ruby: ["3.2", "3.3", "3.4", head] + gemfile: [rails_7.2, rails_8.0, rails_8.1] + include: + - { ruby: jruby-10.0, gemfile: rails_8.0 } + - { ruby: jruby-10.0, gemfile: rails_8.1 } + continue-on-error: ${{ endsWith(matrix.ruby, 'head') }} + env: + BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile steps: - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} - - run: bundle install + bundler-cache: true - run: bundle exec rspec diff --git a/.gitignore b/.gitignore index e087fe0..844b400 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /Gemfile.lock +gemfiles/*.gemfile.lock /.DS_Store /.bundle/ /.ruby-* diff --git a/Appraisals b/Appraisals new file mode 100644 index 0000000..e3b0920 --- /dev/null +++ b/Appraisals @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +appraise "rails-7.2" do + gem "activemodel", "~> 7.2.0" + gem "activesupport", "~> 7.2.0" +end + +appraise "rails-8.0" do + gem "activemodel", "~> 8.0.0" + gem "activesupport", "~> 8.0.0" +end + +appraise "rails-8.1" do + gem "activemodel", "~> 8.1.0" + gem "activesupport", "~> 8.1.0" +end diff --git a/CHANGELOG.md b/CHANGELOG.md index dbabdc8..e7c9251 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,8 +8,14 @@ since Active Remote depends on specific Rails versions. ## [Unreleased] +### Added + +- Support ActiveModel/ActiveSupport 8.0 and 8.1 (now allows `>= 7.2, < 8.2`) +- Test against Rails 7.2, 8.0, and 8.1 via Appraisal, including a JRuby 10.0 leg for the 8.x line + ### Changed +- Require Ruby 3.2 (to match Rails 8) - Fix Standard violations ## [7.2.0] – 2026-02-13 diff --git a/Gemfile b/Gemfile index 02a4f2b..29d8a17 100644 --- a/Gemfile +++ b/Gemfile @@ -3,6 +3,8 @@ source "https://rubygems.org" # Specify your gem's dependencies in active_remote.gemspec gemspec +gem "appraisal" + gem "benchmark-ips" gem "protobuf-rspec", ">= 1.1.2" diff --git a/active_remote.gemspec b/active_remote.gemspec index 8344085..6b80620 100644 --- a/active_remote.gemspec +++ b/active_remote.gemspec @@ -12,7 +12,7 @@ Gem::Specification.new do |spec| spec.description = "Active Remote provides Active Record-like object-relational mapping over RPC. It was written for use with Google Protocol Buffers, but could be extended to use any RPC data format." spec.homepage = "https://github.com/liveh2o/active_remote" spec.license = "MIT" - spec.required_ruby_version = ">= 3.1.0" + spec.required_ruby_version = ">= 3.2.0" spec.metadata["homepage_uri"] = spec.homepage spec.metadata["source_code_uri"] = spec.homepage @@ -34,7 +34,7 @@ Gem::Specification.new do |spec| ## # Dependencies # - spec.add_dependency "activemodel", "~> 7.2.0" - spec.add_dependency "activesupport", "~> 7.2.0" + spec.add_dependency "activemodel", ">= 7.2", "< 8.2" + spec.add_dependency "activesupport", ">= 7.2", "< 8.2" spec.add_dependency "protobuf", ">= 3.0" end diff --git a/gemfiles/rails_7.2.gemfile b/gemfiles/rails_7.2.gemfile new file mode 100644 index 0000000..b8b57f1 --- /dev/null +++ b/gemfiles/rails_7.2.gemfile @@ -0,0 +1,16 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "appraisal" +gem "benchmark-ips" +gem "protobuf-rspec", ">= 1.1.2" +gem "rake", "~> 13.0" +gem "rspec-pride", ">= 3.1.0" +gem "rspec", "~> 3.0" +gem "simplecov" +gem "standard", "~> 1.3" +gem "activemodel", "~> 7.2.0" +gem "activesupport", "~> 7.2.0" + +gemspec path: "../" diff --git a/gemfiles/rails_8.0.gemfile b/gemfiles/rails_8.0.gemfile new file mode 100644 index 0000000..fadf198 --- /dev/null +++ b/gemfiles/rails_8.0.gemfile @@ -0,0 +1,16 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "appraisal" +gem "benchmark-ips" +gem "protobuf-rspec", ">= 1.1.2" +gem "rake", "~> 13.0" +gem "rspec-pride", ">= 3.1.0" +gem "rspec", "~> 3.0" +gem "simplecov" +gem "standard", "~> 1.3" +gem "activemodel", "~> 8.0.0" +gem "activesupport", "~> 8.0.0" + +gemspec path: "../" diff --git a/gemfiles/rails_8.1.gemfile b/gemfiles/rails_8.1.gemfile new file mode 100644 index 0000000..9a35b5a --- /dev/null +++ b/gemfiles/rails_8.1.gemfile @@ -0,0 +1,16 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "appraisal" +gem "benchmark-ips" +gem "protobuf-rspec", ">= 1.1.2" +gem "rake", "~> 13.0" +gem "rspec-pride", ">= 3.1.0" +gem "rspec", "~> 3.0" +gem "simplecov" +gem "standard", "~> 1.3" +gem "activemodel", "~> 8.1.0" +gem "activesupport", "~> 8.1.0" + +gemspec path: "../" diff --git a/spec/lib/active_remote/association_spec.rb b/spec/lib/active_remote/association_spec.rb index e092f49..6d7b3a2 100644 --- a/spec/lib/active_remote/association_spec.rb +++ b/spec/lib/active_remote/association_spec.rb @@ -48,7 +48,7 @@ end context "when user_guid doesnt exist on model " do - before { allow(subject.class).to receive_message_chain(:public_instance_methods, :include?).with(:user_guid).and_return(false) } + before { allow(subject.class).to receive(:public_method_defined?).with(:user_guid).and_return(false) } it "raises an error" do expect { subject.user }.to raise_error(::RuntimeError, /Could not find attribute/) @@ -56,7 +56,7 @@ end context "when user_guid doesnt exist on associated model " do - before { allow(Author).to receive_message_chain(:public_instance_methods, :include?).with(:user_guid).and_return(false) } + before { allow(Author).to receive(:public_method_defined?).with(:user_guid).and_return(false) } it "raises an error" do expect { subject.user }.to raise_error(::RuntimeError, /Could not find attribute/) @@ -158,7 +158,7 @@ end context "when user_guid doesnt exist on associated model " do - before { allow(Post).to receive_message_chain(:public_instance_methods, :include?).with(:user_guid).and_return(false) } + before { allow(Post).to receive(:public_method_defined?).with(:user_guid).and_return(false) } it "raises an error" do expect { subject.user_posts }.to raise_error(::RuntimeError, /Could not find attribute/) @@ -246,7 +246,7 @@ end context "when user_guid doesnt exist on associated model " do - before { allow(Author).to receive_message_chain(:public_instance_methods, :include?).with(:user_guid).and_return(false) } + before { allow(Author).to receive(:public_method_defined?).with(:user_guid).and_return(false) } it "raises an error" do expect { subject.chief_editor }.to raise_error(::RuntimeError, /Could not find attribute/) From cfa213b9b7b495b23d87fa101fd202d19f3d7172 Mon Sep 17 00:00:00 2001 From: John Bolliger Date: Mon, 20 Jul 2026 16:24:25 -0700 Subject: [PATCH 2/3] Add ruby 4.0 to the test matrix --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f6ceb48..c89e6b9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -23,7 +23,7 @@ jobs: strategy: fail-fast: false matrix: - ruby: ["3.2", "3.3", "3.4", head] + ruby: ["3.2", "3.3", "3.4", "4.0", head] gemfile: [rails_7.2, rails_8.0, rails_8.1] include: - { ruby: jruby-10.0, gemfile: rails_8.0 } From 26f426ce40ba7a3b04750fbc534d19f8922f5a4b Mon Sep 17 00:00:00 2001 From: John Bolliger Date: Mon, 20 Jul 2026 16:28:50 -0700 Subject: [PATCH 3/3] use appraisals --- .github/workflows/main.yml | 12 ++++++------ .gitignore | 1 + gemfiles/rails_7.2.gemfile | 16 ---------------- gemfiles/rails_8.0.gemfile | 16 ---------------- gemfiles/rails_8.1.gemfile | 16 ---------------- 5 files changed, 7 insertions(+), 54 deletions(-) delete mode 100644 gemfiles/rails_7.2.gemfile delete mode 100644 gemfiles/rails_8.0.gemfile delete mode 100644 gemfiles/rails_8.1.gemfile diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c89e6b9..def3940 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,17 +24,17 @@ jobs: fail-fast: false matrix: ruby: ["3.2", "3.3", "3.4", "4.0", head] - gemfile: [rails_7.2, rails_8.0, rails_8.1] + gemfile: [rails-7.2, rails-8.0, rails-8.1] include: - - { ruby: jruby-10.0, gemfile: rails_8.0 } - - { ruby: jruby-10.0, gemfile: rails_8.1 } + - { ruby: jruby-10.0, gemfile: rails-8.0 } + - { ruby: jruby-10.0, gemfile: rails-8.1 } continue-on-error: ${{ endsWith(matrix.ruby, 'head') }} - env: - BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile steps: - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} bundler-cache: true - - run: bundle exec rspec + - run: bundle exec appraisal generate + - run: bundle exec appraisal ${{ matrix.gemfile }} bundle install + - run: bundle exec appraisal ${{ matrix.gemfile }} rspec diff --git a/.gitignore b/.gitignore index 844b400..fb9677d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /Gemfile.lock +gemfiles/*.gemfile gemfiles/*.gemfile.lock /.DS_Store /.bundle/ diff --git a/gemfiles/rails_7.2.gemfile b/gemfiles/rails_7.2.gemfile deleted file mode 100644 index b8b57f1..0000000 --- a/gemfiles/rails_7.2.gemfile +++ /dev/null @@ -1,16 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "appraisal" -gem "benchmark-ips" -gem "protobuf-rspec", ">= 1.1.2" -gem "rake", "~> 13.0" -gem "rspec-pride", ">= 3.1.0" -gem "rspec", "~> 3.0" -gem "simplecov" -gem "standard", "~> 1.3" -gem "activemodel", "~> 7.2.0" -gem "activesupport", "~> 7.2.0" - -gemspec path: "../" diff --git a/gemfiles/rails_8.0.gemfile b/gemfiles/rails_8.0.gemfile deleted file mode 100644 index fadf198..0000000 --- a/gemfiles/rails_8.0.gemfile +++ /dev/null @@ -1,16 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "appraisal" -gem "benchmark-ips" -gem "protobuf-rspec", ">= 1.1.2" -gem "rake", "~> 13.0" -gem "rspec-pride", ">= 3.1.0" -gem "rspec", "~> 3.0" -gem "simplecov" -gem "standard", "~> 1.3" -gem "activemodel", "~> 8.0.0" -gem "activesupport", "~> 8.0.0" - -gemspec path: "../" diff --git a/gemfiles/rails_8.1.gemfile b/gemfiles/rails_8.1.gemfile deleted file mode 100644 index 9a35b5a..0000000 --- a/gemfiles/rails_8.1.gemfile +++ /dev/null @@ -1,16 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "appraisal" -gem "benchmark-ips" -gem "protobuf-rspec", ">= 1.1.2" -gem "rake", "~> 13.0" -gem "rspec-pride", ">= 3.1.0" -gem "rspec", "~> 3.0" -gem "simplecov" -gem "standard", "~> 1.3" -gem "activemodel", "~> 8.1.0" -gem "activesupport", "~> 8.1.0" - -gemspec path: "../"