From 62eeb8eada042dd443f7aaa78cd3ef0fcd99dd2f Mon Sep 17 00:00:00 2001 From: Leon Berenschot Date: Sat, 9 Dec 2023 16:38:39 +0100 Subject: [PATCH 1/7] cleanup gemfile --- Gemfile | 11 ++--------- json_api_client.gemspec | 6 ++++-- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/Gemfile b/Gemfile index c432377..32ed6a1 100644 --- a/Gemfile +++ b/Gemfile @@ -2,13 +2,6 @@ source "https://rubygems.org" gemspec -gem 'rake' - -gem "activesupport", ">= 4.0.13" -gem 'addressable', '~> 2.2' - -gem "codeclimate-test-reporter", group: :test, require: nil - -group :development, :test do - gem 'byebug', '~> 10.0', platforms: [:mri_20, :mri_21, :mri_22] +group :test do + gem "codeclimate-test-reporter", require: nil end diff --git a/json_api_client.gemspec b/json_api_client.gemspec index 3c04832..51a5bd9 100644 --- a/json_api_client.gemspec +++ b/json_api_client.gemspec @@ -12,10 +12,12 @@ Gem::Specification.new do |s| s.summary = 'Build client libraries compliant with specification defined by jsonapi.org' s.add_dependency "activesupport", '>= 6.0.0' - s.add_dependency "faraday", '>= 1.10', '< 3.0' - s.add_dependency "faraday-gzip", '>= 1.0', '< 3.0' s.add_dependency "addressable", '~> 2.2' s.add_dependency "activemodel", '>= 6.0.0' + + s.add_dependency "faraday", '>= 1.10', '< 3.0' + s.add_dependency "faraday-gzip", '>= 1.0', '< 3.0' + s.add_dependency "rack", '>= 0.2' s.add_development_dependency "webmock", '~> 3.5.1' From 0d65d13cf65bc1346565044de61c50246e3869ea Mon Sep 17 00:00:00 2001 From: Leon Berenschot Date: Sat, 9 Dec 2023 16:41:45 +0100 Subject: [PATCH 2/7] update appraisals - setup matrix for all major.minor versions of activesupport/activemodel >= 6 - run these against both versions of faraday --- .github/workflows/ruby.yml | 5 +- Appraisals | 80 +++++++++++++++++-- gemfiles/activesupport_6.0.gemfile | 14 ---- .../activesupport_6.0_faraday_1.x.gemfile | 14 ++++ .../activesupport_6.0_faraday_2.x.gemfile | 14 ++++ gemfiles/activesupport_6.1.gemfile | 14 ---- .../activesupport_6.1_faraday_1.x.gemfile | 14 ++++ .../activesupport_6.1_faraday_2.x.gemfile | 14 ++++ gemfiles/activesupport_7.0.gemfile | 14 ---- .../activesupport_7.0_faraday_1.x.gemfile | 14 ++++ .../activesupport_7.0_faraday_2.x.gemfile | 14 ++++ gemfiles/activesupport_7.1.gemfile | 14 ---- .../activesupport_7.1_faraday_1.x.gemfile | 14 ++++ .../activesupport_7.1_faraday_2.x.gemfile | 14 ++++ .../activesupport_7.2_faraday_1.x.gemfile | 14 ++++ .../activesupport_7.2_faraday_2.x.gemfile | 14 ++++ .../activesupport_8.0_faraday_1.x.gemfile | 14 ++++ .../activesupport_8.0_faraday_2.x.gemfile | 14 ++++ gemfiles/faraday_1.x.gemfile | 8 +- gemfiles/faraday_2.x.gemfile | 8 +- 20 files changed, 248 insertions(+), 77 deletions(-) delete mode 100644 gemfiles/activesupport_6.0.gemfile create mode 100644 gemfiles/activesupport_6.0_faraday_1.x.gemfile create mode 100644 gemfiles/activesupport_6.0_faraday_2.x.gemfile delete mode 100644 gemfiles/activesupport_6.1.gemfile create mode 100644 gemfiles/activesupport_6.1_faraday_1.x.gemfile create mode 100644 gemfiles/activesupport_6.1_faraday_2.x.gemfile delete mode 100644 gemfiles/activesupport_7.0.gemfile create mode 100644 gemfiles/activesupport_7.0_faraday_1.x.gemfile create mode 100644 gemfiles/activesupport_7.0_faraday_2.x.gemfile delete mode 100644 gemfiles/activesupport_7.1.gemfile create mode 100644 gemfiles/activesupport_7.1_faraday_1.x.gemfile create mode 100644 gemfiles/activesupport_7.1_faraday_2.x.gemfile create mode 100644 gemfiles/activesupport_7.2_faraday_1.x.gemfile create mode 100644 gemfiles/activesupport_7.2_faraday_2.x.gemfile create mode 100644 gemfiles/activesupport_8.0_faraday_1.x.gemfile create mode 100644 gemfiles/activesupport_8.0_faraday_2.x.gemfile diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 2a58171..d7dfff3 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -35,6 +35,5 @@ jobs: ruby-version: ${{ matrix.ruby }} bundler-cache: true # runs 'bundle install' and caches installed gems automatically - name: Run tests - run: | - bundle exec appraisal install - bundle exec appraisal rake test + run: bundle exec rake + diff --git a/Appraisals b/Appraisals index d945edc..d2399d7 100644 --- a/Appraisals +++ b/Appraisals @@ -1,25 +1,93 @@ -appraise 'activesupport-6.0' do +appraise 'activesupport-6.0-faraday-1.x' do gem 'activesupport', '~> 6.0.0' + gem 'activemodel', '~> 6.0.0' + gem 'faraday', '~> 1.10' + gem 'faraday-gzip', '~> 1.0' end -appraise 'activesupport-6.1' do +appraise 'activesupport-6.1-faraday-1.x' do gem 'activesupport', '~> 6.1.0' + gem 'activemodel', '~> 6.1.0' + gem 'faraday', '~> 1.10' + gem 'faraday-gzip', '~> 1.0' end -appraise 'activesupport-7.0' do +appraise 'activesupport-7.0-faraday-1.x' do gem 'activesupport', '~> 7.0.0' + gem 'activemodel', '~> 7.0.0' + gem 'faraday', '~> 1.10' + gem 'faraday-gzip', '~> 1.0' end -appraise 'activesupport-7.1' do +appraise 'activesupport-7.1-faraday-1.x' do gem 'activesupport', '~> 7.1.0' + gem 'activemodel', '~> 7.1.0' + gem 'faraday', '~> 1.10' + gem 'faraday-gzip', '~> 1.0' end -appraise 'faraday-1.x' do +appraise 'activesupport-7.2-faraday-1.x' do + gem 'activesupport', '~> 7.2.0' + gem 'activemodel', '~> 7.2.0' gem 'faraday', '~> 1.10' gem 'faraday-gzip', '~> 1.0' end -appraise 'faraday-2.x' do +appraise 'activesupport-8.0-faraday-1.x' do + gem 'activesupport', '~> 8.0.0' + gem 'activemodel', '~> 8.0.0' + gem 'faraday', '~> 1.10' + gem 'faraday-gzip', '~> 1.0' +end + +appraise 'activesupport-6.0-faraday-2.x' do + gem 'activesupport', '~> 6.0.0' + gem 'activemodel', '~> 6.0.0' + gem 'faraday', '~> 2.0' + gem 'faraday-gzip', '~> 2.0' +end + +appraise 'activesupport-6.1-faraday-2.x' do + gem 'activesupport', '~> 6.1.0' + gem 'activemodel', '~> 6.1.0' + gem 'faraday', '~> 2.0' + gem 'faraday-gzip', '~> 2.0' +end + +appraise 'activesupport-7.0-faraday-2.x' do + gem 'activesupport', '~> 7.0.0' + gem 'activemodel', '~> 7.0.0' + gem 'faraday', '~> 2.0' + gem 'faraday-gzip', '~> 2.0' +end + +appraise 'activesupport-7.1-faraday-2.x' do + gem 'activesupport', '~> 7.1.0' + gem 'activemodel', '~> 7.1.0' + gem 'faraday', '~> 2.0' + gem 'faraday-gzip', '~> 2.0' +end + +appraise 'activesupport-7.2-faraday-2.x' do + gem 'activesupport', '~> 7.2.0' + gem 'activemodel', '~> 7.2.0' + gem 'faraday', '~> 2.0' + gem 'faraday-gzip', '~> 2.0' +end + +appraise 'activesupport-8.0-faraday-2.x' do + gem 'activesupport', '~> 8.0.0' + gem 'activemodel', '~> 8.0.0' gem 'faraday', '~> 2.0' gem 'faraday-gzip', '~> 2.0' end + +appraise 'faraday-1.x' do + gem 'faraday', '~> 1.10' # depends on Ruby (>= 2.4) + gem 'faraday-gzip', '~> 1.0' # depends on Ruby (< 4, >= 2.6) +end + +appraise 'faraday-2.x' do + gem 'faraday', '~> 2.0' # depends on Ruby (>= 2.6) + gem 'faraday-gzip', '~> 2.0' # depends on Ruby (< 4, >= 2.6) +end diff --git a/gemfiles/activesupport_6.0.gemfile b/gemfiles/activesupport_6.0.gemfile deleted file mode 100644 index 57a778e..0000000 --- a/gemfiles/activesupport_6.0.gemfile +++ /dev/null @@ -1,14 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "rake" -gem "activesupport", "~> 6.0.0" -gem "addressable", "~> 2.2" -gem "codeclimate-test-reporter", group: :test, require: nil - -group :development, :test do - gem "byebug", "~> 10.0", platforms: [:mri_20, :mri_21, :mri_22] -end - -gemspec path: "../" diff --git a/gemfiles/activesupport_6.0_faraday_1.x.gemfile b/gemfiles/activesupport_6.0_faraday_1.x.gemfile new file mode 100644 index 0000000..58545eb --- /dev/null +++ b/gemfiles/activesupport_6.0_faraday_1.x.gemfile @@ -0,0 +1,14 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "activesupport", "~> 6.0.0" +gem "activemodel", "~> 6.0.0" +gem "faraday", "~> 1.10" +gem "faraday-gzip", "~> 1.0" + +group :test do + gem "codeclimate-test-reporter", require: nil +end + +gemspec path: "../" diff --git a/gemfiles/activesupport_6.0_faraday_2.x.gemfile b/gemfiles/activesupport_6.0_faraday_2.x.gemfile new file mode 100644 index 0000000..65bdcb6 --- /dev/null +++ b/gemfiles/activesupport_6.0_faraday_2.x.gemfile @@ -0,0 +1,14 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "activesupport", "~> 6.0.0" +gem "activemodel", "~> 6.0.0" +gem "faraday", "~> 2.0" +gem "faraday-gzip", "~> 2.0" + +group :test do + gem "codeclimate-test-reporter", require: nil +end + +gemspec path: "../" diff --git a/gemfiles/activesupport_6.1.gemfile b/gemfiles/activesupport_6.1.gemfile deleted file mode 100644 index 460b752..0000000 --- a/gemfiles/activesupport_6.1.gemfile +++ /dev/null @@ -1,14 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "rake" -gem "activesupport", "~> 6.1.0" -gem "addressable", "~> 2.2" -gem "codeclimate-test-reporter", group: :test, require: nil - -group :development, :test do - gem "byebug", "~> 10.0", platforms: [:mri_20, :mri_21, :mri_22] -end - -gemspec path: "../" diff --git a/gemfiles/activesupport_6.1_faraday_1.x.gemfile b/gemfiles/activesupport_6.1_faraday_1.x.gemfile new file mode 100644 index 0000000..858d329 --- /dev/null +++ b/gemfiles/activesupport_6.1_faraday_1.x.gemfile @@ -0,0 +1,14 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "activesupport", "~> 6.1.0" +gem "activemodel", "~> 6.1.0" +gem "faraday", "~> 1.10" +gem "faraday-gzip", "~> 1.0" + +group :test do + gem "codeclimate-test-reporter", require: nil +end + +gemspec path: "../" diff --git a/gemfiles/activesupport_6.1_faraday_2.x.gemfile b/gemfiles/activesupport_6.1_faraday_2.x.gemfile new file mode 100644 index 0000000..8617834 --- /dev/null +++ b/gemfiles/activesupport_6.1_faraday_2.x.gemfile @@ -0,0 +1,14 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "activesupport", "~> 6.1.0" +gem "activemodel", "~> 6.1.0" +gem "faraday", "~> 2.0" +gem "faraday-gzip", "~> 2.0" + +group :test do + gem "codeclimate-test-reporter", require: nil +end + +gemspec path: "../" diff --git a/gemfiles/activesupport_7.0.gemfile b/gemfiles/activesupport_7.0.gemfile deleted file mode 100644 index 5d577ad..0000000 --- a/gemfiles/activesupport_7.0.gemfile +++ /dev/null @@ -1,14 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "rake" -gem "activesupport", "~> 7.0.0" -gem "addressable", "~> 2.2" -gem "codeclimate-test-reporter", group: :test, require: nil - -group :development, :test do - gem "byebug", "~> 10.0", platforms: [:mri_20, :mri_21, :mri_22] -end - -gemspec path: "../" diff --git a/gemfiles/activesupport_7.0_faraday_1.x.gemfile b/gemfiles/activesupport_7.0_faraday_1.x.gemfile new file mode 100644 index 0000000..cd88083 --- /dev/null +++ b/gemfiles/activesupport_7.0_faraday_1.x.gemfile @@ -0,0 +1,14 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "activesupport", "~> 7.0.0" +gem "activemodel", "~> 7.0.0" +gem "faraday", "~> 1.10" +gem "faraday-gzip", "~> 1.0" + +group :test do + gem "codeclimate-test-reporter", require: nil +end + +gemspec path: "../" diff --git a/gemfiles/activesupport_7.0_faraday_2.x.gemfile b/gemfiles/activesupport_7.0_faraday_2.x.gemfile new file mode 100644 index 0000000..e78b86a --- /dev/null +++ b/gemfiles/activesupport_7.0_faraday_2.x.gemfile @@ -0,0 +1,14 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "activesupport", "~> 7.0.0" +gem "activemodel", "~> 7.0.0" +gem "faraday", "~> 2.0" +gem "faraday-gzip", "~> 2.0" + +group :test do + gem "codeclimate-test-reporter", require: nil +end + +gemspec path: "../" diff --git a/gemfiles/activesupport_7.1.gemfile b/gemfiles/activesupport_7.1.gemfile deleted file mode 100644 index 5347aea..0000000 --- a/gemfiles/activesupport_7.1.gemfile +++ /dev/null @@ -1,14 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "rake" -gem "activesupport", "~> 7.1.0" -gem "addressable", "~> 2.2" -gem "codeclimate-test-reporter", group: :test, require: nil - -group :development, :test do - gem "byebug", "~> 10.0", platforms: [:mri_20, :mri_21, :mri_22] -end - -gemspec path: "../" diff --git a/gemfiles/activesupport_7.1_faraday_1.x.gemfile b/gemfiles/activesupport_7.1_faraday_1.x.gemfile new file mode 100644 index 0000000..75a4613 --- /dev/null +++ b/gemfiles/activesupport_7.1_faraday_1.x.gemfile @@ -0,0 +1,14 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "activesupport", "~> 7.1.0" +gem "activemodel", "~> 7.1.0" +gem "faraday", "~> 1.10" +gem "faraday-gzip", "~> 1.0" + +group :test do + gem "codeclimate-test-reporter", require: nil +end + +gemspec path: "../" diff --git a/gemfiles/activesupport_7.1_faraday_2.x.gemfile b/gemfiles/activesupport_7.1_faraday_2.x.gemfile new file mode 100644 index 0000000..5f5d5a8 --- /dev/null +++ b/gemfiles/activesupport_7.1_faraday_2.x.gemfile @@ -0,0 +1,14 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "activesupport", "~> 7.1.0" +gem "activemodel", "~> 7.1.0" +gem "faraday", "~> 2.0" +gem "faraday-gzip", "~> 2.0" + +group :test do + gem "codeclimate-test-reporter", require: nil +end + +gemspec path: "../" diff --git a/gemfiles/activesupport_7.2_faraday_1.x.gemfile b/gemfiles/activesupport_7.2_faraday_1.x.gemfile new file mode 100644 index 0000000..5da9e41 --- /dev/null +++ b/gemfiles/activesupport_7.2_faraday_1.x.gemfile @@ -0,0 +1,14 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "activesupport", "~> 7.2.0" +gem "activemodel", "~> 7.2.0" +gem "faraday", "~> 1.10" +gem "faraday-gzip", "~> 1.0" + +group :test do + gem "codeclimate-test-reporter", require: nil +end + +gemspec path: "../" diff --git a/gemfiles/activesupport_7.2_faraday_2.x.gemfile b/gemfiles/activesupport_7.2_faraday_2.x.gemfile new file mode 100644 index 0000000..04bcc14 --- /dev/null +++ b/gemfiles/activesupport_7.2_faraday_2.x.gemfile @@ -0,0 +1,14 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "activesupport", "~> 7.2.0" +gem "activemodel", "~> 7.2.0" +gem "faraday", "~> 2.0" +gem "faraday-gzip", "~> 2.0" + +group :test do + gem "codeclimate-test-reporter", require: nil +end + +gemspec path: "../" diff --git a/gemfiles/activesupport_8.0_faraday_1.x.gemfile b/gemfiles/activesupport_8.0_faraday_1.x.gemfile new file mode 100644 index 0000000..dcfd3af --- /dev/null +++ b/gemfiles/activesupport_8.0_faraday_1.x.gemfile @@ -0,0 +1,14 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "activesupport", "~> 8.0.0" +gem "activemodel", "~> 8.0.0" +gem "faraday", "~> 1.10" +gem "faraday-gzip", "~> 1.0" + +group :test do + gem "codeclimate-test-reporter", require: nil +end + +gemspec path: "../" diff --git a/gemfiles/activesupport_8.0_faraday_2.x.gemfile b/gemfiles/activesupport_8.0_faraday_2.x.gemfile new file mode 100644 index 0000000..7303571 --- /dev/null +++ b/gemfiles/activesupport_8.0_faraday_2.x.gemfile @@ -0,0 +1,14 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "activesupport", "~> 8.0.0" +gem "activemodel", "~> 8.0.0" +gem "faraday", "~> 2.0" +gem "faraday-gzip", "~> 2.0" + +group :test do + gem "codeclimate-test-reporter", require: nil +end + +gemspec path: "../" diff --git a/gemfiles/faraday_1.x.gemfile b/gemfiles/faraday_1.x.gemfile index f6c65ac..70d4dfe 100644 --- a/gemfiles/faraday_1.x.gemfile +++ b/gemfiles/faraday_1.x.gemfile @@ -2,15 +2,11 @@ source "https://rubygems.org" -gem "rake" -gem "activesupport", ">= 4.0.13" -gem "addressable", "~> 2.2" -gem "codeclimate-test-reporter", group: :test, require: nil gem "faraday", "~> 1.10" gem "faraday-gzip", "~> 1.0" -group :development, :test do - gem "byebug", "~> 10.0", platforms: [:mri_20, :mri_21, :mri_22] +group :test do + gem "codeclimate-test-reporter", require: nil end gemspec path: "../" diff --git a/gemfiles/faraday_2.x.gemfile b/gemfiles/faraday_2.x.gemfile index d857de4..00bc12d 100644 --- a/gemfiles/faraday_2.x.gemfile +++ b/gemfiles/faraday_2.x.gemfile @@ -2,15 +2,11 @@ source "https://rubygems.org" -gem "rake" -gem "activesupport", ">= 4.0.13" -gem "addressable", "~> 2.2" -gem "codeclimate-test-reporter", group: :test, require: nil gem "faraday", "~> 2.0" gem "faraday-gzip", "~> 2.0" -group :development, :test do - gem "byebug", "~> 10.0", platforms: [:mri_20, :mri_21, :mri_22] +group :test do + gem "codeclimate-test-reporter", require: nil end gemspec path: "../" From 5c93cd02bf67dc71de4dd0833d392a397f6c1fd2 Mon Sep 17 00:00:00 2001 From: Leon Berenschot Date: Sat, 9 Dec 2023 16:50:55 +0100 Subject: [PATCH 3/7] improve GH Action: test w/ faraday 1.x & 2.x on various ruby's - run tests w/ the generated gemfiles so when a ruby version fails it's shown as a separate failure in GHA --- .github/workflows/ruby.yml | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index d7dfff3..666ede1 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -17,8 +17,9 @@ permissions: contents: read jobs: - test: - runs-on: ubuntu-22.04 + test_ruby_version: + runs-on: ubuntu-latest + name: ruby-${{ matrix.ruby }}, ${{ matrix.gemfile }} strategy: fail-fast: false matrix: @@ -27,6 +28,12 @@ jobs: - "3.1" - "3.2" - "3.3" + - "3.4" + gemfile: + - "faraday_1.x" + - "faraday_2.x" + env: + BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile steps: - uses: actions/checkout@v4 - name: Set up Ruby @@ -34,6 +41,23 @@ jobs: with: ruby-version: ${{ matrix.ruby }} bundler-cache: true # runs 'bundle install' and caches installed gems automatically + - name: Configure bundler + run: | + bundle config path vendor/bundle + - name: Create bundler lockfile + run: | + bundle lock + - uses: actions/cache@v3 + with: + # NOTE: Bundler expands the path relative to the gemfile, not the + # current directory. + path: ./gemfiles/vendor/bundle + key: bundled-gems-${{ runner.os }}-ruby-${{ matrix.ruby }}-${{ matrix.gemfile }}-${{ hashFiles( 'gemfiles/*.lock' ) }} + restore-keys: | + bundled-gems-${{ runner.os }}-ruby-${{ matrix.ruby }}-${{ matrix.gemfile }}- + bundled-gems-${{ runner.os }}-ruby-${{ matrix.ruby }}- + - name: Install gems + run: | + bundle install --jobs 4 - name: Run tests run: bundle exec rake - From cfe2c46c864fc52996588c265a1089eb3e8d7eab Mon Sep 17 00:00:00 2001 From: Leon Berenschot Date: Wed, 3 Sep 2025 11:04:28 +0200 Subject: [PATCH 4/7] add: test each combination of ruby/faraday/rails --- .github/workflows/ruby.yml | 63 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 666ede1..3938d0d 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -61,3 +61,66 @@ jobs: bundle install --jobs 4 - name: Run tests run: bundle exec rake + + test_active_support: + needs: test_ruby_version + runs-on: ubuntu-latest + name: ruby-${{ matrix.ruby }}, ${{ matrix.gemfile }}, ${{ matrix.faraday }} + strategy: + fail-fast: false + # https://www.fastruby.io/blog/ruby/rails/versions/compatibility-table.html + matrix: + ruby: + - "3.0" + - "3.1" + - "3.2" + - "3.3" + - "3.4" + faraday: + - "faraday_1.x" + - "faraday_2.x" + gemfile: + - "activesupport_6.0" + - "activesupport_6.1" + - "activesupport_7.0" + - "activesupport_7.1" + - "activesupport_7.2" + - "activesupport_8.0" + exclude: + - ruby: "3.0" + gemfile: "activesupport_7.2" + - ruby: "3.0" + gemfile: "activesupport_8.0" + - ruby: "3.1" + gemfile: "activesupport_8.0" + + env: + BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}_${{ matrix.faraday }}.gemfile + steps: + - uses: actions/checkout@v4 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: true # runs 'bundle install' and caches installed gems automatically + - name: Configure bundler + run: | + bundle config path vendor/bundle + - name: Create bundler lockfile + run: | + bundle lock + - uses: actions/cache@v3 + with: + # NOTE: Bundler expands the path relative to the gemfile, not the + # current directory. + path: ./gemfiles/vendor/bundle + key: bundled-gems-${{ runner.os }}-ruby-${{ matrix.ruby }}-${{ matrix.gemfile }}-${{ matrix.faraday }}-${{ hashFiles( 'gemfiles/*.lock' ) }} + restore-keys: | + bundled-gems-${{ runner.os }}-ruby-${{ matrix.ruby }}-${{ matrix.gemfile }}-${{ matrix.faraday }} + bundled-gems-${{ runner.os }}-ruby-${{ matrix.ruby }}-${{ matrix.gemfile }}- + bundled-gems-${{ runner.os }}-ruby-${{ matrix.ruby }}- + - name: Install gems + run: | + bundle install --jobs 4 + - name: Run tests + run: bundle exec rake From da3ee479e450f1f1f481db40fb4ee0de469621cc Mon Sep 17 00:00:00 2001 From: Leon Berenschot Date: Wed, 3 Sep 2025 11:18:12 +0200 Subject: [PATCH 5/7] fix: uninitialized constant ActiveSupport::LoggerThreadSafeLevel::Logger (NameError) `concurrent-ruby` v1.3.5 has removed the dependency on logger` > require logger and leave concurrent-ruby version unlocked. This is primarily an issue for older Rails 7.0 and 6.1. https://github.com/ruby-concurrency/concurrent-ruby/commit/d7ce956dacd0b772273d39b8ed31a30cff7ecf38 See: https://stackoverflow.com/questions/79360526/uninitialized-constant-activesupportloggerthreadsafelevellogger-nameerror --- Appraisals | 3 +++ gemfiles/activesupport_6.0_faraday_1.x.gemfile | 1 + gemfiles/activesupport_6.1_faraday_1.x.gemfile | 1 + gemfiles/activesupport_7.0_faraday_1.x.gemfile | 1 + 4 files changed, 6 insertions(+) diff --git a/Appraisals b/Appraisals index d2399d7..2761ffe 100644 --- a/Appraisals +++ b/Appraisals @@ -3,6 +3,7 @@ appraise 'activesupport-6.0-faraday-1.x' do gem 'activemodel', '~> 6.0.0' gem 'faraday', '~> 1.10' gem 'faraday-gzip', '~> 1.0' + gem 'concurrent-ruby', '1.3.4' end appraise 'activesupport-6.1-faraday-1.x' do @@ -10,6 +11,7 @@ appraise 'activesupport-6.1-faraday-1.x' do gem 'activemodel', '~> 6.1.0' gem 'faraday', '~> 1.10' gem 'faraday-gzip', '~> 1.0' + gem 'concurrent-ruby', '1.3.4' end appraise 'activesupport-7.0-faraday-1.x' do @@ -17,6 +19,7 @@ appraise 'activesupport-7.0-faraday-1.x' do gem 'activemodel', '~> 7.0.0' gem 'faraday', '~> 1.10' gem 'faraday-gzip', '~> 1.0' + gem 'concurrent-ruby', '1.3.4' end appraise 'activesupport-7.1-faraday-1.x' do diff --git a/gemfiles/activesupport_6.0_faraday_1.x.gemfile b/gemfiles/activesupport_6.0_faraday_1.x.gemfile index 58545eb..73bc938 100644 --- a/gemfiles/activesupport_6.0_faraday_1.x.gemfile +++ b/gemfiles/activesupport_6.0_faraday_1.x.gemfile @@ -6,6 +6,7 @@ gem "activesupport", "~> 6.0.0" gem "activemodel", "~> 6.0.0" gem "faraday", "~> 1.10" gem "faraday-gzip", "~> 1.0" +gem "concurrent-ruby", "1.3.4" group :test do gem "codeclimate-test-reporter", require: nil diff --git a/gemfiles/activesupport_6.1_faraday_1.x.gemfile b/gemfiles/activesupport_6.1_faraday_1.x.gemfile index 858d329..8adacae 100644 --- a/gemfiles/activesupport_6.1_faraday_1.x.gemfile +++ b/gemfiles/activesupport_6.1_faraday_1.x.gemfile @@ -6,6 +6,7 @@ gem "activesupport", "~> 6.1.0" gem "activemodel", "~> 6.1.0" gem "faraday", "~> 1.10" gem "faraday-gzip", "~> 1.0" +gem "concurrent-ruby", "1.3.4" group :test do gem "codeclimate-test-reporter", require: nil diff --git a/gemfiles/activesupport_7.0_faraday_1.x.gemfile b/gemfiles/activesupport_7.0_faraday_1.x.gemfile index cd88083..8eed30b 100644 --- a/gemfiles/activesupport_7.0_faraday_1.x.gemfile +++ b/gemfiles/activesupport_7.0_faraday_1.x.gemfile @@ -6,6 +6,7 @@ gem "activesupport", "~> 7.0.0" gem "activemodel", "~> 7.0.0" gem "faraday", "~> 1.10" gem "faraday-gzip", "~> 1.0" +gem "concurrent-ruby", "1.3.4" group :test do gem "codeclimate-test-reporter", require: nil From 9df84488510bca144aa1207ee60722505489e6d4 Mon Sep 17 00:00:00 2001 From: Leon Berenschot Date: Wed, 3 Sep 2025 11:54:35 +0200 Subject: [PATCH 6/7] fix: ruby 3.4 dropped base64 and mutex_m from the StdLib ``` /home/runner/work/json_api_client/json_api_client/gemfiles/vendor/bundle/ruby/3.4.0/gems/activesupport-6.0.6.1/lib/active_support/notifications/fanout.rb:3: warning: mutex_m was loaded from the standard library, but is not part of the default gems starting from Ruby 3.4.0. You can add mutex_m to your Gemfile or gemspec to silence this warning. /home/runner/work/json_api_client/json_api_client/gemfiles/vendor/bundle/ruby/3.4.0/gems/webmock-3.5.1/lib/webmock/util/headers.rb:1: warning: base64 was loaded from the standard library, but is not part of the default gems starting from Ruby 3.4.0. You can add base64 to your Gemfile or gemspec to silence this warning. ``` --- json_api_client.gemspec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/json_api_client.gemspec b/json_api_client.gemspec index 51a5bd9..4acc1f1 100644 --- a/json_api_client.gemspec +++ b/json_api_client.gemspec @@ -23,6 +23,8 @@ Gem::Specification.new do |s| s.add_development_dependency "webmock", '~> 3.5.1' s.add_development_dependency "mocha" s.add_development_dependency "appraisal" + s.add_development_dependency "base64" + s.add_development_dependency "mutex_m" s.license = "MIT" From e96c5e1c123bb04aa49094eaf08dd0369feaba45 Mon Sep 17 00:00:00 2001 From: Leon Berenschot Date: Wed, 3 Sep 2025 12:15:52 +0200 Subject: [PATCH 7/7] document development process as done on my machine --- README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/README.md b/README.md index cb60758..e8f243b 100644 --- a/README.md +++ b/README.md @@ -700,6 +700,24 @@ Contributions are welcome! Please fork this repo and send a pull request. Your p Ideally, the PR has 2 commits - the first showing the failed test and the second with the fix - although this is not required. The commits will be squashed into master once accepted. +### Set up development locally + +- With a decent ruby version: + ```shell + bundle install + appraisal install + ``` + +- Run all tests for that ruby version: + ```shell + appraisal rake + ``` + +- For more info on appraisal: + ```shell + appraisal help + ``` + ## Changelog See [changelog](https://github.com/JsonApiClient/json_api_client/blob/master/CHANGELOG.md)