From 83504ac2b897c4109c9fe6261b22740415cf746e Mon Sep 17 00:00:00 2001 From: Suleyman Musayev Date: Wed, 13 Dec 2023 10:17:46 +0500 Subject: [PATCH 1/9] update gemspec for rails 7.1, add rails 7.1 gemfile, update test helper for default timezone --- authlogic.gemspec | 7 ++++--- gemfiles/rails_7.1.rb | 9 +++++++++ test/test_helper.rb | 7 ++++++- 3 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 gemfiles/rails_7.1.rb diff --git a/authlogic.gemspec b/authlogic.gemspec index 9792581b..e92abf31 100644 --- a/authlogic.gemspec +++ b/authlogic.gemspec @@ -25,13 +25,14 @@ require "authlogic/version" s.required_ruby_version = ">= 2.6.0" # See doc/rails_support_in_authlogic_5.0.md - s.add_dependency "activemodel", [">= 5.2", "< 7.1"] - s.add_dependency "activerecord", [">= 5.2", "< 7.1"] - s.add_dependency "activesupport", [">= 5.2", "< 7.1"] + s.add_dependency "activemodel", [">= 5.2", "< 7.2"] + s.add_dependency "activerecord", [">= 5.2", "< 7.2"] + s.add_dependency "activesupport", [">= 5.2", "< 7.2"] s.add_dependency "request_store", "~> 1.0" s.add_development_dependency "bcrypt", "~> 3.1" s.add_development_dependency "byebug", "~> 10.0" s.add_development_dependency "coveralls", "~> 0.8.22" + s.add_development_dependency "minitest", "< 5.19.0" # See https://github.com/binarylogic/authlogic/issues/766 s.add_development_dependency "minitest-reporters", "~> 1.3" s.add_development_dependency "mysql2", "~> 0.5.2" s.add_development_dependency "pg", "~> 1.1.4" diff --git a/gemfiles/rails_7.1.rb b/gemfiles/rails_7.1.rb new file mode 100644 index 00000000..79b38641 --- /dev/null +++ b/gemfiles/rails_7.1.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +git_source(:github) { |repo| "https://github.com/#{repo}.git" } + +source "https://rubygems.org" +gemspec path: ".." + +gem "activerecord", "~> 7.1" +gem "activesupport", "~> 7.1" diff --git a/test/test_helper.rb b/test/test_helper.rb index 2aecd808..43ae44ab 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -62,7 +62,12 @@ ActiveSupport.test_order = :sorted end -ActiveRecord::Base.default_timezone = :local +if ActiveRecord::VERSION::STRING < "7.1" + ActiveRecord::Base.default_timezone = :local +else + ActiveRecord.default_timezone = :local +end + ActiveRecord::Schema.define(version: 1) do create_table :companies do |t| t.datetime :created_at, limit: 6 From cb3762dad1b0eb28b0870589d4bd795284f58306 Mon Sep 17 00:00:00 2001 From: Suleyman Musayev Date: Wed, 13 Dec 2023 10:18:03 +0500 Subject: [PATCH 2/9] update github workflow tests file --- .github/workflows/test.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7864f029..bf4a390c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -56,7 +56,7 @@ jobs: # have set this up with each database as a separate job, but then we'd be # duplicating the matrix configuration three times. matrix: - gemfile: [ 'rails_5.2', 'rails_6.0', 'rails_6.1', 'rails_7.0' ] + gemfile: [ 'rails_5.2', 'rails_6.0', 'rails_6.1', 'rails_7.0', 'rails_7.1' ] # To keep matrix size down, only test highest and lowest rubies. In # `.rubocopy.yml`, set `TargetRubyVersion`, to the lowest ruby version @@ -67,6 +67,8 @@ jobs: # rails 7 requires ruby >= 2.7.0 - ruby: '2.6' gemfile: 'rails_7.0' + - ruby: '2.7' + gemfile: 'rails_7.1' steps: - name: Checkout source uses: actions/checkout@v2 From c9f3dfd3349db95dca5481b1d6bb801192645fc9 Mon Sep 17 00:00:00 2001 From: Suleyman Musayev Date: Wed, 13 Dec 2023 10:18:24 +0500 Subject: [PATCH 3/9] update changelog and bump version --- CHANGELOG.md | 10 ++++++++++ CONTRIBUTING.md | 4 ++++ lib/authlogic/version.rb | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ac34fff..9793b041 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,16 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. * Fixed * None +## 6.4.3 (2023-12-13) + +* Breaking Changes + * None +* Added + * None +* Fixed + * [#768](https://github.com/binarylogic/authlogic/issues/768) - Fixed + compatibility issues with Rails 7.1 + ## 6.4.2 (2021-12-21) * Breaking Changes diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bd19c414..fdef8d9c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -48,6 +48,10 @@ BUNDLE_GEMFILE=gemfiles/rails_6.1.rb bundle exec rake # Rails 7.0 BUNDLE_GEMFILE=gemfiles/rails_7.0.rb bundle install BUNDLE_GEMFILE=gemfiles/rails_7.0.rb bundle exec rake + +# Rails 7.1 +BUNDLE_GEMFILE=gemfiles/rails_7.1.rb bundle install +BUNDLE_GEMFILE=gemfiles/rails_7.1.rb bundle exec rake ``` To run a single test: diff --git a/lib/authlogic/version.rb b/lib/authlogic/version.rb index 6452225d..5002164a 100644 --- a/lib/authlogic/version.rb +++ b/lib/authlogic/version.rb @@ -17,6 +17,6 @@ module Authlogic # # @api public def self.gem_version - ::Gem::Version.new("6.4.2") + ::Gem::Version.new("6.4.3") end end From 58b047e76032a2aa7193ff113af4738d166528e5 Mon Sep 17 00:00:00 2001 From: Suleyman Musayev Date: Wed, 13 Dec 2023 15:29:25 +0500 Subject: [PATCH 4/9] fix ruby version in github test workflow --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bf4a390c..30c0e606 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -67,7 +67,7 @@ jobs: # rails 7 requires ruby >= 2.7.0 - ruby: '2.6' gemfile: 'rails_7.0' - - ruby: '2.7' + - ruby: '2.6' gemfile: 'rails_7.1' steps: - name: Checkout source From bfbd47cc70c5d05627bfd2688cee529b8ede2764 Mon Sep 17 00:00:00 2001 From: Suleyman Musayev Date: Fri, 15 Dec 2023 08:09:02 +0500 Subject: [PATCH 5/9] update ubuntu version in ci to latest --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 30c0e606..81228b4e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,7 +6,7 @@ jobs: # and secondarily because jobs are performed concurrently. gha-job-authlogic-lint: name: Lint - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest steps: - name: Checkout source uses: actions/checkout@v2 @@ -25,7 +25,7 @@ jobs: # The test job is a matrix of ruby/rails versions. gha-job-authlogic-test: name: Ruby ${{ matrix.ruby }}, ${{ matrix.gemfile }}.rb - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest services: gha-service-authlogic-mysql: env: From 54dcc91fd2df8a8e783b9dc1d2c508fdc33578be Mon Sep 17 00:00:00 2001 From: Suleyman Musayev Date: Fri, 15 Dec 2023 08:17:52 +0500 Subject: [PATCH 6/9] update action to set ruby version --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 81228b4e..08763706 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ jobs: - name: Checkout source uses: actions/checkout@v2 - name: Setup ruby - uses: actions/setup-ruby@v1 + uses: ruby/setup-ruby@v1 with: # Set to `TargetRubyVersion` in `.rubocopy.yml` ruby-version: 2.6 @@ -73,7 +73,7 @@ jobs: - name: Checkout source uses: actions/checkout@v2 - name: Setup ruby - uses: actions/setup-ruby@v1 + uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} - name: Bundle From eb1fdf21dd5afe1d803310bec728b361d3e61cc9 Mon Sep 17 00:00:00 2001 From: Suleyman Musayev Date: Sun, 17 Dec 2023 18:42:51 +0500 Subject: [PATCH 7/9] rollback version bump and update changelog --- CHANGELOG.md | 1 + lib/authlogic/version.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c43a4e0..10fde4ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. * Fixed * [#768](https://github.com/binarylogic/authlogic/issues/768) - Fixed compatibility issues with Rails 7.1 + * [#769](https://github.com/binarylogic/authlogic/issues/769) - Fixed GH workflow ## 6.4.2 (2021-12-21) diff --git a/lib/authlogic/version.rb b/lib/authlogic/version.rb index 5002164a..6452225d 100644 --- a/lib/authlogic/version.rb +++ b/lib/authlogic/version.rb @@ -17,6 +17,6 @@ module Authlogic # # @api public def self.gem_version - ::Gem::Version.new("6.4.3") + ::Gem::Version.new("6.4.2") end end From 8f6844d8937af07edd5b979820a12db397034524 Mon Sep 17 00:00:00 2001 From: Suleyman Musayev Date: Sun, 17 Dec 2023 18:43:43 +0500 Subject: [PATCH 8/9] update changelog --- CHANGELOG.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 10fde4ac..a83a0d13 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,9 +21,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. * Added * None * Fixed - * [#768](https://github.com/binarylogic/authlogic/issues/768) - Fixed - compatibility issues with Rails 7.1 - * [#769](https://github.com/binarylogic/authlogic/issues/769) - Fixed GH workflow + * [#769](https://github.com/binarylogic/authlogic/issues/769) - Fixed GH workflow ## 6.4.2 (2021-12-21) From f93bba1e87a8f8aa61daf13aae32d07ecf5b2946 Mon Sep 17 00:00:00 2001 From: Suleyman Musayev Date: Sun, 17 Dec 2023 18:50:43 +0500 Subject: [PATCH 9/9] assign bundler version for failing gh actions --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 08763706..7740f3bd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,7 +17,7 @@ jobs: ruby-version: 2.6 - name: Bundle run: | - gem install bundler + gem install bundler -v 2.4.22 bundle install --jobs 4 --retry 3 - name: Lint run: bundle exec rubocop @@ -78,7 +78,7 @@ jobs: ruby-version: ${{ matrix.ruby }} - name: Bundle run: | - gem install bundler + gem install bundler -v 2.4.22 bundle install --jobs 4 --retry 3 env: BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.rb