Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps!: drop support for activerecord 5.2 & 6.0, ruby 2.7; ci: modernize #31

Merged
merged 3 commits into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: [ '2.7' ]
ruby: [ '3.0' ]

steps:
- name: Checkout the code
Expand All @@ -32,14 +32,13 @@ jobs:
run: bundle exec rubocop

test:
name: Test (Ruby ${{ matrix.ruby }}, activerecord ${{ matrix.activerecord }}, pg ${{ matrix.pg }})
name: Test (Ruby ${{ matrix.ruby }}, activerecord ${{ matrix.activerecord }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
activerecord: [ '5.2', '6.0', '6.1', '7.0', '7.1' ]
pg: [ '1.1', '1.2' ] # FU: Build against common pg 1.x minor versions
ruby: [ '2.7' ] # FU: Build against common ruby 3.x minor versions
activerecord: [ '6.1', '7.0', '7.1' ]
ruby: [ '3.0', '3.1', '3.2' ]
timeout-minutes: 10
needs:
- lint
Expand Down Expand Up @@ -74,11 +73,8 @@ jobs:
- name: Install postgresql-client
run: sudo apt update && sudo apt install postgresql-client

- name: Install dependencies
run: bundle install

- name: Install appraisal
run: bundle exec appraisal install
- name: Install activerecord_${{ matrix.activerecord }} dependencies
run: BUNDLE_GEMFILE=gemfiles/activerecord_${{ matrix.activerecord }}.gemfile bundle install

- name: Appraise rails-${{ matrix.activerecord }}_pg-${{ matrix.pg }}
run: bundle exec appraisal rails-${{ matrix.activerecord }}_pg-${{ matrix.pg }} rspec
- name: Appraise activerecord_${{ matrix.activerecord }}
run: bundle exec appraisal activerecord_${{ matrix.activerecord }} rspec
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ inherit_gem:
ezcater_rubocop: conf/rubocop_gem.yml

AllCops:
TargetRubyVersion: 2.7
TargetRubyVersion: 3.0
SuggestExtensions: false

Naming/FileName:
Expand Down
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ruby 2.7.8
ruby 3.0.6
44 changes: 3 additions & 41 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,51 +1,13 @@
# frozen_string_literal: true

appraise "rails-5.2_pg-1.1" do
gem "activerecord", "5.2.1"
gem "pg", "1.1.4"
end

appraise "rails-5.2_pg-1.2" do
gem "activerecord", "5.2.1"
gem "pg", "1.2.0"
end

appraise "rails-6.0_pg-1.1" do
gem "activerecord", ">= 6.0.0", "< 6.1"
gem "pg", "1.1.4"
end

appraise "rails-6.0_pg-1.2" do
gem "activerecord", ">= 6.0.0", "< 6.1"
gem "pg", "1.2.0"
end

appraise "rails-6.1_pg-1.1" do
appraise "activerecord_6.1" do
gem "activerecord", ">= 6.1.0", "< 6.2"
gem "pg", "1.1.4"
end

appraise "rails-6.1_pg-1.2" do
gem "activerecord", ">= 6.1.0", "< 6.2"
gem "pg", "1.2.0"
end

appraise "rails-7.0_pg-1.1" do
gem "activerecord", ">= 7.0.0", "< 7.1"
gem "pg", "1.1.4"
end

appraise "rails-7.0_pg-1.2" do
appraise "activerecord_7.0" do
gem "activerecord", ">= 7.0.0", "< 7.1"
gem "pg", "1.2.0"
end

appraise "rails-7.1_pg-1.1" do
gem "activerecord", ">= 7.1.0", "< 7.2"
gem "pg", "1.1.4"
end

appraise "rails-7.1_pg-1.2" do
appraise "activerecord_7.1" do
gem "activerecord", ">= 7.1.0", "< 7.2"
gem "pg", "1.2.0"
end
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# activerecord-postgres_pub_sub

## Unreleased
- BREAKING: Drop support for ActiveRecord 5.2, 6.0
- BREAKING: Drop support for ruby < 3.0

## v2.3.0
- Add support for Rails 7.1

Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@ rails generate active_record:postgres_pub_sub:notify_on_insert --model_name Name
In this example, notification events would be generated for the channel named `"name_space_entity"` based
on inserts to the `name_space_entities` table.

## Supported dependencies

This gem will not support versions of ruby and activerecord which no
longer receive security updates. It will support the latest major
version of the pg gem and it will be tested against the latest minor /
patch version of that gem.

## Development

After checking out the repo, run `bin/setup` to install dependencies. Then,
Expand Down
6 changes: 3 additions & 3 deletions activerecord-postgres_pub_sub.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ Gem::Specification.new do |spec|
spec.bindir = "bin"
spec.executables = []
spec.require_paths = ["lib"]
spec.required_ruby_version = ">= 2.7.0"
spec.required_ruby_version = ">= 3.0.0"

spec.add_runtime_dependency "activerecord", "> 5.1", "< 7.2"
spec.add_runtime_dependency "activerecord", "> 6.0", "< 7.2"
spec.add_runtime_dependency "pg", "~> 1.1"
spec.add_runtime_dependency "private_attr"
spec.add_runtime_dependency "with_advisory_lock"

spec.add_development_dependency "appraisal"
spec.add_development_dependency "bundler", ">= 2.4.0"
spec.add_development_dependency "bundler", "~> 2.2"
spec.add_development_dependency "database_cleaner"
spec.add_development_dependency "ezcater_matchers"
spec.add_development_dependency "ezcater_rubocop", "~> 6.1.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@
source "https://rubygems.org"

gem "activerecord", ">= 6.1.0", "< 6.2"
gem "pg", "1.1.4"

gemspec path: "../"
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@
source "https://rubygems.org"

gem "activerecord", ">= 7.0.0", "< 7.1"
gem "pg", "1.1.4"

gemspec path: "../"
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

source "https://rubygems.org"

gem "activerecord", "5.2.1"
gem "pg", "1.1.4"
gem "activerecord", ">= 7.1.0", "< 7.2"

gemspec path: "../"
8 changes: 0 additions & 8 deletions gemfiles/rails_5.1.gemfile

This file was deleted.

8 changes: 0 additions & 8 deletions gemfiles/rails_5.2_pg_0.18.gemfile

This file was deleted.

8 changes: 0 additions & 8 deletions gemfiles/rails_5.2_pg_1.2.gemfile

This file was deleted.

8 changes: 0 additions & 8 deletions gemfiles/rails_6.0_pg_0.18.gemfile

This file was deleted.

8 changes: 0 additions & 8 deletions gemfiles/rails_6.0_pg_1.1.gemfile

This file was deleted.

8 changes: 0 additions & 8 deletions gemfiles/rails_6.0_pg_1.2.gemfile

This file was deleted.

8 changes: 0 additions & 8 deletions gemfiles/rails_6.1_pg_1.2.gemfile

This file was deleted.

8 changes: 0 additions & 8 deletions gemfiles/rails_7.0_pg_1.2.gemfile

This file was deleted.

4 changes: 2 additions & 2 deletions spec/active_record/postgres_pub_sub/listener_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
end
let!(:listener_thread) do
Thread.new do
listener_loop(listener_options)
listener_loop(**listener_options)
ensure
ActiveRecord::Base.clear_active_connections!
end
Expand All @@ -40,7 +40,7 @@
context "when using 1-arg version of #on_notify" do
let!(:listener_thread) do
Thread.new do
listener_loop(listener_options) do |listener|
listener_loop(**listener_options) do |listener|
listener.on_notify do |payload|
state.count += 1
state.payloads << payload
Expand Down