From daaa4f187c23a1bee8fb70199be09cdbe3df018c Mon Sep 17 00:00:00 2001 From: Jared Norman Date: Thu, 12 Feb 2026 11:14:20 -0800 Subject: [PATCH 1/8] Switch to reusable GitHub Actions workflow Co-authored-by: Chris Todorov Co-authored-by: Adam Mueller --- .../extension/.github/workflows/test.yml | 58 +------------------ 1 file changed, 2 insertions(+), 56 deletions(-) diff --git a/lib/solidus_dev_support/templates/extension/.github/workflows/test.yml b/lib/solidus_dev_support/templates/extension/.github/workflows/test.yml index 4579edbb..47db34ae 100644 --- a/lib/solidus_dev_support/templates/extension/.github/workflows/test.yml +++ b/lib/solidus_dev_support/templates/extension/.github/workflows/test.yml @@ -7,65 +7,11 @@ on: pull_request: schedule: - cron: "0 0 * * 4" # every Thursday - -concurrency: - group: test-${{ github.ref_name }} - cancel-in-progress: ${{ github.ref_name != 'main' }} + workflow_call: permissions: contents: read jobs: rspec: - name: Solidus ${{ matrix.solidus-branch }}, Rails ${{ matrix.rails-version }} and Ruby ${{ matrix.ruby-version }} on ${{ matrix.database }} - runs-on: ubuntu-24.04 - strategy: - fail-fast: true - matrix: - rails-version: - - "7.0" - - "7.1" - - "7.2" - ruby-version: - - "3.1" - - "3.4" - solidus-branch: - - "v4.1" - - "v4.2" - - "v4.3" - - "v4.4" - - "v4.5" - database: - - "postgresql" - - "mysql" - - "sqlite" - exclude: - - rails-version: "7.2" - solidus-branch: "v4.3" - - rails-version: "7.2" - solidus-branch: "v4.2" - - rails-version: "7.2" - solidus-branch: "v4.1" - - rails-version: "7.1" - solidus-branch: "v4.2" - - rails-version: "7.1" - solidus-branch: "v4.1" - - ruby-version: "3.4" - rails-version: "7.0" - env: - CODECOV_COVERAGE_PATH: ./coverage/coverage.xml - steps: - - uses: actions/checkout@v4 - - name: Run extension tests - uses: solidusio/test-solidus-extension@main - with: - database: ${{ matrix.database }} - rails-version: ${{ matrix.rails-version }} - ruby-version: ${{ matrix.ruby-version }} - solidus-branch: ${{ matrix.solidus-branch }} - - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v5 - continue-on-error: true - with: - token: ${{ secrets.CODECOV_TOKEN }} - files: ${{ env.CODECOV_COVERAGE_PATH }} + uses: solidusio/test-solidus-extension/.github/workflows/test.yml@main From 5b8d9cc22e52f9f71daad9de6ff5ed75da72f2ae Mon Sep 17 00:00:00 2001 From: Adam Mueller Date: Thu, 5 Feb 2026 12:52:14 -0800 Subject: [PATCH 2/8] Fix missing services Co-authored-by: Chris Todorov --- .github/workflows/test.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5c281a5d..897ae89e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -47,6 +47,29 @@ jobs: rails-version: "8.0" - solidus-branch: "v4.4" rails-version: "8.0" + services: + postgres: + image: postgres:16 + env: + POSTGRES_HOST_AUTH_METHOD: trust + options: >- + --health-cmd="pg_isready" + --health-interval=10s + --health-timeout=5s + --health-retries=5 + ports: + - 5432:5432 + mysql: + image: mysql:8 + env: + MYSQL_ALLOW_EMPTY_PASSWORD: "yes" + options: >- + --health-cmd="mysqladmin ping" + --health-interval=10s + --health-timeout=5s + --health-retries=5 + ports: + - 3306:3306 steps: - uses: actions/checkout@v4 - name: Run extension tests From 9b50d973340f2cce5dea30d7f8d4145dd28d7e98 Mon Sep 17 00:00:00 2001 From: Jared Norman Date: Thu, 12 Feb 2026 11:24:51 -0800 Subject: [PATCH 3/8] Exclude incompatible Ruby/Solidus combo Co-authored-by: Chris Todorov Co-authored-by: Adam Mueller --- .github/workflows/test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 897ae89e..3151725d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -39,6 +39,8 @@ jobs: - "mysql" - "sqlite" exclude: + - solidus-branch: "main" + ruby-version: "3.1" - rails-version: "7.2" solidus-branch: "v4.3" - ruby-version: "3.1" From 10c90e089ca889c7f11cff183d93c4487350e998 Mon Sep 17 00:00:00 2001 From: Jared Norman Date: Thu, 12 Feb 2026 11:31:51 -0800 Subject: [PATCH 4/8] Appease Rubocop --- lib/solidus_dev_support/extension.rb | 1 + spec/features/create_extension_spec.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/solidus_dev_support/extension.rb b/lib/solidus_dev_support/extension.rb index 36f0accf..7d84e53f 100644 --- a/lib/solidus_dev_support/extension.rb +++ b/lib/solidus_dev_support/extension.rb @@ -8,6 +8,7 @@ module SolidusDevSupport class Extension < Thor include Thor::Actions + PREFIX = "solidus_" default_command :generate diff --git a/spec/features/create_extension_spec.rb b/spec/features/create_extension_spec.rb index f47eb03e..a404daea 100644 --- a/spec/features/create_extension_spec.rb +++ b/spec/features/create_extension_spec.rb @@ -136,7 +136,7 @@ def check_run_specs def check_sandbox cd(install_path) do - command = 'bin/rails-sandbox runner "puts %{The version of SolidusTestExtension is #{SolidusTestExtension::VERSION}}"' + command = %(bin/rails-sandbox runner "puts %{The version of SolidusTestExtension is #{SolidusTestExtension::VERSION}}") first_run_output = sh(command) expect(first_run_output).to include("Creating the sandbox app...") From d409b9708f1138955aaba9ebda7062c2c21655e4 Mon Sep 17 00:00:00 2001 From: Alistair Norman Date: Fri, 27 Nov 2026 16:09:13 -0700 Subject: [PATCH 5/8] Let generated extensions run on Rails 8.1 --- lib/solidus_dev_support/templates/extension/Gemfile.tt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/solidus_dev_support/templates/extension/Gemfile.tt b/lib/solidus_dev_support/templates/extension/Gemfile.tt index c6ece8c9..0eff9c27 100644 --- a/lib/solidus_dev_support/templates/extension/Gemfile.tt +++ b/lib/solidus_dev_support/templates/extension/Gemfile.tt @@ -7,9 +7,7 @@ branch = ENV.fetch('SOLIDUS_BRANCH', 'main') gem 'solidus', github: 'solidusio/solidus', branch: branch # The solidus_frontend gem has been pulled out since v3.2 -if branch >= 'v3.2' - gem 'solidus_frontend' -elsif branch == 'main' +if branch == 'main' || branch >= 'v3.2' gem 'solidus_frontend', github: 'solidusio/solidus_frontend' else gem 'solidus_frontend', github: 'solidusio/solidus', branch: branch From 0a3ebe1302fde0e853c0d28227a8049513340631 Mon Sep 17 00:00:00 2001 From: Alistair Norman Date: Fri, 27 Nov 2026 16:09:13 -0700 Subject: [PATCH 6/8] Pin json below 3 in generated extensions on Rails before 8.1 --- lib/solidus_dev_support/templates/extension/Gemfile.tt | 3 +++ lib/solidus_dev_support/templates/extension/bin/sandbox.tt | 3 +++ 2 files changed, 6 insertions(+) diff --git a/lib/solidus_dev_support/templates/extension/Gemfile.tt b/lib/solidus_dev_support/templates/extension/Gemfile.tt index 0eff9c27..dd823e8f 100644 --- a/lib/solidus_dev_support/templates/extension/Gemfile.tt +++ b/lib/solidus_dev_support/templates/extension/Gemfile.tt @@ -16,6 +16,9 @@ end rails_version = ENV.fetch('RAILS_VERSION', '7.0') gem 'rails', "~> #{rails_version}" +# ActiveSupport < 8.1 passes quirks_mode to JSON.generate, which json 3 rejects. +gem 'json', '< 3' if Gem::Version.new(rails_version) < Gem::Version.new('8.1') + case ENV.fetch('DB', nil) when 'mysql' gem 'mysql2' diff --git a/lib/solidus_dev_support/templates/extension/bin/sandbox.tt b/lib/solidus_dev_support/templates/extension/bin/sandbox.tt index 809ac3b7..03eb1b58 100755 --- a/lib/solidus_dev_support/templates/extension/bin/sandbox.tt +++ b/lib/solidus_dev_support/templates/extension/bin/sandbox.tt @@ -54,6 +54,9 @@ gem 'solidus_auth_devise' gem '$extension_name', path: '..' +# ActiveSupport < 8.1 passes quirks_mode to JSON.generate, which json 3 rejects. +gem 'json', '< 3' if Gem::Version.new('$rails_version') < Gem::Version.new('8.1') + group :test, :development do platforms :mri do gem 'pry-byebug' From 81da733594f34fb4712c0c02bf7ead8e51ac566f Mon Sep 17 00:00:00 2001 From: Alistair Norman Date: Fri, 27 Nov 2026 16:09:28 -0700 Subject: [PATCH 7/8] Test against the Solidus, Rails and Ruby versions extensions use --- .github/workflows/test.yml | 71 +------------------------------------- 1 file changed, 1 insertion(+), 70 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3151725d..56813f5b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,73 +17,4 @@ permissions: jobs: rspec: - name: Solidus ${{ matrix.solidus-branch }}, Rails ${{ matrix.rails-version }} and Ruby ${{ matrix.ruby-version }} on ${{ matrix.database }} - runs-on: ubuntu-24.04 - strategy: - fail-fast: true - matrix: - rails-version: - - "7.1" - - "7.2" - - "8.0" - ruby-version: - - "3.1" - - "3.4" - solidus-branch: - - "v4.3" - - "v4.4" - - "v4.5" - - "main" - database: - - "postgresql" - - "mysql" - - "sqlite" - exclude: - - solidus-branch: "main" - ruby-version: "3.1" - - rails-version: "7.2" - solidus-branch: "v4.3" - - ruby-version: "3.1" - rails-version: "8.0" - - solidus-branch: "v4.3" - rails-version: "8.0" - - solidus-branch: "v4.4" - rails-version: "8.0" - services: - postgres: - image: postgres:16 - env: - POSTGRES_HOST_AUTH_METHOD: trust - options: >- - --health-cmd="pg_isready" - --health-interval=10s - --health-timeout=5s - --health-retries=5 - ports: - - 5432:5432 - mysql: - image: mysql:8 - env: - MYSQL_ALLOW_EMPTY_PASSWORD: "yes" - options: >- - --health-cmd="mysqladmin ping" - --health-interval=10s - --health-timeout=5s - --health-retries=5 - ports: - - 3306:3306 - steps: - - uses: actions/checkout@v4 - - name: Run extension tests - uses: solidusio/test-solidus-extension@main - with: - database: ${{ matrix.database }} - rails-version: ${{ matrix.rails-version }} - ruby-version: ${{ matrix.ruby-version }} - solidus-branch: ${{ matrix.solidus-branch }} - - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v5 - continue-on-error: true - with: - token: ${{ secrets.CODECOV_TOKEN }} - files: ./coverage/coverage.xml + uses: solidusio/test-solidus-extension/.github/workflows/test.yml@main From 13d657cc3b59931ca258e90e5de7ea2addf8b387 Mon Sep 17 00:00:00 2001 From: Alistair Norman Date: Tue, 1 Dec 2026 14:58:39 -0700 Subject: [PATCH 8/8] Update Ruby restriction --- .../templates/extension/extension.gemspec.tt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/solidus_dev_support/templates/extension/extension.gemspec.tt b/lib/solidus_dev_support/templates/extension/extension.gemspec.tt index f0c758f6..962182de 100644 --- a/lib/solidus_dev_support/templates/extension/extension.gemspec.tt +++ b/lib/solidus_dev_support/templates/extension/extension.gemspec.tt @@ -17,7 +17,7 @@ Gem::Specification.new do |spec| spec.metadata['source_code_uri'] = '<%= gemspec.metadata["source_code_uri"] %>' spec.metadata['changelog_uri'] = '<%= gemspec.metadata["changelog_uri"] %>' - spec.required_ruby_version = Gem::Requirement.new('>= 2.5', '< 4') + spec.required_ruby_version = Gem::Requirement.new('>= 3.3', '< 5') # Specify which files should be added to the gem when it is released. # The `git ls-files -z` loads the files in the RubyGem that have been added into git.