sidekiq_publisher 2.2.0 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 496067d05925ac3fbea1dfd0323640fbb809c32b836faca13d1e9184255ef45f
4
- data.tar.gz: 9c3334f11ee9f436866a1f9cf438c0676575fee4e13e17cb41ef52ee62f6e5f1
3
+ metadata.gz: 5a85f0c8a5d2626638e56314c3f17a5f59168413f0e8075b7b21a69e8f3a3708
4
+ data.tar.gz: fb45a06f543ececf11a48d4e25bc6a57aac3d199ce36b0589702c2528a82b949
5
5
  SHA512:
6
- metadata.gz: c92b6150ea19e96f388891f269903cf477d95983922bba38eb5192d3b6ef8e2dab319abdaf86722f01a5d5f8e4464ab96ae74647d25f74fc5934060e14eb7f0b
7
- data.tar.gz: 69027c8e8202ba1b82c4ff221a88de668262e2086637848982c2a2bb8aa1c97d6a0eba52389642fcaf3b60da3684b4f38a607eb11029c205a85da96cc6f3ff92
6
+ metadata.gz: 29120ed0408fff736b9b140fbcb4540cc51fdb5f5a79685bd9d801f1c611ac94bacad584d1ca63708875b99143119a5296cee8f28e5e234a1d54d8e0899572b8
7
+ data.tar.gz: 5e575e742f298be27974185ccbf271a8817e9505bec890ba923d011b9ebfbb3fe1ecdc5b175db851348c4060da9239ab3a545fe2b0fb5b2e47a3935746749d86
data/Appraisals CHANGED
@@ -72,6 +72,12 @@ appraise "rails-6.0-sidekiq-6.3" do
72
72
  gem "sidekiq", "~> 6.3.0"
73
73
  end
74
74
 
75
+ appraise "rails-6.0-sidekiq-6.4" do
76
+ gem "activejob", "~> 6.0.0"
77
+ gem "activesupport", "~> 6.0.0"
78
+ gem "sidekiq", "~> 6.4.2" # above 6.4.2 to ensure we test against breaking changes
79
+ end
80
+
75
81
  appraise "rails-6.1-sidekiq-5.2" do
76
82
  gem "activejob", "~> 6.1.0"
77
83
  gem "activesupport", "~> 6.1.0"
@@ -101,3 +107,23 @@ appraise "rails-6.1-sidekiq-6.3" do
101
107
  gem "activesupport", "~> 6.1.0"
102
108
  gem "sidekiq", "~> 6.3.0"
103
109
  end
110
+
111
+ appraise "rails-6.1-sidekiq-6.4" do
112
+ gem "activejob", "~> 6.1.0"
113
+ gem "activesupport", "~> 6.1.0"
114
+ gem "sidekiq", "~> 6.4.2" # above 6.4.2 to ensure we test against breaking changes
115
+ end
116
+
117
+ appraise "rails-6.1-sidekiq-6.4-ddtrace-0-x" do
118
+ gem "activejob", "~> 6.1.0"
119
+ gem "activesupport", "~> 6.1.0"
120
+ gem "sidekiq", "~> 6.4.2"
121
+ gem "ddtrace", "~> 0.54"
122
+ end
123
+
124
+ appraise "rails-6.1-sidekiq-6.4-ddtrace-0-x" do
125
+ gem "activejob", "~> 6.1.0"
126
+ gem "activesupport", "~> 6.1.0"
127
+ gem "sidekiq", "~> 6.4.2"
128
+ gem "ddtrace", "~> 1.0"
129
+ end
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # sidekiq_publisher
2
2
 
3
+ ## (Unreleased)
4
+
5
+ ## 2.3.0
6
+ - Add support for ddtrace 1.x.
7
+ - Add support for sidekiq 6.4.2+.
8
+
3
9
  ## 2.2.0
4
10
  - Add support for redis 5.0.0 by replacing pipelined commands.
5
11
  - Also resolves deprecation warnings introduced in [redis 4.6.0]
@@ -0,0 +1,9 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "activejob", "~> 6.0.0"
6
+ gem "activesupport", "~> 6.0.0"
7
+ gem "sidekiq", "~> 6.4.2"
8
+
9
+ gemspec path: "../"
@@ -0,0 +1,9 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "activejob", "~> 6.1.0"
6
+ gem "activesupport", "~> 6.1.0"
7
+ gem "sidekiq", "~> 6.4.2"
8
+
9
+ gemspec path: "../"
@@ -7,7 +7,10 @@ module SidekiqPublisher
7
7
  def bulk_push(items)
8
8
  payloads = items.map do |item|
9
9
  normed = normalize_item(item)
10
- process_single(item["class"], normed) || nil
10
+ middleware.invoke(item["class"], normed, normed["queue"], @redis_pool) do
11
+ verify_json(normed) if respond_to?(:verify_json) # needed here as of v6.4.2, formerly done by normalize_item
12
+ normed
13
+ end || nil
11
14
  end.compact
12
15
 
13
16
  pushed = 0
@@ -13,6 +13,10 @@ module SidekiqPublisher
13
13
  def service
14
14
  @service || "sidekiq-publisher"
15
15
  end
16
+
17
+ def tracer
18
+ defined?(Datadog::Tracing) ? Datadog::Tracing : Datadog.tracer
19
+ end
16
20
  end
17
21
 
18
22
  class Subscriber
@@ -28,7 +32,7 @@ module SidekiqPublisher
28
32
 
29
33
  def start_span(operation, payload, resource = nil)
30
34
  resource ||= operation
31
- payload[:datadog_span] = Datadog.tracer.trace(operation, service: service, resource: resource)
35
+ payload[:datadog_span] = tracer.trace(operation, service: service, resource: resource)
32
36
  end
33
37
 
34
38
  def start_primary_span(resource, payload)
@@ -43,6 +47,10 @@ module SidekiqPublisher
43
47
  def service
44
48
  SidekiqPublisher::DatadogAPM.service
45
49
  end
50
+
51
+ def tracer
52
+ SidekiqPublisher::DatadogAPM.tracer
53
+ end
46
54
  end
47
55
 
48
56
  class ListenerSubscriber < Subscriber
@@ -97,7 +105,7 @@ module SidekiqPublisher
97
105
  # and responds to the error(.publisher.sidekiq_publisher) event.
98
106
  class PublisherErrorSubscriber < ActiveSupport::Subscriber
99
107
  def error(event)
100
- Datadog.tracer.active_span&.set_error(event.payload[:exception_object])
108
+ SidekiqPublisher::DatadogAPM.tracer.active_span&.set_error(event.payload[:exception_object])
101
109
  end
102
110
 
103
111
  attach_to "publisher.sidekiq_publisher"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SidekiqPublisher
4
- VERSION = "2.2.0"
4
+ VERSION = "2.3.0"
5
5
  end
@@ -47,7 +47,7 @@ Gem::Specification.new do |spec|
47
47
  spec.add_development_dependency "appraisal"
48
48
  spec.add_development_dependency "bundler", "~> 1.12"
49
49
  spec.add_development_dependency "database_cleaner"
50
- spec.add_development_dependency "ddtrace", ">= 0.39.0", "< 1.0"
50
+ spec.add_development_dependency "ddtrace", ">= 0.39.0"
51
51
  spec.add_development_dependency "ezcater_matchers"
52
52
  spec.add_development_dependency "ezcater_rubocop", "1.0.2"
53
53
  spec.add_development_dependency "factory_bot"
@@ -61,5 +61,5 @@ Gem::Specification.new do |spec|
61
61
 
62
62
  spec.add_runtime_dependency "activerecord-postgres_pub_sub", ">= 0.4.0"
63
63
  spec.add_runtime_dependency "activesupport", ">= 5.1", "< 6.2"
64
- spec.add_runtime_dependency "sidekiq", ">= 5.0.4", "< 6.4.2"
64
+ spec.add_runtime_dependency "sidekiq", ">= 5.0.4", "< 7"
65
65
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq_publisher
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ezCater, Inc
@@ -73,9 +73,6 @@ dependencies:
73
73
  - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: 0.39.0
76
- - - "<"
77
- - !ruby/object:Gem::Version
78
- version: '1.0'
79
76
  type: :development
80
77
  prerelease: false
81
78
  version_requirements: !ruby/object:Gem::Requirement
@@ -83,9 +80,6 @@ dependencies:
83
80
  - - ">="
84
81
  - !ruby/object:Gem::Version
85
82
  version: 0.39.0
86
- - - "<"
87
- - !ruby/object:Gem::Version
88
- version: '1.0'
89
83
  - !ruby/object:Gem::Dependency
90
84
  name: ezcater_matchers
91
85
  requirement: !ruby/object:Gem::Requirement
@@ -269,7 +263,7 @@ dependencies:
269
263
  version: 5.0.4
270
264
  - - "<"
271
265
  - !ruby/object:Gem::Version
272
- version: 6.4.2
266
+ version: '7'
273
267
  type: :runtime
274
268
  prerelease: false
275
269
  version_requirements: !ruby/object:Gem::Requirement
@@ -279,7 +273,7 @@ dependencies:
279
273
  version: 5.0.4
280
274
  - - "<"
281
275
  - !ruby/object:Gem::Version
282
- version: 6.4.2
276
+ version: '7'
283
277
  description: Publisher for enqueuing jobs to Sidekiq
284
278
  email:
285
279
  - engineering@ezcater.com
@@ -308,10 +302,12 @@ files:
308
302
  - gemfiles/rails_6.0_sidekiq_6.0.gemfile
309
303
  - gemfiles/rails_6.0_sidekiq_6.1.gemfile
310
304
  - gemfiles/rails_6.0_sidekiq_6.2.gemfile
305
+ - gemfiles/rails_6.0_sidekiq_6.4.gemfile
311
306
  - gemfiles/rails_6.1_sidekiq_5.2.gemfile
312
307
  - gemfiles/rails_6.1_sidekiq_6.0.gemfile
313
308
  - gemfiles/rails_6.1_sidekiq_6.1.gemfile
314
309
  - gemfiles/rails_6.1_sidekiq_6.2.gemfile
310
+ - gemfiles/rails_6.1_sidekiq_6.4.gemfile
315
311
  - lib/active_job/queue_adapters/sidekiq_publisher_adapter.rb
316
312
  - lib/generators/sidekiq_publisher/install_generator.rb
317
313
  - lib/generators/sidekiq_publisher/templates/create_sidekiq_publisher_jobs.rb