From d5377e5011bde64f3379c8f781dc58a7d3114704 Mon Sep 17 00:00:00 2001 From: Bruno Casali Date: Sun, 5 Jan 2025 21:58:29 -0300 Subject: [PATCH 1/6] Fix CI --- .github/workflows/tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c1df4be..e6d5957 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -18,7 +18,7 @@ jobs: strategy: fail-fast: false matrix: - ruby-version: ["3.0", "3.1", "3.2"] + ruby-version: ["3.2", "3.3", "3.4"] rails-version: [6.1, 7.0] env: RAILS_VERSION: ${{ matrix.rails-version }} @@ -36,7 +36,7 @@ jobs: run: bundle exec rspec - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v5 - if: matrix.ruby-version == '3.1' && matrix.rails-version == '7.0' + if: matrix.ruby-version == '3.4' && matrix.rails-version == '7.0' with: token: ${{ secrets.CODECOV_TOKEN }} @@ -50,7 +50,7 @@ jobs: env: BUNDLE_WITH: test with: - ruby-version: "3.0" + ruby-version: "3.4" bundler-cache: true - name: Run linter run: bundle exec rubocop lib/ spec/ @@ -76,7 +76,7 @@ jobs: BUNDLE_WITHOUT: test BUNDLE_GEMFILE: ./playground/Gemfile with: - ruby-version: "3.0" + ruby-version: "3.4" bundler-cache: true - name: Meilisearch (latest) setup with Docker run: docker run -d -p 7700:7700 getmeili/meilisearch:latest meilisearch --master-key=masterKey --no-analytics From da5e323ca0da2e109fed33526fd73c6cb1ef0408 Mon Sep 17 00:00:00 2001 From: Bruno Casali Date: Sun, 5 Jan 2025 22:00:49 -0300 Subject: [PATCH 2/6] Update bors config --- bors.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bors.toml b/bors.toml index 2f2206c..d285004 100644 --- a/bors.toml +++ b/bors.toml @@ -1,10 +1,10 @@ status = [ 'integration-tests (Rails 6.1 with Ruby 3.2)', - 'integration-tests (Rails 6.1 with Ruby 3.1)', - 'integration-tests (Rails 6.1 with Ruby 3.0)', - 'integration-tests (Rails 7 with Ruby 3.0)', - 'integration-tests (Rails 7 with Ruby 3.1)', + 'integration-tests (Rails 6.1 with Ruby 3.3)', + 'integration-tests (Rails 6.1 with Ruby 3.4)', 'integration-tests (Rails 7 with Ruby 3.2)', + 'integration-tests (Rails 7 with Ruby 3.3)', + 'integration-tests (Rails 7 with Ruby 3.4)', 'linter-check', 'smoke-test', ] From a8809e2453ab3a0b22119ac92b35e6b6cb4bc6ca Mon Sep 17 00:00:00 2001 From: Bruno Casali Date: Sun, 5 Jan 2025 22:06:19 -0300 Subject: [PATCH 3/6] Install sqlite --- .github/workflows/tests.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e6d5957..1060083 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -25,6 +25,8 @@ jobs: name: integration-tests (Rails ${{ matrix.rails-version }} with Ruby ${{ matrix.ruby-version }}) steps: - uses: actions/checkout@v4 + - name: Install SQLite dependencies + run: sudo apt-get update && sudo apt-get install -y libsqlite3-dev - name: Set up Ruby uses: ruby/setup-ruby@v1 with: @@ -45,6 +47,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - name: Install SQLite dependencies + run: sudo apt-get update && sudo apt-get install -y libsqlite3-dev - name: Set up Ruby uses: ruby/setup-ruby@v1 env: @@ -70,6 +74,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - name: Install SQLite dependencies + run: sudo apt-get update && sudo apt-get install -y libsqlite3-dev - name: Set up Ruby uses: ruby/setup-ruby@v1 env: From 5152708477c395b828d9e96d1888f0e65650e3e4 Mon Sep 17 00:00:00 2001 From: Bruno Casali Date: Sun, 5 Jan 2025 22:10:18 -0300 Subject: [PATCH 4/6] Add mutex_m to gemspec --- Gemfile | 6 +----- meilisearch-rails.gemspec | 1 + 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index 8f4e5c6..958d48e 100644 --- a/Gemfile +++ b/Gemfile @@ -20,11 +20,7 @@ group :test do gem 'rails', "~> #{rails_version}" gem 'sequel', sequel_version - if Gem::Version.new(rails_version) >= Gem::Version.new('6.0') - gem 'sqlite3', '~> 1.4.0', platform: %i[rbx ruby] - else - gem 'sqlite3', '< 1.4.0', platform: %i[rbx ruby] - end + gem 'sqlite3', '~> 2', platform: %i[rbx ruby] gem 'activerecord-jdbc-adapter', platform: :jruby gem 'activerecord-jdbcsqlite3-adapter', platform: :jruby diff --git a/meilisearch-rails.gemspec b/meilisearch-rails.gemspec index b3f4780..26b7da0 100644 --- a/meilisearch-rails.gemspec +++ b/meilisearch-rails.gemspec @@ -35,4 +35,5 @@ Gem::Specification.new do |s| s.required_ruby_version = '>= 3.0.0' s.add_dependency 'meilisearch', '~> 0.28' + s.add_dependency 'mutex_m', '~> 0.2' end From c05e45c6affaf45061aa7e7ff2ccc7f8cf646f5b Mon Sep 17 00:00:00 2001 From: Bruno Casali Date: Sun, 5 Jan 2025 22:25:24 -0300 Subject: [PATCH 5/6] Update playground code and ensure rails 6 and 7 works --- Gemfile | 10 ++++++++-- playground/Gemfile | 4 ++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index 958d48e..d018867 100644 --- a/Gemfile +++ b/Gemfile @@ -13,14 +13,19 @@ group :development do end group :test do - rails_version = ENV['RAILS_VERSION'] || '6.1' + rails_version = ENV['RAILS_VERSION'] || '7.1' sequel_version = ENV['SEQUEL_VERSION'] ? "~> #{ENV['SEQUEL_VERSION']}" : '>= 4.0' gem 'active_model_serializers' gem 'rails', "~> #{rails_version}" gem 'sequel', sequel_version - gem 'sqlite3', '~> 2', platform: %i[rbx ruby] + # remove when deprecate rails 6 + if Gem::Version.new(rails_version) >= Gem::Version.new('7.0') + gem 'sqlite3', '~> 2', platform: %i[rbx ruby] + else + gem 'sqlite3', '< 2', platform: %i[rbx ruby] + end gem 'activerecord-jdbc-adapter', platform: :jruby gem 'activerecord-jdbcsqlite3-adapter', platform: :jruby @@ -29,6 +34,7 @@ group :test do gem 'simplecov', require: 'false' gem 'simplecov-cobertura', require: 'false' gem 'threads' + gem 'logger' gem 'byebug' gem 'dotenv', '~> 2.7', '>= 2.7.6' diff --git a/playground/Gemfile b/playground/Gemfile index 20211bf..6aa10c5 100644 --- a/playground/Gemfile +++ b/playground/Gemfile @@ -4,9 +4,9 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" } # Bundle edge Rails instead: gem 'rails', github: 'rails/rails', branch: 'main' gem 'rails', '~> 6.1.3' # Use sqlite3 as the database for Active Record -gem 'sqlite3', '~> 1.4' +gem 'sqlite3' # Use Puma as the app server -gem 'puma', '~> 5.0' +gem 'puma' # Use SCSS for stylesheets gem 'sass-rails', '>= 6' gem 'bootstrap', '~> 5.0.0.beta2' From 27762f2e65534b1ea14aa86484858c2d751b98ac Mon Sep 17 00:00:00 2001 From: Bruno Casali Date: Sun, 5 Jan 2025 22:37:38 -0300 Subject: [PATCH 6/6] Update playground to use ruby 7 --- playground/Dockerfile | 5 +++-- playground/Gemfile | 2 +- playground/config/application.rb | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/playground/Dockerfile b/playground/Dockerfile index 9d347cc..a829060 100644 --- a/playground/Dockerfile +++ b/playground/Dockerfile @@ -1,4 +1,4 @@ -FROM ruby:3.1.2-slim +FROM ruby:3.4-slim ENV LANG C.UTF-8 RUN apt-get update -qq && apt-get install -yq --no-install-recommends \ @@ -9,7 +9,8 @@ RUN apt-get update -qq && apt-get install -yq --no-install-recommends \ telnet \ nodejs \ npm \ - python \ + python3 \ + libsqlite3-dev \ && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* RUN apt-get update -qq && apt-get install -y libpq-dev diff --git a/playground/Gemfile b/playground/Gemfile index 6aa10c5..b5f5fc4 100644 --- a/playground/Gemfile +++ b/playground/Gemfile @@ -2,7 +2,7 @@ source 'https://rubygems.org' git_source(:github) { |repo| "https://github.com/#{repo}.git" } # Bundle edge Rails instead: gem 'rails', github: 'rails/rails', branch: 'main' -gem 'rails', '~> 6.1.3' +gem 'rails', '~> 7.1' # Use sqlite3 as the database for Active Record gem 'sqlite3' # Use Puma as the app server diff --git a/playground/config/application.rb b/playground/config/application.rb index 6b93017..468842d 100644 --- a/playground/config/application.rb +++ b/playground/config/application.rb @@ -9,7 +9,7 @@ module Playground class Application < Rails::Application # Initialize configuration defaults for originally generated Rails version. - config.load_defaults 6.1 + config.load_defaults 7.1 # Configuration for the application, engines, and railties goes here. #