sidekiq_publisher 2.1.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: aa63cc2e02febd7a4fe0da8a1deba89df521cf9df46d453626ee80c45cb441c1
4
- data.tar.gz: 8c4ba92a29040892080f1b0248dfec8a6f1193063f054c48d6736e3fc15a9e40
3
+ metadata.gz: 5a85f0c8a5d2626638e56314c3f17a5f59168413f0e8075b7b21a69e8f3a3708
4
+ data.tar.gz: fb45a06f543ececf11a48d4e25bc6a57aac3d199ce36b0589702c2528a82b949
5
5
  SHA512:
6
- metadata.gz: '01874b1f9cad7364bf28af24830f62278c3e6aea796a5af4b66ca1fc5c3a63806f48fe3a44892f40c18759dabe58f825d444f28fb48f7b76777440c988120728'
7
- data.tar.gz: 9c1c712c199f2abc7fa86c61d9739c1739d78200978071cb0b4ee0cb470091c5d84cf310f0a523f5cb31c98b87ed0ef2afd42ca61d3d743c7f605dde45b32663
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,26 @@
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
+
9
+ ## 2.2.0
10
+ - Add support for redis 5.0.0 by replacing pipelined commands.
11
+ - Also resolves deprecation warnings introduced in [redis 4.6.0]
12
+
13
+ [redis 4.6.0]: https://github.com/redis/redis-rb/blob/master/CHANGELOG.md#460
14
+
15
+ - Restricts sidekiq to < 6.4.2 due to an incompatability
16
+ - [issue tracking this](https://github.com/ezcater/sidekiq_publisher/issues/55)
17
+
18
+ - Restricts ddtrace to < 1.0.0 due to an incompatability
19
+
20
+ ## 2.1.1
21
+ - Opt-in to [Rubygems MFA](https://guides.rubygems.org/mfa-requirement-opt-in/)
22
+ for privileged operations
23
+
3
24
  ## 2.1.0
4
25
  - Add support for sidekiq `7.0.0` by using `Sidekiq::Job` instead of
5
26
  `Sidekiq::Worker` in sidekiq `>= 6.3.0` to handle name changes outlined in
data/README.md CHANGED
@@ -1,6 +1,11 @@
1
1
  # sidekiq_publisher
2
2
 
3
- [![CircleCI](https://circleci.com/gh/ezcater/sidekiq_publisher.svg?style=svg)](https://circleci.com/gh/ezcater/sidekiq_publisher)
3
+ [![Gem Version][gem_badge]][gem_link] [![CircleCI][circle_badge]][circle_link]
4
+
5
+ [circle_badge]: https://circleci.com/gh/ezcater/sidekiq_publisher.svg?style=svg
6
+ [circle_link]: https://circleci.com/gh/ezcater/sidekiq_publisher
7
+ [gem_badge]: https://badge.fury.io/rb/sidekiq_publisher.svg
8
+ [gem_link]: https://badge.fury.io/rb/sidekiq_publisher
4
9
 
5
10
  This gem provides support to enqueue jobs for Sidekiq by first staging the job
6
11
  in Postgres and relying on a separate process to communicate with Sidekiq/Redis.
@@ -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,14 +7,17 @@ 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
14
17
  with_connection do |conn|
15
- conn.multi do
18
+ conn.multi do |transaction|
16
19
  payloads.each do |payload|
17
- atomic_push(conn, [payload])
20
+ atomic_push(transaction, [payload])
18
21
  pushed += 1
19
22
  end
20
23
  end
@@ -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.1.0"
4
+ VERSION = "2.3.0"
5
5
  end
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
17
17
  # Set "allowed_push_post" to control where this gem can be published.
18
18
  if spec.respond_to?(:metadata)
19
19
  spec.metadata["allowed_push_host"] = "https://rubygems.org"
20
-
20
+ spec.metadata["rubygems_mfa_required"] = "true"
21
21
  else
22
22
  raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
23
23
  end
@@ -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", "< 7.0"
64
+ spec.add_runtime_dependency "sidekiq", ">= 5.0.4", "< 7"
65
65
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq_publisher
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ezCater, Inc
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-11 00:00:00.000000000 Z
11
+ date: 2022-06-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activejob
@@ -263,7 +263,7 @@ dependencies:
263
263
  version: 5.0.4
264
264
  - - "<"
265
265
  - !ruby/object:Gem::Version
266
- version: '7.0'
266
+ version: '7'
267
267
  type: :runtime
268
268
  prerelease: false
269
269
  version_requirements: !ruby/object:Gem::Requirement
@@ -273,7 +273,7 @@ dependencies:
273
273
  version: 5.0.4
274
274
  - - "<"
275
275
  - !ruby/object:Gem::Version
276
- version: '7.0'
276
+ version: '7'
277
277
  description: Publisher for enqueuing jobs to Sidekiq
278
278
  email:
279
279
  - engineering@ezcater.com
@@ -302,10 +302,12 @@ files:
302
302
  - gemfiles/rails_6.0_sidekiq_6.0.gemfile
303
303
  - gemfiles/rails_6.0_sidekiq_6.1.gemfile
304
304
  - gemfiles/rails_6.0_sidekiq_6.2.gemfile
305
+ - gemfiles/rails_6.0_sidekiq_6.4.gemfile
305
306
  - gemfiles/rails_6.1_sidekiq_5.2.gemfile
306
307
  - gemfiles/rails_6.1_sidekiq_6.0.gemfile
307
308
  - gemfiles/rails_6.1_sidekiq_6.1.gemfile
308
309
  - gemfiles/rails_6.1_sidekiq_6.2.gemfile
310
+ - gemfiles/rails_6.1_sidekiq_6.4.gemfile
309
311
  - lib/active_job/queue_adapters/sidekiq_publisher_adapter.rb
310
312
  - lib/generators/sidekiq_publisher/install_generator.rb
311
313
  - lib/generators/sidekiq_publisher/templates/create_sidekiq_publisher_jobs.rb
@@ -331,6 +333,7 @@ licenses:
331
333
  - MIT
332
334
  metadata:
333
335
  allowed_push_host: https://rubygems.org
336
+ rubygems_mfa_required: 'true'
334
337
  post_install_message:
335
338
  rdoc_options: []
336
339
  require_paths:
@@ -346,7 +349,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
346
349
  - !ruby/object:Gem::Version
347
350
  version: '0'
348
351
  requirements: []
349
- rubygems_version: 3.1.4
352
+ rubygems_version: 3.3.7
350
353
  signing_key:
351
354
  specification_version: 4
352
355
  summary: Publisher for enqueuing jobs to Sidekiq