From 1f98ecdf94f56a195ca3ea71310b7df80771012b Mon Sep 17 00:00:00 2001 From: Dalibor Nasevic Date: Thu, 26 Oct 2023 11:14:13 +0200 Subject: [PATCH 1/8] Remove reconnect flag to fix 'MYSQL_OPT_RECONNECT is deprecated' warning --- spec/support/config.yml.github | 2 -- spec/support/config.yml.template | 2 -- 2 files changed, 4 deletions(-) diff --git a/spec/support/config.yml.github b/spec/support/config.yml.github index 765ebc9..b952a05 100644 --- a/spec/support/config.yml.github +++ b/spec/support/config.yml.github @@ -1,7 +1,6 @@ db1: adapter: mysql2 encoding: utf8 - reconnect: false database: octoshark_db1 pool: 5 username: root @@ -12,7 +11,6 @@ db1: db2: adapter: mysql2 encoding: utf8 - reconnect: false database: octoshark_db2 pool: 5 username: root diff --git a/spec/support/config.yml.template b/spec/support/config.yml.template index 236b77d..a3c4c5d 100644 --- a/spec/support/config.yml.template +++ b/spec/support/config.yml.template @@ -1,7 +1,6 @@ db1: adapter: mysql2 encoding: utf8 - reconnect: false database: octoshark_db1 pool: 5 username: root @@ -12,7 +11,6 @@ db1: db2: adapter: mysql2 encoding: utf8 - reconnect: false database: octoshark_db2 pool: 5 username: root From 5012a61eb007010409b9da10e17df98c6382a6a5 Mon Sep 17 00:00:00 2001 From: Dalibor Nasevic Date: Thu, 26 Oct 2023 12:38:59 +0200 Subject: [PATCH 2/8] Fix RSpec deprecation warning --- octoshark.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/octoshark.gemspec b/octoshark.gemspec index c33e1de..209216f 100644 --- a/octoshark.gemspec +++ b/octoshark.gemspec @@ -21,7 +21,7 @@ Gem::Specification.new do |spec| spec.add_runtime_dependency "activerecord", ">= 3.0" spec.add_development_dependency "rake" - spec.add_development_dependency "rspec", "~> 3.7.0" + spec.add_development_dependency "rspec", "~> 3.12.0" spec.add_development_dependency "sqlite3", "~> 1.4.1" spec.add_development_dependency "mysql2", "~> 0.5.2" spec.add_development_dependency "appraisal" From 79a3aea01e913ea9f3627f1f62e4ecc18cbdd796 Mon Sep 17 00:00:00 2001 From: Dalibor Nasevic Date: Thu, 26 Oct 2023 12:39:10 +0200 Subject: [PATCH 3/8] Bump default ruby version to 3.2.2 --- .ruby-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ruby-version b/.ruby-version index b502146..be94e6f 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.0.2 +3.2.2 From 6fb08cc3b559e7f4a1ef0b8707c0e29eb3947e97 Mon Sep 17 00:00:00 2001 From: Dalibor Nasevic Date: Thu, 26 Oct 2023 12:53:02 +0200 Subject: [PATCH 4/8] Cleanup Appraisals file --- Appraisals | 14 ++++---------- gemfiles/rails5.1.gemfile | 2 -- gemfiles/rails5.2.gemfile | 2 -- gemfiles/rails6.0.gemfile | 2 -- gemfiles/rails6.1.gemfile | 2 -- gemfiles/rails7.0.gemfile | 2 -- 6 files changed, 4 insertions(+), 20 deletions(-) diff --git a/Appraisals b/Appraisals index ac317fa..2784573 100644 --- a/Appraisals +++ b/Appraisals @@ -1,29 +1,23 @@ appraise "rails5.1" do gem "activerecord", "~> 5.1.0" - gem "mysql2", "~> 0.5.2" - gem "sqlite3", "~> 1.4.1" end appraise "rails5.2" do gem "activerecord", "~> 5.2.0" - gem "mysql2", "~> 0.5.2" - gem "sqlite3", "~> 1.4.1" end appraise "rails6.0" do gem "activerecord", "~> 6.0.0" - gem "mysql2", "~> 0.5.2" - gem "sqlite3", "~> 1.4.1" end appraise "rails6.1" do gem "activerecord", "~> 6.1.0" - gem "mysql2", "~> 0.5.2" - gem "sqlite3", "~> 1.4.1" end appraise "rails7.0" do gem "activerecord", "~> 7.0.0" - gem "mysql2", "~> 0.5" - gem "sqlite3", "~> 1.4" +end + +appraise "rails7.1" do + gem "activerecord", "~> 7.1.0" end diff --git a/gemfiles/rails5.1.gemfile b/gemfiles/rails5.1.gemfile index 2e39bfe..e2f8f85 100644 --- a/gemfiles/rails5.1.gemfile +++ b/gemfiles/rails5.1.gemfile @@ -3,7 +3,5 @@ source "https://rubygems.org" gem "activerecord", "~> 5.1.0" -gem "mysql2", "~> 0.5.2" -gem "sqlite3", "~> 1.4.1" gemspec path: "../" diff --git a/gemfiles/rails5.2.gemfile b/gemfiles/rails5.2.gemfile index a745240..027888d 100644 --- a/gemfiles/rails5.2.gemfile +++ b/gemfiles/rails5.2.gemfile @@ -3,7 +3,5 @@ source "https://rubygems.org" gem "activerecord", "~> 5.2.0" -gem "mysql2", "~> 0.5.2" -gem "sqlite3", "~> 1.4.1" gemspec path: "../" diff --git a/gemfiles/rails6.0.gemfile b/gemfiles/rails6.0.gemfile index 84d6c8b..b07bd13 100644 --- a/gemfiles/rails6.0.gemfile +++ b/gemfiles/rails6.0.gemfile @@ -3,7 +3,5 @@ source "https://rubygems.org" gem "activerecord", "~> 6.0.0" -gem "mysql2", "~> 0.5.2" -gem "sqlite3", "~> 1.4.1" gemspec path: "../" diff --git a/gemfiles/rails6.1.gemfile b/gemfiles/rails6.1.gemfile index a9ebb29..07548db 100644 --- a/gemfiles/rails6.1.gemfile +++ b/gemfiles/rails6.1.gemfile @@ -3,7 +3,5 @@ source "https://rubygems.org" gem "activerecord", "~> 6.1.0" -gem "mysql2", "~> 0.5.2" -gem "sqlite3", "~> 1.4.1" gemspec path: "../" diff --git a/gemfiles/rails7.0.gemfile b/gemfiles/rails7.0.gemfile index 254b2f7..bc1dfc9 100644 --- a/gemfiles/rails7.0.gemfile +++ b/gemfiles/rails7.0.gemfile @@ -3,7 +3,5 @@ source "https://rubygems.org" gem "activerecord", "~> 7.0.0" -gem "mysql2", "~> 0.5" -gem "sqlite3", "~> 1.4" gemspec path: "../" From dc3787a8c9d8e07fe55b9ff855f560e865d7da5c Mon Sep 17 00:00:00 2001 From: Dalibor Nasevic Date: Thu, 26 Oct 2023 12:53:46 +0200 Subject: [PATCH 5/8] Add Rails 7.1 to build matrix --- .github/workflows/build.yml | 5 +++++ Gemfile | 2 +- gemfiles/rails7.1.gemfile | 7 +++++++ 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 gemfiles/rails7.1.gemfile diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1a8c725..a0b6f4e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -106,6 +106,11 @@ jobs: - gemfile: rails7.0 ruby: 3.0 + - gemfile: rails7.1 + ruby: 3.0 + - gemfile: rails7.1 + ruby: 3.2 + env: BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile BUNDLE_PATH_RELATIVE_TO_CWD: true diff --git a/Gemfile b/Gemfile index 6741bed..8c8b150 100644 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,5 @@ source 'https://rubygems.org' -gem "activerecord", "~> 7.0.0" +gem "activerecord", "~> 7.1.0" # Specify your gem's dependencies in octoshark.gemspec gemspec diff --git a/gemfiles/rails7.1.gemfile b/gemfiles/rails7.1.gemfile new file mode 100644 index 0000000..69bc38a --- /dev/null +++ b/gemfiles/rails7.1.gemfile @@ -0,0 +1,7 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "activerecord", "~> 7.1.0" + +gemspec path: "../" From d6109e933f071bc707aaada7ea3dddd38902c604 Mon Sep 17 00:00:00 2001 From: Dalibor Nasevic Date: Fri, 27 Oct 2023 09:44:40 +0200 Subject: [PATCH 6/8] Rails 7.1 needs this the explicit require --- lib/octoshark/connection_pools_manager.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/octoshark/connection_pools_manager.rb b/lib/octoshark/connection_pools_manager.rb index d4be4bd..982a5a5 100644 --- a/lib/octoshark/connection_pools_manager.rb +++ b/lib/octoshark/connection_pools_manager.rb @@ -81,6 +81,7 @@ def create_connection_pool(name, config) def build_connection_pool_spec(name, config) if active_record_6_1_or_7? env_name = defined?(Rails) ? Rails.env : nil + require "active_record/database_configurations" db_config = ActiveRecord::DatabaseConfigurations::HashConfig.new(env_name, name, config) pool_config_class = ActiveRecord::ConnectionAdapters::PoolConfig From 84e33b28ed03665986e33ad696283c91a923ce95 Mon Sep 17 00:00:00 2001 From: Dalibor Nasevic Date: Fri, 27 Oct 2023 11:05:25 +0200 Subject: [PATCH 7/8] Drop legacy test job because ubuntu-18.04 build node is not available anymore --- .github/workflows/build.yml | 63 ++----------------------------------- gemfiles/rails3.0.gemfile | 9 ------ gemfiles/rails3.1.gemfile | 9 ------ gemfiles/rails3.2.gemfile | 9 ------ gemfiles/rails4.0.gemfile | 9 ------ gemfiles/rails4.1.gemfile | 9 ------ gemfiles/rails4.2.gemfile | 9 ------ 7 files changed, 3 insertions(+), 114 deletions(-) delete mode 100644 gemfiles/rails3.0.gemfile delete mode 100644 gemfiles/rails3.1.gemfile delete mode 100644 gemfiles/rails3.2.gemfile delete mode 100644 gemfiles/rails4.0.gemfile delete mode 100644 gemfiles/rails4.1.gemfile delete mode 100644 gemfiles/rails4.2.gemfile diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a0b6f4e..db8e3dc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,63 +9,6 @@ on: - master jobs: - legacy: - runs-on: ubuntu-18.04 - services: - mysql: - image: mysql:5.5 - env: - MYSQL_ROOT_PASSWORD: pass - ports: - - "3306:3306" - options: >- - --health-cmd="mysqladmin ping" - --health-interval=10s - --health-timeout=5s - --health-retries=3 - - name: ruby-${{ matrix.ruby }} ${{ matrix.gemfile }} - strategy: - matrix: - include: - - gemfile: rails3.0 - ruby: 2.4 - - gemfile: rails3.1 - ruby: 2.4 - - gemfile: rails3.2 - ruby: 2.4 - - - gemfile: rails4.0 - ruby: 2.4 - - gemfile: rails4.1 - ruby: 2.4 - - gemfile: rails4.2 - ruby: 2.4 - - env: - BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile - BUNDLE_PATH_RELATIVE_TO_CWD: true - - steps: - - uses: actions/checkout@master - - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: ${{ matrix.ruby }} - bundler: default - bundler-cache: true - - - name: Set up database - run: | - cp spec/support/config.yml.github spec/support/config.yml - bundle exec rake db:create - - - name: Run tests - run: | - bundle exec rspec spec - - latest: runs-on: ubuntu-latest services: @@ -101,13 +44,13 @@ jobs: - gemfile: rails6.1 ruby: 3.0 - - gemfile: rails7.0 - ruby: 2.7 - gemfile: rails7.0 ruby: 3.0 + - gemfile: rails7.0 + ruby: 3.1 - gemfile: rails7.1 - ruby: 3.0 + ruby: 3.1 - gemfile: rails7.1 ruby: 3.2 diff --git a/gemfiles/rails3.0.gemfile b/gemfiles/rails3.0.gemfile deleted file mode 100644 index d4744cf..0000000 --- a/gemfiles/rails3.0.gemfile +++ /dev/null @@ -1,9 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "activerecord", "~> 3.0.0" -gem "mysql2", "< 0.3" -gem "sqlite3", "~> 1.3.13" - -gemspec path: "../" diff --git a/gemfiles/rails3.1.gemfile b/gemfiles/rails3.1.gemfile deleted file mode 100644 index 401354b..0000000 --- a/gemfiles/rails3.1.gemfile +++ /dev/null @@ -1,9 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "activerecord", "~> 3.1.0" -gem "mysql2", "~> 0.3.10" -gem "sqlite3", "~> 1.3.13" - -gemspec path: "../" diff --git a/gemfiles/rails3.2.gemfile b/gemfiles/rails3.2.gemfile deleted file mode 100644 index 3d8a447..0000000 --- a/gemfiles/rails3.2.gemfile +++ /dev/null @@ -1,9 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "activerecord", "~> 3.2.0" -gem "mysql2", "~> 0.3.10" -gem "sqlite3", "~> 1.3.13" - -gemspec path: "../" diff --git a/gemfiles/rails4.0.gemfile b/gemfiles/rails4.0.gemfile deleted file mode 100644 index 16438b9..0000000 --- a/gemfiles/rails4.0.gemfile +++ /dev/null @@ -1,9 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "activerecord", "~> 4.0.0" -gem "mysql2", "~> 0.3.10" -gem "sqlite3", "~> 1.3.13" - -gemspec path: "../" diff --git a/gemfiles/rails4.1.gemfile b/gemfiles/rails4.1.gemfile deleted file mode 100644 index 57ba79c..0000000 --- a/gemfiles/rails4.1.gemfile +++ /dev/null @@ -1,9 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "activerecord", "~> 4.1.0" -gem "mysql2", "~> 0.3.13" -gem "sqlite3", "~> 1.3.13" - -gemspec path: "../" diff --git a/gemfiles/rails4.2.gemfile b/gemfiles/rails4.2.gemfile deleted file mode 100644 index 9457e49..0000000 --- a/gemfiles/rails4.2.gemfile +++ /dev/null @@ -1,9 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "activerecord", "~> 4.2.0" -gem "mysql2", "~> 0.3.13" -gem "sqlite3", "~> 1.3.13" - -gemspec path: "../" From f08b3f97f8c0729fb353617060ba9421f67b5068 Mon Sep 17 00:00:00 2001 From: Dalibor Nasevic Date: Fri, 27 Oct 2023 11:14:48 +0200 Subject: [PATCH 8/8] Bump version and update change log --- CHANGELOG.md | 5 +++++ lib/octoshark/version.rb | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index de1727b..9eb867d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Change log +## 0.5.0 2023-10-27 + +- Add support for Rails 7.1 +- Drop legacy test job because ubuntu-18.04 build node is not available anymore + ## 0.4.0 2022-02-12 - Add support for Rails 7.0 diff --git a/lib/octoshark/version.rb b/lib/octoshark/version.rb index 8ae28ff..342d788 100644 --- a/lib/octoshark/version.rb +++ b/lib/octoshark/version.rb @@ -1,3 +1,3 @@ module Octoshark - VERSION = "0.4.0" + VERSION = "0.5.0" end