From f67bcf8c4a9e35e13e6a23dcb37860b3649ea843 Mon Sep 17 00:00:00 2001 From: "P.T" Date: Wed, 23 Apr 2025 11:34:55 +0200 Subject: [PATCH 01/13] allow rails 7.2 --- webhook_system.gemspec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/webhook_system.gemspec b/webhook_system.gemspec index b932e9b..7c80763 100644 --- a/webhook_system.gemspec +++ b/webhook_system.gemspec @@ -37,9 +37,9 @@ Gem::Specification.new do |gem| } gem.required_ruby_version = '> 2.7.0' - gem.add_runtime_dependency 'activesupport', '> 5.0', '< 7.2' - gem.add_runtime_dependency 'activerecord', '> 5.0', '< 7.2' - gem.add_runtime_dependency 'activejob', '> 5.0', '< 7.2' + gem.add_runtime_dependency 'activesupport', '> 5.0', '< 8.0' + gem.add_runtime_dependency 'activerecord', '> 5.0', '< 8.0' + gem.add_runtime_dependency 'activejob', '> 5.0', '< 8.0' gem.add_runtime_dependency 'faraday', '> 0.9' gem.add_runtime_dependency 'faraday-encoding', '>= 0.0.2', '< 1.0' gem.add_runtime_dependency 'ph_model' From b423198c35e401f5d59b650d38c5867dfcc64ae5 Mon Sep 17 00:00:00 2001 From: "P.T" Date: Wed, 23 Apr 2025 11:36:49 +0200 Subject: [PATCH 02/13] added to ci config --- .github/workflows/ci.yml | 2 +- gemfiles/rails_7.2.gemfile | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 gemfiles/rails_7.2.gemfile diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c9a57e1..2d6576d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ jobs: strategy: fail-fast: false matrix: - gemfile: ['rails_7.0', 'rails_7.1'] + gemfile: ['rails_7.0', 'rails_7.1', 'rails_7.2'] ruby: [3.3, 3.2, 3.1] include: - gemfile: rails_7.0 diff --git a/gemfiles/rails_7.2.gemfile b/gemfiles/rails_7.2.gemfile new file mode 100644 index 0000000..943e32e --- /dev/null +++ b/gemfiles/rails_7.2.gemfile @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +source "https://rubygems.org" + +gem "active_attr", "~> 0.16" # git: "https://github.com/mathieujobin/active_attr", branch: "rails-7.1-support" +gem "rails", "~> 7.2.2.1" +gem "sqlite3" + +gemspec path: "../" From df986e0c9df7c9c72b1346dbf11b6f9b85348948 Mon Sep 17 00:00:00 2001 From: "P.T" Date: Wed, 23 Apr 2025 11:41:26 +0200 Subject: [PATCH 03/13] use ubuntu 22 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2d6576d..ea7f96b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ on: jobs: test: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 strategy: fail-fast: false matrix: From dacc46c29c4b396127244f10bfc5c71146b085c1 Mon Sep 17 00:00:00 2001 From: "P.T" Date: Wed, 23 Apr 2025 11:46:57 +0200 Subject: [PATCH 04/13] rubocop --- .rubocop.yml | 2 +- .rubocop_todo.yml | 44 +++------------------------------ spec/support/rails_seven_one.rb | 1 + 3 files changed, 6 insertions(+), 41 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 6565e06..68d0f96 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,4 +1,4 @@ -require: +plugins: - rubocop-rails - rubocop-rspec - rubocop-performance diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 009c986..348ccca 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,19 +1,11 @@ # This configuration was generated by -# `rubocop --auto-gen-config --exclude-limit 180` -# on 2023-10-30 03:57:18 UTC using RuboCop version 1.57.2. +# `rubocop --auto-gen-config` +# on 2025-04-23 09:45:32 UTC using RuboCop version 1.75.3. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new # versions of RuboCop, may require this file to be generated again. -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation, Include. -# Include: **/*.gemfile, **/Gemfile, **/gems.rb -Bundler/OrderedGems: - Exclude: - - 'gemfiles/rails_7.1.gemfile' - # Offense count: 1 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: AllowSafeAssignment. @@ -21,12 +13,6 @@ Lint/AssignmentInCondition: Exclude: - 'lib/webhook_system/subscription.rb' -# Offense count: 1 -# This cop supports unsafe autocorrection (--autocorrect-all). -Lint/RedundantDirGlobSort: - Exclude: - - 'spec/spec_helper.rb' - # Offense count: 1 Lint/UnreachableCode: Exclude: @@ -71,16 +57,6 @@ RSpec/DescribeClass: RSpec/ExampleLength: Max: 24 -# Offense count: 4 -# Configuration parameters: Include, CustomTransform, IgnoreMethods, SpecSuffixOnly. -# Include: **/*_spec*rb*, **/spec/**/* -RSpec/FilePath: - Exclude: - - 'spec/encoder_spec.rb' - - 'spec/event_log_spec.rb' - - 'spec/event_spec.rb' - - 'spec/models_spec.rb' - # Offense count: 11 # Configuration parameters: Max, AllowedIdentifiers, AllowedPatterns. RSpec/IndexedLet: @@ -136,6 +112,7 @@ RSpec/NestedGroups: # Offense count: 3 # This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AutoCorrect. RSpec/ScatteredSetup: Exclude: - 'spec/models_spec.rb' @@ -156,12 +133,6 @@ RSpec/VerifiedDoubles: Exclude: - 'spec/event_log_spec.rb' -# Offense count: 1 -# This cop supports unsafe autocorrection (--autocorrect-all). -Rails/RedundantPresenceValidationOnBelongsTo: - Exclude: - - 'lib/webhook_system/event_log.rb' - # Offense count: 3 # Configuration parameters: AllowedConstants. Style/Documentation: @@ -169,7 +140,6 @@ Style/Documentation: - 'lib/webhook_system.rb' - 'lib/webhook_system/encoder.rb' - 'lib/webhook_system/subscription_topic.rb' - - 'spec/support/rails_seven_one.rb' # Offense count: 1 # This cop supports safe autocorrection (--autocorrect). @@ -178,7 +148,7 @@ Style/MultilineIfModifier: - 'spec/support/rails_seven_one.rb' # Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). +# This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: EnforcedStyle, AllowedCompactTypes. # SupportedStyles: compact, exploded Style/RaiseArgs: @@ -191,12 +161,6 @@ Style/RedundantConstantBase: Exclude: - 'spec/event_spec.rb' -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -Style/RedundantFreeze: - Exclude: - - 'lib/webhook_system/subscription.rb' - # Offense count: 1 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle, AllowInnerSlashes. diff --git a/spec/support/rails_seven_one.rb b/spec/support/rails_seven_one.rb index 9c92360..cbce39d 100644 --- a/spec/support/rails_seven_one.rb +++ b/spec/support/rails_seven_one.rb @@ -4,6 +4,7 @@ module ActiveSupport module Testing + # :nodoc: module Assertions # Assertion that the block should not raise an exception. # From feaf9aa239339cca24c006132c0a29bebb81f087 Mon Sep 17 00:00:00 2001 From: "P.T" Date: Wed, 23 Apr 2025 11:54:09 +0200 Subject: [PATCH 05/13] fix param no --- lib/webhook_system/event_log.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/webhook_system/event_log.rb b/lib/webhook_system/event_log.rb index 192084a..9fa0a82 100644 --- a/lib/webhook_system/event_log.rb +++ b/lib/webhook_system/event_log.rb @@ -15,8 +15,8 @@ class EventLog < ActiveRecord::Base validates :event_name, presence: true validates :status, presence: true - serialize :request, JSON - serialize :response, JSON + serialize :request, coder: JSON + serialize :response, coder: JSON def self.construct(subscription, event, request, response) request_info = { From 677a6946993b96e2d340bbb84c0c76fa2dcad5cb Mon Sep 17 00:00:00 2001 From: "P.T" Date: Wed, 23 Apr 2025 11:57:09 +0200 Subject: [PATCH 06/13] trying 7.0 patch --- gemfiles/rails_7.0.gemfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gemfiles/rails_7.0.gemfile b/gemfiles/rails_7.0.gemfile index f395ee7..00f5ecd 100644 --- a/gemfiles/rails_7.0.gemfile +++ b/gemfiles/rails_7.0.gemfile @@ -2,7 +2,10 @@ source "https://rubygems.org" -gem "rails", "~> 7.0.2" +# gem "rails", "~> 7.0.2" +gem "activesupport", "~> 7.0.2" +gem "activerecord", "~> 7.0.2" +gem "activejob", "~> 7.0.2" gem "sqlite3", "~> 1.4.0" gemspec path: "../" From 325e008b5506d8ecefdb0c61b220325d2b36e779 Mon Sep 17 00:00:00 2001 From: "P.T" Date: Wed, 23 Apr 2025 11:59:41 +0200 Subject: [PATCH 07/13] rubocop --- gemfiles/rails_7.0.gemfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gemfiles/rails_7.0.gemfile b/gemfiles/rails_7.0.gemfile index 00f5ecd..2810753 100644 --- a/gemfiles/rails_7.0.gemfile +++ b/gemfiles/rails_7.0.gemfile @@ -3,9 +3,9 @@ source "https://rubygems.org" # gem "rails", "~> 7.0.2" -gem "activesupport", "~> 7.0.2" -gem "activerecord", "~> 7.0.2" gem "activejob", "~> 7.0.2" +gem "activerecord", "~> 7.0.2" +gem "activesupport", "~> 7.0.2" gem "sqlite3", "~> 1.4.0" gemspec path: "../" From 3ea03e1e06ab65f889c903e3b9a072c8f81be920 Mon Sep 17 00:00:00 2001 From: "P.T" Date: Wed, 23 Apr 2025 12:05:02 +0200 Subject: [PATCH 08/13] try require change --- lib/webhook_system.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/webhook_system.rb b/lib/webhook_system.rb index 9d2ef4d..764c374 100644 --- a/lib/webhook_system.rb +++ b/lib/webhook_system.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'active_support/all' +require 'active_support' require 'active_record' require 'active_job' require 'ph_model' From e9b24b23b2cc2449d969d3455d89c2b500b18c5a Mon Sep 17 00:00:00 2001 From: "P.T" Date: Wed, 23 Apr 2025 12:08:28 +0200 Subject: [PATCH 09/13] try concurrent ruby downgrade --- gemfiles/rails_7.0.gemfile | 6 ++---- lib/webhook_system.rb | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/gemfiles/rails_7.0.gemfile b/gemfiles/rails_7.0.gemfile index 2810753..4a5a7d5 100644 --- a/gemfiles/rails_7.0.gemfile +++ b/gemfiles/rails_7.0.gemfile @@ -2,10 +2,8 @@ source "https://rubygems.org" -# gem "rails", "~> 7.0.2" -gem "activejob", "~> 7.0.2" -gem "activerecord", "~> 7.0.2" -gem "activesupport", "~> 7.0.2" +gem "rails", "~> 7.0.2" +gem "concurrent-ruby", "~> 1.3.4" gem "sqlite3", "~> 1.4.0" gemspec path: "../" diff --git a/lib/webhook_system.rb b/lib/webhook_system.rb index 764c374..9d2ef4d 100644 --- a/lib/webhook_system.rb +++ b/lib/webhook_system.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'active_support' +require 'active_support/all' require 'active_record' require 'active_job' require 'ph_model' From 44e948ab07791388f10a9a15cfa40181a9bde7f3 Mon Sep 17 00:00:00 2001 From: "P.T" Date: Wed, 23 Apr 2025 12:10:16 +0200 Subject: [PATCH 10/13] rubocop --- gemfiles/rails_7.0.gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gemfiles/rails_7.0.gemfile b/gemfiles/rails_7.0.gemfile index 4a5a7d5..0ca4369 100644 --- a/gemfiles/rails_7.0.gemfile +++ b/gemfiles/rails_7.0.gemfile @@ -2,8 +2,8 @@ source "https://rubygems.org" -gem "rails", "~> 7.0.2" gem "concurrent-ruby", "~> 1.3.4" +gem "rails", "~> 7.0.2" gem "sqlite3", "~> 1.4.0" gemspec path: "../" From f6cb66e39db636a40958d3546fd15795840fc782 Mon Sep 17 00:00:00 2001 From: "P.T" Date: Wed, 23 Apr 2025 12:22:01 +0200 Subject: [PATCH 11/13] fixing --- gemfiles/rails_7.0.gemfile | 1 - lib/webhook_system.rb | 1 + webhook_system.gemspec | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gemfiles/rails_7.0.gemfile b/gemfiles/rails_7.0.gemfile index 0ca4369..f395ee7 100644 --- a/gemfiles/rails_7.0.gemfile +++ b/gemfiles/rails_7.0.gemfile @@ -2,7 +2,6 @@ source "https://rubygems.org" -gem "concurrent-ruby", "~> 1.3.4" gem "rails", "~> 7.0.2" gem "sqlite3", "~> 1.4.0" diff --git a/lib/webhook_system.rb b/lib/webhook_system.rb index 9d2ef4d..e58db7a 100644 --- a/lib/webhook_system.rb +++ b/lib/webhook_system.rb @@ -1,5 +1,6 @@ # frozen_string_literal: true +require 'logger' require 'active_support/all' require 'active_record' require 'active_job' diff --git a/webhook_system.gemspec b/webhook_system.gemspec index 7c80763..096f6be 100644 --- a/webhook_system.gemspec +++ b/webhook_system.gemspec @@ -45,7 +45,7 @@ Gem::Specification.new do |gem| gem.add_runtime_dependency 'ph_model' gem.add_runtime_dependency 'validate_url', '~> 1.0' - gem.add_development_dependency 'bundler', '> 1.17', '< 2.6' + gem.add_development_dependency 'bundler', '> 1.17', '< 2.7' gem.add_development_dependency 'coveralls_reborn', '~> 0.25' gem.add_development_dependency 'simplecov-lcov' gem.add_development_dependency 'rake' From c0cc24f9160cf762bc90555fa26d6a01feddfb7a Mon Sep 17 00:00:00 2001 From: "P.T" Date: Wed, 23 Apr 2025 12:25:12 +0200 Subject: [PATCH 12/13] retired tests sub-6.1 because of serialization coder --- .github/workflows/ci.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ea7f96b..162a3d0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,14 +26,6 @@ jobs: ruby: 2.7 - gemfile: rails_6.1 ruby: 2.7 - - gemfile: rails_6.0 - ruby: 2.7 - - gemfile: rails_5.2 - ruby: 2.7 - - gemfile: rails_5.1 - ruby: 2.7 - - gemfile: rails_5.0 - ruby: 2.7 env: BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile From 04c8c14bf64ec2c29e478f213b787d5ddafb5b6c Mon Sep 17 00:00:00 2001 From: "P.T" Date: Wed, 23 Apr 2025 12:25:38 +0200 Subject: [PATCH 13/13] bumped version --- lib/webhook_system/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/webhook_system/version.rb b/lib/webhook_system/version.rb index fd5f19c..00ad6f3 100644 --- a/lib/webhook_system/version.rb +++ b/lib/webhook_system/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module WebhookSystem - VERSION = '2.4.1' + VERSION = '2.4.2' end