sidekiq_publisher 1.8.0.rc0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Appraisals +18 -5
- data/CHANGELOG.md +12 -1
- data/Dockerfile +1 -1
- data/{lib → app/models}/sidekiq_publisher/job.rb +9 -3
- data/docker-compose.yml +3 -1
- data/gemfiles/{rails_5.1.gemfile → rails_5.2_sidekiq_6.2.gemfile} +3 -2
- data/gemfiles/rails_6.0_sidekiq_6.2.gemfile +9 -0
- data/gemfiles/rails_6.1_sidekiq_6.2.gemfile +9 -0
- data/lib/active_job/queue_adapters/sidekiq_publisher_adapter.rb +1 -0
- data/lib/sidekiq_publisher/{railtie.rb → engine.rb} +2 -4
- data/lib/sidekiq_publisher/metrics_reporter.rb +1 -0
- data/lib/sidekiq_publisher/publisher.rb +1 -1
- data/lib/sidekiq_publisher/version.rb +1 -1
- data/lib/sidekiq_publisher.rb +2 -2
- data/lib/{sidekiq_publisher/tasks.rake → tasks/sidekiq_publisher.rake} +1 -0
- data/sidekiq_publisher.gemspec +2 -0
- metadata +15 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 35ad0d16467d78de77ede70a744b248a9dbe33d6f4ceec9c37df10c8478693d1
|
4
|
+
data.tar.gz: af3f7362bb2f539a1a8d4b506f8004fc9cdf9b9927685fc09fc49f74b569cf54
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 549f8fd72294075b7f5cca99edcf2b6a2682210f1a494fcf9ce1639c91bd43f8139a269bc1045108de6c52820e5416277fdd04497a795ed5c123a5a2ae77f33c
|
7
|
+
data.tar.gz: 62f6cd338b10e13a82ab4421d55817df95f5d791ac83a5f2e2f4dbdae2327c69a0e09d7b914711d7216651294d30788d411d9ab0eb8208d78b941c6dd8da98ce
|
data/Appraisals
CHANGED
@@ -1,10 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
appraise "rails-5.1" do
|
4
|
-
gem "activejob", "~> 5.1.6"
|
5
|
-
gem "activesupport", "~> 5.1.6"
|
6
|
-
end
|
7
|
-
|
8
3
|
appraise "rails-5.2-sidekiq-5.0" do
|
9
4
|
gem "activejob", "~> 5.2.0"
|
10
5
|
gem "activesupport", "~> 5.2.0"
|
@@ -35,6 +30,12 @@ appraise "rails-5.2-sidekiq-6.1" do
|
|
35
30
|
gem "sidekiq", "~> 6.1.0"
|
36
31
|
end
|
37
32
|
|
33
|
+
appraise "rails-5.2-sidekiq-6.2" do
|
34
|
+
gem "activejob", "~> 5.2.0"
|
35
|
+
gem "activesupport", "~> 5.2.0"
|
36
|
+
gem "sidekiq", "~> 6.2.0"
|
37
|
+
end
|
38
|
+
|
38
39
|
appraise "rails-6.0-sidekiq-5.2" do
|
39
40
|
gem "activejob", "~> 6.0.0"
|
40
41
|
gem "activesupport", "~> 6.0.0"
|
@@ -53,6 +54,12 @@ appraise "rails-6.0-sidekiq-6.1" do
|
|
53
54
|
gem "sidekiq", "~> 6.1.0"
|
54
55
|
end
|
55
56
|
|
57
|
+
appraise "rails-6.0-sidekiq-6.2" do
|
58
|
+
gem "activejob", "~> 6.0.0"
|
59
|
+
gem "activesupport", "~> 6.0.0"
|
60
|
+
gem "sidekiq", "~> 6.2.0"
|
61
|
+
end
|
62
|
+
|
56
63
|
appraise "rails-6.1-sidekiq-5.2" do
|
57
64
|
gem "activejob", "~> 6.1.0"
|
58
65
|
gem "activesupport", "~> 6.1.0"
|
@@ -70,3 +77,9 @@ appraise "rails-6.1-sidekiq-6.1" do
|
|
70
77
|
gem "activesupport", "~> 6.1.0"
|
71
78
|
gem "sidekiq", "~> 6.1.0"
|
72
79
|
end
|
80
|
+
|
81
|
+
appraise "rails-6.1-sidekiq-6.2" do
|
82
|
+
gem "activejob", "~> 6.1.0"
|
83
|
+
gem "activesupport", "~> 6.1.0"
|
84
|
+
gem "sidekiq", "~> 6.2.0"
|
85
|
+
end
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,17 @@
|
|
1
1
|
# sidekiq_publisher
|
2
2
|
|
3
|
-
##
|
3
|
+
## 2.0.1
|
4
|
+
- Changing the `Job#args` validator to be a manual check instead of using the `exclusions` validator. This is to fix an issue introduced with rails 6.1 and the condition of `in: [nil]`. More details [here](https://github.com/rails/rails/issues/41051).
|
5
|
+
|
6
|
+
## v2.0.0
|
7
|
+
- Transition from defining a Railtie to becoming a Rails Engine
|
8
|
+
[(#44)](https://github.com/ezcater/sidekiq_publisher/pull/44). This change was
|
9
|
+
made to better support Ruby 3.0 and Rails 6.1. The change is *not* expected to
|
10
|
+
be breaking but it does represent a major change in the gem's implementation
|
11
|
+
and that is the reason for the major version bump.
|
12
|
+
- Require Ruby 2.6 or later.
|
13
|
+
|
14
|
+
## v1.8.0
|
4
15
|
- Extend support to Rails 6.1.
|
5
16
|
|
6
17
|
## v1.7.1
|
data/Dockerfile
CHANGED
@@ -1,7 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "active_record"
|
4
|
-
|
5
3
|
module SidekiqPublisher
|
6
4
|
class Job < ActiveRecord::Base
|
7
5
|
self.table_name = "sidekiq_publisher_jobs"
|
@@ -12,7 +10,11 @@ module SidekiqPublisher
|
|
12
10
|
before_save :ensure_string_job_class
|
13
11
|
|
14
12
|
validates :job_class, presence: true
|
15
|
-
|
13
|
+
# This exclusion rule currently has a bug in rails 6.1. For now, we will use a manual implementation
|
14
|
+
# Github Issue: https://github.com/rails/rails/issues/41051
|
15
|
+
# Possible PR: https://github.com/rails/rails/pull/41412
|
16
|
+
# validates :args, exclusion: { in: [nil] }
|
17
|
+
validate :args_not_nil
|
16
18
|
|
17
19
|
scope :unpublished, -> { where(published_at: nil) }
|
18
20
|
scope :published, -> { where.not(published_at: nil) }
|
@@ -56,6 +58,10 @@ module SidekiqPublisher
|
|
56
58
|
|
57
59
|
private
|
58
60
|
|
61
|
+
def args_not_nil
|
62
|
+
errors.add(:args, "is reserved") if args.nil?
|
63
|
+
end
|
64
|
+
|
59
65
|
def ensure_job_id
|
60
66
|
self.job_id ||= self.class.generate_sidekiq_jid
|
61
67
|
end
|
data/docker-compose.yml
CHANGED
@@ -7,6 +7,7 @@ x-environment: &default-environment
|
|
7
7
|
BUNDLE_IGNORE_CONFIG: 1
|
8
8
|
BUNDLE_DISABLE_SHARED_GEMS: "true"
|
9
9
|
PGUSER: postgres
|
10
|
+
PGPASSWORD: postgres
|
10
11
|
PGHOST: sidekiq-publisher-postgres
|
11
12
|
PGPORT: 5432
|
12
13
|
PGDATABASE: sidekiq_publisher_test
|
@@ -28,9 +29,10 @@ services:
|
|
28
29
|
image: redis:5.0.9-alpine
|
29
30
|
sidekiq-publisher-postgres:
|
30
31
|
container_name: sidekiq-publisher-postgres_1
|
31
|
-
image: postgres:
|
32
|
+
image: postgres:12.6
|
32
33
|
environment:
|
33
34
|
POSTGRES_USER: postgres
|
35
|
+
POSTGRES_PASSWORD: postgres
|
34
36
|
POSTGRES_DB: sidekiq_publisher_test
|
35
37
|
sidekiq-publisher-console:
|
36
38
|
<<: *default-service
|
@@ -1,10 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module SidekiqPublisher
|
4
|
-
class
|
5
|
-
|
6
|
-
load "sidekiq_publisher/tasks.rake"
|
7
|
-
end
|
4
|
+
class Engine < Rails::Engine
|
5
|
+
isolate_namespace SidekiqPublisher
|
8
6
|
|
9
7
|
initializer "sidekiq_publisher.configure" do
|
10
8
|
SidekiqPublisher.logger = Rails.logger
|
data/lib/sidekiq_publisher.rb
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "active_support"
|
4
|
+
require "active_support/core_ext/numeric/time"
|
4
5
|
require "sidekiq_publisher/version"
|
5
6
|
require "sidekiq_publisher/instrumenter"
|
6
7
|
require "sidekiq_publisher/metrics_reporter"
|
7
8
|
require "sidekiq_publisher/exception_reporter"
|
8
9
|
require "sidekiq_publisher/report_unpublished_count"
|
9
|
-
require "sidekiq_publisher/job"
|
10
10
|
require "sidekiq_publisher/worker"
|
11
11
|
require "sidekiq_publisher/publisher"
|
12
12
|
require "sidekiq_publisher/runner"
|
13
|
-
require "sidekiq_publisher/
|
13
|
+
require "sidekiq_publisher/engine" if defined?(Rails)
|
14
14
|
|
15
15
|
module SidekiqPublisher
|
16
16
|
DEFAULT_BATCH_SIZE = 100
|
data/sidekiq_publisher.gemspec
CHANGED
@@ -41,6 +41,8 @@ Gem::Specification.new do |spec|
|
|
41
41
|
spec.executables = []
|
42
42
|
spec.require_paths = ["lib"]
|
43
43
|
|
44
|
+
spec.required_ruby_version = ">= 2.6"
|
45
|
+
|
44
46
|
spec.add_development_dependency "activejob"
|
45
47
|
spec.add_development_dependency "appraisal"
|
46
48
|
spec.add_development_dependency "bundler", "~> 1.12"
|
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:
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ezCater, Inc
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-09-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activejob
|
@@ -289,38 +289,40 @@ files:
|
|
289
289
|
- Gemfile
|
290
290
|
- LICENSE.txt
|
291
291
|
- README.md
|
292
|
+
- app/models/sidekiq_publisher/job.rb
|
292
293
|
- docker-compose.yml
|
293
|
-
- gemfiles/rails_5.1.gemfile
|
294
294
|
- gemfiles/rails_5.2.gemfile
|
295
295
|
- gemfiles/rails_5.2_sidekiq_5.0.gemfile
|
296
296
|
- gemfiles/rails_5.2_sidekiq_5.1.gemfile
|
297
297
|
- gemfiles/rails_5.2_sidekiq_5.2.gemfile
|
298
298
|
- gemfiles/rails_5.2_sidekiq_6.0.gemfile
|
299
299
|
- gemfiles/rails_5.2_sidekiq_6.1.gemfile
|
300
|
+
- gemfiles/rails_5.2_sidekiq_6.2.gemfile
|
300
301
|
- gemfiles/rails_6.0_sidekiq_5.2.gemfile
|
301
302
|
- gemfiles/rails_6.0_sidekiq_6.0.gemfile
|
302
303
|
- gemfiles/rails_6.0_sidekiq_6.1.gemfile
|
304
|
+
- gemfiles/rails_6.0_sidekiq_6.2.gemfile
|
303
305
|
- gemfiles/rails_6.1_sidekiq_5.2.gemfile
|
304
306
|
- gemfiles/rails_6.1_sidekiq_6.0.gemfile
|
305
307
|
- gemfiles/rails_6.1_sidekiq_6.1.gemfile
|
308
|
+
- gemfiles/rails_6.1_sidekiq_6.2.gemfile
|
306
309
|
- lib/active_job/queue_adapters/sidekiq_publisher_adapter.rb
|
307
310
|
- lib/generators/sidekiq_publisher/install_generator.rb
|
308
311
|
- lib/generators/sidekiq_publisher/templates/create_sidekiq_publisher_jobs.rb
|
309
312
|
- lib/sidekiq_publisher.rb
|
310
313
|
- lib/sidekiq_publisher/client.rb
|
311
314
|
- lib/sidekiq_publisher/datadog_apm.rb
|
315
|
+
- lib/sidekiq_publisher/engine.rb
|
312
316
|
- lib/sidekiq_publisher/exception_reporter.rb
|
313
317
|
- lib/sidekiq_publisher/instrumenter.rb
|
314
|
-
- lib/sidekiq_publisher/job.rb
|
315
318
|
- lib/sidekiq_publisher/metrics_reporter.rb
|
316
319
|
- lib/sidekiq_publisher/publisher.rb
|
317
|
-
- lib/sidekiq_publisher/railtie.rb
|
318
320
|
- lib/sidekiq_publisher/report_unpublished_count.rb
|
319
321
|
- lib/sidekiq_publisher/runner.rb
|
320
|
-
- lib/sidekiq_publisher/tasks.rake
|
321
322
|
- lib/sidekiq_publisher/testing.rb
|
322
323
|
- lib/sidekiq_publisher/version.rb
|
323
324
|
- lib/sidekiq_publisher/worker.rb
|
325
|
+
- lib/tasks/sidekiq_publisher.rake
|
324
326
|
- log/.gitkeep
|
325
327
|
- sidekiq_publisher.gemspec
|
326
328
|
homepage: https://github.com/ezcater/sidekiq_publisher
|
@@ -328,7 +330,7 @@ licenses:
|
|
328
330
|
- MIT
|
329
331
|
metadata:
|
330
332
|
allowed_push_host: https://rubygems.org
|
331
|
-
post_install_message:
|
333
|
+
post_install_message:
|
332
334
|
rdoc_options: []
|
333
335
|
require_paths:
|
334
336
|
- lib
|
@@ -336,16 +338,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
336
338
|
requirements:
|
337
339
|
- - ">="
|
338
340
|
- !ruby/object:Gem::Version
|
339
|
-
version: '
|
341
|
+
version: '2.6'
|
340
342
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
341
343
|
requirements:
|
342
|
-
- - "
|
344
|
+
- - ">="
|
343
345
|
- !ruby/object:Gem::Version
|
344
|
-
version:
|
346
|
+
version: '0'
|
345
347
|
requirements: []
|
346
|
-
|
347
|
-
|
348
|
-
signing_key:
|
348
|
+
rubygems_version: 3.0.3
|
349
|
+
signing_key:
|
349
350
|
specification_version: 4
|
350
351
|
summary: Publisher for enqueuing jobs to Sidekiq
|
351
352
|
test_files: []
|