simplekiq 0.1.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 20c1cf9ee3200ead5a9c6c0bba128b1688c1a7c7ecab72caaf024341c2d8ba35
4
- data.tar.gz: 1b749cdbdead50f3458912b641b20cdf186a2e53a4581d8bd15a91df7e2bfa4b
3
+ metadata.gz: f267eca4633ec71afa7595061707ffdea9a94c9f7b0db7dde1296a6aa314f66f
4
+ data.tar.gz: 52f52165d23bc71277f86c8c6ce049b42566b188ed484efa14cf974901e94dbe
5
5
  SHA512:
6
- metadata.gz: 5b77d61ceca98ea9d78e491b527e0a181b3e51803581083b39b0fece0303c9d0736e5b66eb3e68fed45222da5f66e6cb75ba82ecaa8034f0b8dd52bf252958bf
7
- data.tar.gz: 91afa04b5e0879132c777dc816887f81ed4de6cdf04c916066fc1d634202eca0a8dbef32173c1a8329ffd0902135669be57ed6e33e1d44d228e5352193a89fcf
6
+ metadata.gz: c4722a45b623489cd739ff5cd2b41711fb0c5004bfcc3f7775eddb9b31f7c0a18a582b6d890531ade1bd6a06acc59497867b5db2725aaa15009b37ae21c0f4bf
7
+ data.tar.gz: 0ee6f33a11201f94ce846968be2ec471c9292bc0e6d63bf6e7b3bc68eff688198714470405d4b0e5b32192a6e892b409964d7368b6050467ab6f350eae510875
data/.circleci/config.yml CHANGED
@@ -1,22 +1,15 @@
1
1
  version: 2.1
2
2
 
3
- orbs:
4
- gem: doximity/gem-publisher@0
5
-
6
3
  executors:
7
4
  ruby:
8
5
  resource_class: small
9
6
  docker:
10
- - image: cimg/ruby:2.6
11
- environment:
12
- BUNDLE_VERSION: "~> 2.1.4"
7
+ - image: cimg/ruby:3.3
13
8
  ruby-with-redis:
14
9
  resource_class: small
15
10
  docker:
16
- - image: cimg/ruby:2.6
17
- environment:
18
- BUNDLE_VERSION: "~> 2.1.4"
19
- - image: redis:4-alpine
11
+ - image: cimg/ruby:3.3
12
+ - image: redis:6.2
20
13
  command: redis-server
21
14
 
22
15
  # yaml anchor filters
@@ -48,18 +41,11 @@ jobs:
48
41
  name: Install Bundler specific version
49
42
  command: |
50
43
  gem install bundler --version "${BUNDLE_VERSION}" --force
51
- - restore_cache:
52
- keys:
53
- - v4-bundle-{{ checksum "Gemfile.lock" }}-
54
44
  - run:
55
45
  name: Install Ruby Dependencies
56
46
  command: |
57
47
  bundle config set --local path 'vendor/bundle'
58
48
  bundle install --jobs=4 --retry=3
59
- - save_cache:
60
- key: v4-bundle-{{ checksum "Gemfile.lock" }}-
61
- paths:
62
- - vendor/bundle
63
49
  - run:
64
50
  name: Run Tests
65
51
  command: bundle exec rake ci:specs
@@ -75,41 +61,10 @@ jobs:
75
61
  - vendor/bundle
76
62
 
77
63
  workflows:
78
-
79
64
  main:
80
65
  jobs:
81
66
  - build:
82
67
  <<: *always_run
83
- context: sidekiq-enterprise
84
- - gem/build:
85
- <<: *always_run
86
- context: sidekiq-enterprise
87
- executor: ruby
88
- name: gem-build
89
- vendor-cache: false
90
- cache-salt: simplekiq-v2
91
- requires:
92
- - build
93
- - pre-release-approval:
94
- <<: *pr_only
95
- type: approval
96
- requires:
97
- - gem-build
98
- - gem/publish:
99
- <<: *pr_only
100
- executor: ruby
101
- name: gem-publish-pre
102
- to_rubygems: true
103
- pre_release: true
104
- requires:
105
- - pre-release-approval
106
- context: artifact_publishing
107
- - gem/publish:
108
- <<: *version_tags_only
109
- name: gem-publish-final
110
- executor: ruby
111
- to_rubygems: true
112
- pre_release: false
113
- requires:
114
- - gem-build
115
- context: artifact_publishing
68
+ context:
69
+ - sidekiq-enterprise
70
+ - nexus_readonly
data/CHANGELOG.md CHANGED
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [1.0.0]
8
+ * Only support Sidekiq 7.1 and Sidekiq 8 (dropped support for older versions)
9
+ [#42](https://github.com/doximity/simplekiq/pull/42)
10
+
7
11
  ## [0.1.0] (pre-release for 1.0)
8
12
  * Fix typo in CONTRIBUTORS
9
13
  [#5](https://github.com/doximity/simplekiq/pull/5)
data/CONTRIBUTORS.md CHANGED
@@ -22,6 +22,9 @@
22
22
  ### Tiffany Troha (Doximity)
23
23
  * Added support for specifying `sidekiq_options` for the child job in `Simplekiq::BatchingJob`
24
24
 
25
+ ### Lucas Lazzaris (Doximity)
26
+ * Added support for sidekiq 7.x
27
+
25
28
  ### [Daniel Pepper](https://github.com/dpep)
26
29
  * On request, graciously took down his unused `simplekiq` placeholder from rubygems so we could continue using the name :raised_hands:
27
30
 
data/Gemfile CHANGED
@@ -1,10 +1,10 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- source "https://enterprise.contribsys.com/" do
4
- gem "sidekiq-pro", "5.2.1"
3
+ source "https://artifacts.dox.support/repository/gems" do
4
+ gem "sidekiq-pro", "7.3.6"
5
5
  end
6
6
 
7
- gem "sidekiq", "6.1.0"
7
+ gem "sidekiq", "7.3.7"
8
8
 
9
9
  # Specify your gem's dependencies in simplekiq.gemspec
10
10
  gemspec
data/Gemfile.lock CHANGED
@@ -1,31 +1,44 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- simplekiq (0.1.0)
5
- sidekiq (>= 5.2.9)
6
- sidekiq-pro (~> 5.0)
4
+ simplekiq (0.2.0)
5
+ sidekiq (>= 7.1, < 9.0)
6
+ sidekiq-pro (>= 7.1, < 9.0)
7
+
8
+ GEM
9
+ remote: https://artifacts.dox.support/repository/gems/
10
+ specs:
11
+ json (2.16.0)
12
+ language_server-protocol (3.17.0.5)
13
+ lint_roller (1.1.0)
14
+ prism (1.6.0)
15
+ racc (1.8.1)
16
+ sidekiq-pro (7.3.6)
17
+ sidekiq (>= 7.3.7, < 8)
18
+ unicode-emoji (4.1.0)
7
19
 
8
20
  GEM
9
21
  remote: https://rubygems.org/
10
- remote: https://enterprise.contribsys.com/
11
22
  specs:
12
- ast (2.4.2)
23
+ ast (2.4.3)
13
24
  coderay (1.1.3)
14
- connection_pool (2.2.5)
25
+ connection_pool (2.5.4)
15
26
  diff-lcs (1.5.0)
27
+ logger (1.7.0)
16
28
  method_source (1.0.0)
17
- parallel (1.22.1)
18
- parser (3.1.2.0)
29
+ parallel (1.27.0)
30
+ parser (3.3.10.0)
19
31
  ast (~> 2.4.1)
32
+ racc
20
33
  pry (0.14.1)
21
34
  coderay (~> 1.1)
22
35
  method_source (~> 1.0)
23
- rack (2.2.4)
36
+ rack (3.2.4)
24
37
  rainbow (3.1.1)
25
38
  rake (12.3.3)
26
- redis (4.7.1)
27
- regexp_parser (2.3.1)
28
- rexml (3.2.5)
39
+ redis-client (0.26.1)
40
+ connection_pool
41
+ regexp_parser (2.11.3)
29
42
  rspec (3.11.0)
30
43
  rspec-core (~> 3.11.0)
31
44
  rspec-expectations (~> 3.11.0)
@@ -41,32 +54,44 @@ GEM
41
54
  rspec-support (3.11.0)
42
55
  rspec_junit_formatter (0.5.1)
43
56
  rspec-core (>= 2, < 4, != 2.12.0)
44
- rubocop (1.28.2)
57
+ rubocop (1.80.2)
58
+ json (~> 2.3)
59
+ language_server-protocol (~> 3.17.0.2)
60
+ lint_roller (~> 1.1.0)
45
61
  parallel (~> 1.10)
46
- parser (>= 3.1.0.0)
62
+ parser (>= 3.3.0.2)
47
63
  rainbow (>= 2.2.2, < 4.0)
48
- regexp_parser (>= 1.8, < 3.0)
49
- rexml
50
- rubocop-ast (>= 1.17.0, < 2.0)
64
+ regexp_parser (>= 2.9.3, < 3.0)
65
+ rubocop-ast (>= 1.46.0, < 2.0)
51
66
  ruby-progressbar (~> 1.7)
52
- unicode-display_width (>= 1.4.0, < 3.0)
53
- rubocop-ast (1.17.0)
54
- parser (>= 3.1.1.0)
55
- rubocop-performance (1.13.3)
56
- rubocop (>= 1.7.0, < 2.0)
57
- rubocop-ast (>= 0.4.0)
58
- ruby-progressbar (1.11.0)
59
- sidekiq (6.1.0)
60
- connection_pool (>= 2.2.2)
61
- rack (~> 2.0)
62
- redis (>= 4.2.0)
63
- sidekiq-pro (5.2.1)
64
- connection_pool (>= 2.2.3)
65
- sidekiq (>= 6.1.0)
66
- standard (1.11.0)
67
- rubocop (= 1.28.2)
68
- rubocop-performance (= 1.13.3)
69
- unicode-display_width (2.1.0)
67
+ unicode-display_width (>= 2.4.0, < 4.0)
68
+ rubocop-ast (1.47.1)
69
+ parser (>= 3.3.7.2)
70
+ prism (~> 1.4)
71
+ rubocop-performance (1.25.0)
72
+ lint_roller (~> 1.1)
73
+ rubocop (>= 1.75.0, < 2.0)
74
+ rubocop-ast (>= 1.38.0, < 2.0)
75
+ ruby-progressbar (1.13.0)
76
+ sidekiq (7.3.7)
77
+ connection_pool (>= 2.3.0)
78
+ logger
79
+ rack (>= 2.2.4)
80
+ redis-client (>= 0.22.2)
81
+ standard (1.51.1)
82
+ language_server-protocol (~> 3.17.0.2)
83
+ lint_roller (~> 1.0)
84
+ rubocop (~> 1.80.2)
85
+ standard-custom (~> 1.0.0)
86
+ standard-performance (~> 1.8)
87
+ standard-custom (1.0.2)
88
+ lint_roller (~> 1.0)
89
+ rubocop (~> 1.50)
90
+ standard-performance (1.8.0)
91
+ lint_roller (~> 1.1)
92
+ rubocop-performance (~> 1.25.0)
93
+ unicode-display_width (3.2.0)
94
+ unicode-emoji (~> 4.1)
70
95
 
71
96
  PLATFORMS
72
97
  ruby
@@ -76,10 +101,10 @@ DEPENDENCIES
76
101
  rake (~> 12.0)
77
102
  rspec (~> 3.2)
78
103
  rspec_junit_formatter
79
- sidekiq (= 6.1.0)
80
- sidekiq-pro (= 5.2.1)!
104
+ sidekiq (= 7.3.7)
105
+ sidekiq-pro (= 7.3.6)!
81
106
  simplekiq!
82
107
  standard
83
108
 
84
109
  BUNDLED WITH
85
- 2.1.4
110
+ 2.7.2
@@ -7,7 +7,7 @@
7
7
 
8
8
  module Simplekiq
9
9
  class BatchTrackerJob
10
- include Sidekiq::Worker
10
+ include Sidekiq::Job
11
11
 
12
12
  def perform(klass_name, bid, args)
13
13
  # In the future, this will likely surface the toplevel batch to a callback method on the
@@ -61,7 +61,7 @@
61
61
 
62
62
  module Simplekiq
63
63
  module BatchingJob
64
- include Sidekiq::Worker
64
+ include Sidekiq::Job
65
65
 
66
66
  BATCH_CLASS_NAME = "SimplekiqBatch"
67
67
 
@@ -93,10 +93,10 @@ module Simplekiq
93
93
  # to toggle the behavior on and off.
94
94
  if batch
95
95
  batch.jobs do
96
- handle_batches(args)
96
+ flush_batches(args)
97
97
  end
98
98
  else
99
- handle_batches(args)
99
+ flush_batches(args)
100
100
  end
101
101
  end
102
102
 
@@ -104,14 +104,6 @@ module Simplekiq
104
104
 
105
105
  attr_accessor :batches
106
106
 
107
- def handle_batches(args)
108
- if !batches.empty?
109
- flush_batches(args)
110
- else
111
- Simplekiq.run_empty_callbacks(self, args: args)
112
- end
113
- end
114
-
115
107
  def flush_batches(args)
116
108
  batch_job_class = self.class.const_get(BATCH_CLASS_NAME)
117
109
  sidekiq_batch.description ||= "Simplekiq Batch Jobs for #{self.class.name}, args: #{args}"
@@ -141,7 +133,7 @@ module Simplekiq
141
133
  end
142
134
 
143
135
  class BaseBatch
144
- include Sidekiq::Worker
136
+ include Sidekiq::Job
145
137
 
146
138
  def perform(*args)
147
139
  module_parent_of_class.new.perform_batch(*args)
@@ -151,7 +143,7 @@ module Simplekiq
151
143
 
152
144
  def module_parent_of_class
153
145
  # Borrowed from https://apidock.com/rails/Module/module_parent_name
154
- parent_name = self.class.name =~ /::[^:]+\Z/ ? $`.freeze : nil
146
+ parent_name = (self.class.name =~ /::[^:]+\Z/) ? $`.freeze : nil
155
147
  parent_name ? Object.const_get(parent_name) : Object
156
148
  end
157
149
  end
@@ -3,11 +3,6 @@
3
3
  module Simplekiq
4
4
  class OrchestrationExecutor
5
5
  def self.execute(args:, job:, workflow:)
6
- if workflow.empty?
7
- Simplekiq.run_empty_callbacks(job, args: args)
8
- return
9
- end
10
-
11
6
  orchestration_batch = Sidekiq::Batch.new
12
7
  orchestration_batch.description = "#{job.class.name} Simplekiq orchestration"
13
8
  Simplekiq.auto_define_callbacks(orchestration_batch, args: args, job: job)
@@ -15,7 +10,7 @@ module Simplekiq
15
10
  orchestration_batch.jobs do
16
11
  Simplekiq::BatchTrackerJob.perform_async(job.class.name, orchestration_batch.bid, args)
17
12
 
18
- new.run_step(workflow, 0)
13
+ new.run_step(workflow, 0) unless workflow.empty?
19
14
  end
20
15
  end
21
16
 
@@ -4,9 +4,10 @@ require "forwardable"
4
4
 
5
5
  module Simplekiq
6
6
  module OrchestrationJob
7
- include Sidekiq::Worker
7
+ include Sidekiq::Job
8
8
 
9
9
  extend Forwardable
10
+
10
11
  def_delegators :orchestration, :run, :in_parallel
11
12
 
12
13
  def perform(*args)
@@ -1,3 +1,3 @@
1
1
  module Simplekiq
2
- VERSION = "0.1.0"
2
+ VERSION = "1.0.0"
3
3
  end
data/lib/simplekiq.rb CHANGED
@@ -11,13 +11,6 @@ require "simplekiq/batch_tracker_job"
11
11
 
12
12
  module Simplekiq
13
13
  class << self
14
- # Empty batches with no jobs will never invoke callbacks, so handle
15
- # that case by immediately manually invoking :complete & :success.
16
- def run_empty_callbacks(job, args:)
17
- job.on_complete(nil, {"args" => args}) if job.respond_to?(:on_complete)
18
- job.on_success(nil, {"args" => args}) if job.respond_to?(:on_success)
19
- end
20
-
21
14
  def auto_define_callbacks(batch, args:, job:)
22
15
  batch.on("death", job.class, "args" => args) if job.respond_to?(:on_death)
23
16
  batch.on("complete", job.class, "args" => args) if job.respond_to?(:on_complete)
data/simplekiq.gemspec CHANGED
@@ -29,6 +29,6 @@ Gem::Specification.new do |spec|
29
29
  spec.add_development_dependency "pry"
30
30
  spec.add_development_dependency "standard"
31
31
 
32
- spec.add_dependency "sidekiq", ">= 5.2.9"
33
- spec.add_dependency "sidekiq-pro", "~> 5.0"
32
+ spec.add_dependency "sidekiq", ">= 7.1", "< 9.0"
33
+ spec.add_dependency "sidekiq-pro", ">= 7.1", "< 9.0"
34
34
  end
data/tasks/ci.rake CHANGED
@@ -6,7 +6,7 @@ namespace :ci do
6
6
  reports = "tmp/test-results/rspec"
7
7
  sh "mkdir -p #{reports}"
8
8
  sh "bundle exec rspec ./spec " \
9
- "--format progress "\
9
+ "--format progress " \
10
10
  "--format RspecJunitFormatter " \
11
11
  "-o #{reports}/results.xml"
12
12
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simplekiq
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jack Noble
8
8
  - John Wilkinson
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-08-23 00:00:00.000000000 Z
12
+ date: 2025-11-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -87,28 +87,40 @@ dependencies:
87
87
  requirements:
88
88
  - - ">="
89
89
  - !ruby/object:Gem::Version
90
- version: 5.2.9
90
+ version: '7.1'
91
+ - - "<"
92
+ - !ruby/object:Gem::Version
93
+ version: '9.0'
91
94
  type: :runtime
92
95
  prerelease: false
93
96
  version_requirements: !ruby/object:Gem::Requirement
94
97
  requirements:
95
98
  - - ">="
96
99
  - !ruby/object:Gem::Version
97
- version: 5.2.9
100
+ version: '7.1'
101
+ - - "<"
102
+ - !ruby/object:Gem::Version
103
+ version: '9.0'
98
104
  - !ruby/object:Gem::Dependency
99
105
  name: sidekiq-pro
100
106
  requirement: !ruby/object:Gem::Requirement
101
107
  requirements:
102
- - - "~>"
108
+ - - ">="
103
109
  - !ruby/object:Gem::Version
104
- version: '5.0'
110
+ version: '7.1'
111
+ - - "<"
112
+ - !ruby/object:Gem::Version
113
+ version: '9.0'
105
114
  type: :runtime
106
115
  prerelease: false
107
116
  version_requirements: !ruby/object:Gem::Requirement
108
117
  requirements:
109
- - - "~>"
118
+ - - ">="
119
+ - !ruby/object:Gem::Version
120
+ version: '7.1'
121
+ - - "<"
110
122
  - !ruby/object:Gem::Version
111
- version: '5.0'
123
+ version: '9.0'
112
124
  description: Provides tools for representing long chains of parallel and serial jobs
113
125
  in a flat, simple way.
114
126
  email:
@@ -145,7 +157,7 @@ licenses:
145
157
  metadata:
146
158
  homepage_uri: https://github.com/doximity/simplekiq
147
159
  source_code_uri: https://github.com/doximity/simplekiq
148
- post_install_message:
160
+ post_install_message:
149
161
  rdoc_options: []
150
162
  require_paths:
151
163
  - lib
@@ -160,8 +172,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
160
172
  - !ruby/object:Gem::Version
161
173
  version: '0'
162
174
  requirements: []
163
- rubygems_version: 3.3.11
164
- signing_key:
175
+ rubygems_version: 3.3.26
176
+ signing_key:
165
177
  specification_version: 4
166
178
  summary: Sidekiq-based workflow orchestration library
167
179
  test_files: []