From 8a79b039c583bf02883dd0b1e9ab4a8effffb459 Mon Sep 17 00:00:00 2001 From: mukteshd Date: Wed, 8 Oct 2025 14:06:33 +0530 Subject: [PATCH 1/6] replace ddtrace with datadog for new ruby version --- datadog_notifier.gemspec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/datadog_notifier.gemspec b/datadog_notifier.gemspec index cbc67f9..c5c5204 100644 --- a/datadog_notifier.gemspec +++ b/datadog_notifier.gemspec @@ -10,12 +10,12 @@ Gem::Specification.new do |spec| spec.version = DatadogNotifier::VERSION spec.authors = ['Patterninc'] spec.email = ['amol.udage@pattern.com'] - spec.summary = 'Datadog notifier to send custom errors with ddtrace' + spec.summary = 'Datadog notifier to send custom errors with datadog' spec.description = 'Datadog notifier to send custom errors in Datadog error tracking dashboard' spec.homepage = 'https://github.com/patterninc/datadog_notifier' spec.license = 'MIT' - spec.add_dependency 'ddtrace', '>= 1.13.0' + spec.add_dependency 'datadog', '>= 2.0.0' # Specify which files should be added to the gem when it is released. # The `git ls-files -z` loads the files in the RubyGem that have been added into git. From fd9cc314d73f32d172343117b63b6587334fc730 Mon Sep 17 00:00:00 2001 From: mukteshd Date: Wed, 8 Oct 2025 14:25:53 +0530 Subject: [PATCH 2/6] update documentation --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8fc59e1..b14423e 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Or install it yourself as: ### Dependency * [Datadog](https://github.com/DataDog/dd-trace-rb) must be integrated in the project before we use this gem - +* use version <=1.0.4 for ruby <3.4 # Quick Use ## Send notification to datadog(Traces to add errors in Datadog) ```DatadogNotifier.notify(exception, payload_json)``` From b0ed27a05a788b7feb59555e3f334469ae46ef41 Mon Sep 17 00:00:00 2001 From: mukteshd Date: Wed, 8 Oct 2025 14:30:42 +0530 Subject: [PATCH 3/6] make depedency selection conditional --- datadog_notifier.gemspec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/datadog_notifier.gemspec b/datadog_notifier.gemspec index c5c5204..8a7af70 100644 --- a/datadog_notifier.gemspec +++ b/datadog_notifier.gemspec @@ -15,7 +15,11 @@ Gem::Specification.new do |spec| spec.homepage = 'https://github.com/patterninc/datadog_notifier' spec.license = 'MIT' - spec.add_dependency 'datadog', '>= 2.0.0' + if RUBY_VERSION >= '3.4' + spec.add_dependency 'datadog', '>= 2.0.0' + else + spec.add_dependency 'ddtrace', '>= 1.13.0' + end # Specify which files should be added to the gem when it is released. # The `git ls-files -z` loads the files in the RubyGem that have been added into git. From cc24b6b6388fd11eeaf4eb5fb9c7d0438c2998cb Mon Sep 17 00:00:00 2001 From: mukteshd Date: Wed, 8 Oct 2025 14:37:46 +0530 Subject: [PATCH 4/6] loaded dependecy on condition --- lib/datadog_notifier.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/datadog_notifier.rb b/lib/datadog_notifier.rb index 291cf8c..31bd59a 100644 --- a/lib/datadog_notifier.rb +++ b/lib/datadog_notifier.rb @@ -1,6 +1,10 @@ # frozen_string_literal: true -require 'ddtrace' +if RUBY_VERSION < '3.4' + require 'ddtrace' +else + require 'datadog' +end require 'datadog_notifier_exception' require 'datadog_notifier/version' From 876ed02429b74b380882b729dc296980a25051a1 Mon Sep 17 00:00:00 2001 From: mukteshd Date: Thu, 9 Oct 2025 13:07:15 +0530 Subject: [PATCH 5/6] used correct way to handle version comparison --- datadog_notifier.gemspec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/datadog_notifier.gemspec b/datadog_notifier.gemspec index 8a7af70..43e2718 100644 --- a/datadog_notifier.gemspec +++ b/datadog_notifier.gemspec @@ -15,7 +15,10 @@ Gem::Specification.new do |spec| spec.homepage = 'https://github.com/patterninc/datadog_notifier' spec.license = 'MIT' - if RUBY_VERSION >= '3.4' + ruby_version = Gem::Version.new(RUBY_VERSION) + breaking_version = Gem::Version.new('3.4') + + if ruby_version >= breaking_version spec.add_dependency 'datadog', '>= 2.0.0' else spec.add_dependency 'ddtrace', '>= 1.13.0' From 759c5b55e66857883cde6ed40bdf03aee7cbf507 Mon Sep 17 00:00:00 2001 From: mukteshd Date: Mon, 3 Nov 2025 15:43:09 +0530 Subject: [PATCH 6/6] Fix gemspec to not require datadog during bundle install The gemspec was requiring datadog_notifier.rb which loads the datadog gem, but this gem isn't available during bundle install phase. This caused LoadError in CI when installing dependencies. Solution: Only require datadog_notifier/version.rb in gemspec since it has no external dependencies. --- datadog_notifier.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datadog_notifier.gemspec b/datadog_notifier.gemspec index 43e2718..faf225f 100644 --- a/datadog_notifier.gemspec +++ b/datadog_notifier.gemspec @@ -2,7 +2,7 @@ lib = File.expand_path('lib', __dir__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) -require 'datadog_notifier' +# Don't require datadog_notifier here - it has dependencies that aren't installed yet during bundle install require 'datadog_notifier/version' Gem::Specification.new do |spec|