acidic_job 0.7.7 → 1.0.0.beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/main.yml +35 -12
  3. data/.gitignore +6 -0
  4. data/.rubocop.yml +21 -0
  5. data/.tool-versions +1 -0
  6. data/Gemfile +0 -25
  7. data/Gemfile.lock +181 -73
  8. data/README.md +274 -20
  9. data/UPGRADE_GUIDE.md +81 -0
  10. data/acidic_job.gemspec +17 -2
  11. data/bin/console +5 -2
  12. data/bin/sandbox +1958 -0
  13. data/combustion/log/test.log +0 -0
  14. data/gemfiles/rails_6.1.gemfile +8 -0
  15. data/gemfiles/rails_7.0.gemfile +8 -0
  16. data/lib/acidic_job/active_kiq.rb +114 -0
  17. data/lib/acidic_job/arguments.rb +22 -0
  18. data/lib/acidic_job/base.rb +11 -0
  19. data/lib/acidic_job/errors.rb +10 -17
  20. data/lib/acidic_job/{response.rb → finished_point.rb} +5 -7
  21. data/lib/acidic_job/idempotency_key.rb +27 -0
  22. data/lib/acidic_job/logger.rb +31 -0
  23. data/lib/acidic_job/mixin.rb +253 -0
  24. data/lib/acidic_job/perform_wrapper.rb +13 -26
  25. data/lib/acidic_job/processor.rb +96 -0
  26. data/lib/acidic_job/recovery_point.rb +4 -5
  27. data/lib/acidic_job/run.rb +299 -0
  28. data/lib/acidic_job/serializer.rb +24 -0
  29. data/lib/acidic_job/serializers/exception_serializer.rb +41 -0
  30. data/lib/acidic_job/serializers/finished_point_serializer.rb +24 -0
  31. data/lib/acidic_job/serializers/job_serializer.rb +35 -0
  32. data/lib/acidic_job/serializers/range_serializer.rb +28 -0
  33. data/lib/acidic_job/serializers/recovery_point_serializer.rb +25 -0
  34. data/lib/acidic_job/serializers/worker_serializer.rb +27 -0
  35. data/lib/acidic_job/version.rb +1 -1
  36. data/lib/acidic_job/workflow.rb +78 -0
  37. data/lib/acidic_job/workflow_builder.rb +35 -0
  38. data/lib/acidic_job/workflow_step.rb +103 -0
  39. data/lib/acidic_job.rb +29 -334
  40. data/lib/generators/acidic_job/drop_tables_generator.rb +26 -0
  41. data/lib/generators/acidic_job/install_generator.rb +27 -0
  42. data/lib/generators/acidic_job/templates/create_acidic_job_runs_migration.rb.erb +19 -0
  43. data/lib/generators/{templates/create_acidic_job_keys_migration.rb.erb → acidic_job/templates/drop_acidic_job_keys_migration.rb.erb} +10 -3
  44. metadata +235 -20
  45. data/.ruby_version +0 -1
  46. data/lib/acidic_job/deliver_transactionally_extension.rb +0 -26
  47. data/lib/acidic_job/key.rb +0 -33
  48. data/lib/acidic_job/no_op.rb +0 -11
  49. data/lib/acidic_job/perform_transactionally_extension.rb +0 -33
  50. data/lib/acidic_job/sidekiq_callbacks.rb +0 -45
  51. data/lib/acidic_job/staged.rb +0 -50
  52. data/lib/generators/acidic_job_generator.rb +0 -44
  53. data/lib/generators/templates/create_staged_acidic_jobs_migration.rb.erb +0 -10
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1ded2615559a3d31060c34d9b7e17717cb6f0afa60081f98df1cf451d8aa61c9
4
- data.tar.gz: ce66fe904f29a0a5d47a834414de8b50f4de945cd41b0087e5d85265238c31b5
3
+ metadata.gz: 85bf301347e6dc78c6c2522dc435e3feec6c06aa79f3b0031b29b7d3300a2f9f
4
+ data.tar.gz: e0ee892b3e137e50cd4b0dcfcbf16c5a4800bc50e85d934a5b766dee477a0043
5
5
  SHA512:
6
- metadata.gz: 8dd451aeb1da7539193db26a4a42adc0b04b1ad48ecf71438cee14a78c8b352e287d43f838716eb4f4d8957210aba583b12c0d8e064dcbf6d4aa746310e4489f
7
- data.tar.gz: aab8e61fc8292a6354e993ea98eaffe30350649c0cfce56ba974c732aa5c43f4c51b3f94a9aeec7cf0613ff36ebf1af6e761df85196426867ae1e1dd33679e0d
6
+ metadata.gz: 10da5b0f01d6b852cc5d083e4671e94707b600a0f95b7122b0f5f249ef71117fbdb77efb988daa7aa02a35ff013f923258ea0463aa2e37a1e21be45ad2be63f5
7
+ data.tar.gz: 210ff73c0292333978d488e8c31869db626df35f0ca64f728c9ec8b3e867938a52b4ab59bb95a6334a469223bdd5f0c188f9a241e92f07b8383e635c16b1cdaf
@@ -1,18 +1,41 @@
1
- name: Ruby
1
+ name: CI
2
2
 
3
- on: [push,pull_request]
3
+ on: [push]
4
4
 
5
5
  jobs:
6
6
  build:
7
7
  runs-on: ubuntu-latest
8
+
9
+ strategy:
10
+ fail-fast: false
11
+ matrix:
12
+ ruby: ["2.7", "3.0", "3.1"]
13
+ rails: [ "6.1", "7.0" ]
14
+ services:
15
+ redis:
16
+ image: redis
17
+ options: >-
18
+ --health-cmd "redis-cli ping"
19
+ --health-interval 10s
20
+ --health-timeout 5s
21
+ --health-retries 5
22
+ ports:
23
+ - 6379:6379
24
+
25
+ env:
26
+ BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails_${{ matrix.rails }}.gemfile
27
+
8
28
  steps:
9
- - uses: actions/checkout@v2
10
- - name: Set up Ruby
11
- uses: ruby/setup-ruby@v1
12
- with:
13
- ruby-version: 2.7.1
14
- - name: Run the default task
15
- run: |
16
- gem install bundler -v 2.2.31
17
- bundle install
18
- bundle exec rake
29
+ - uses: actions/checkout@v2
30
+
31
+ - name: Set up Ruby
32
+ # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
33
+ # change this to (see https://github.com/ruby/setup-ruby#versioning):
34
+ uses: ruby/setup-ruby@v1
35
+ with:
36
+ bundler-cache: true # 'bundle install' and cache gems
37
+ ruby-version: ${{ matrix.ruby }}
38
+
39
+ - name: Run the default task
40
+ run: bundle exec rake
41
+ timeout-minutes: 2
data/.gitignore CHANGED
@@ -9,3 +9,9 @@
9
9
  .DS_Store
10
10
  /test/database.sqlite
11
11
  slides.md
12
+ /test/dummy
13
+ /test/log
14
+ /database.sqlite
15
+ /test/combustion/database.sqlite
16
+ /test/combustion/log/test.log
17
+ /gemfiles/rails_6.1.gemfile.lock
data/.rubocop.yml CHANGED
@@ -15,3 +15,24 @@ Layout/LineLength:
15
15
 
16
16
  Style/Documentation:
17
17
  Enabled: false
18
+
19
+ Metrics/ModuleLength:
20
+ Enabled: false
21
+
22
+ Metrics/AbcSize:
23
+ Enabled: false
24
+
25
+ Metrics/MethodLength:
26
+ Enabled: false
27
+
28
+ Metrics/BlockLength:
29
+ Enabled: false
30
+
31
+ Metrics/CyclomaticComplexity:
32
+ Enabled: false
33
+
34
+ Metrics/PerceivedComplexity:
35
+ Enabled: false
36
+
37
+ Metrics/ClassLength:
38
+ Enabled: false
data/.tool-versions ADDED
@@ -0,0 +1 @@
1
+ ruby 3.1.1
data/Gemfile CHANGED
@@ -2,29 +2,4 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- # Specify your gem's dependencies in acidic_job.gemspec
6
5
  gemspec
7
-
8
- gem "rake", "~> 13.0"
9
-
10
- gem "minitest", "~> 5.0"
11
-
12
- gem "rubocop", "~> 1.7"
13
-
14
- gem "rubocop-minitest"
15
-
16
- gem "rubocop-rake"
17
-
18
- gem "activerecord", "~> 6.1.3.2"
19
-
20
- gem "activejob", "~> 6.1.3.2"
21
-
22
- gem "sqlite3"
23
-
24
- gem "database_cleaner"
25
-
26
- gem "simplecov"
27
-
28
- gem "pry"
29
-
30
- gem "sidekiq"
data/Gemfile.lock CHANGED
@@ -1,110 +1,207 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- acidic_job (0.7.7)
5
- activerecord (>= 4.0.0)
4
+ acidic_job (1.0.0.beta.1)
5
+ activejob
6
+ activerecord
6
7
  activesupport
7
8
 
8
9
  GEM
9
10
  remote: https://rubygems.org/
10
11
  specs:
11
- actionpack (6.1.3.2)
12
- actionview (= 6.1.3.2)
13
- activesupport (= 6.1.3.2)
14
- rack (~> 2.0, >= 2.0.9)
12
+ actioncable (7.0.3.1)
13
+ actionpack (= 7.0.3.1)
14
+ activesupport (= 7.0.3.1)
15
+ nio4r (~> 2.0)
16
+ websocket-driver (>= 0.6.1)
17
+ actionmailbox (7.0.3.1)
18
+ actionpack (= 7.0.3.1)
19
+ activejob (= 7.0.3.1)
20
+ activerecord (= 7.0.3.1)
21
+ activestorage (= 7.0.3.1)
22
+ activesupport (= 7.0.3.1)
23
+ mail (>= 2.7.1)
24
+ net-imap
25
+ net-pop
26
+ net-smtp
27
+ actionmailer (7.0.3.1)
28
+ actionpack (= 7.0.3.1)
29
+ actionview (= 7.0.3.1)
30
+ activejob (= 7.0.3.1)
31
+ activesupport (= 7.0.3.1)
32
+ mail (~> 2.5, >= 2.5.4)
33
+ net-imap
34
+ net-pop
35
+ net-smtp
36
+ rails-dom-testing (~> 2.0)
37
+ actionpack (7.0.3.1)
38
+ actionview (= 7.0.3.1)
39
+ activesupport (= 7.0.3.1)
40
+ rack (~> 2.0, >= 2.2.0)
15
41
  rack-test (>= 0.6.3)
16
42
  rails-dom-testing (~> 2.0)
17
43
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
18
- actionview (6.1.3.2)
19
- activesupport (= 6.1.3.2)
44
+ actiontext (7.0.3.1)
45
+ actionpack (= 7.0.3.1)
46
+ activerecord (= 7.0.3.1)
47
+ activestorage (= 7.0.3.1)
48
+ activesupport (= 7.0.3.1)
49
+ globalid (>= 0.6.0)
50
+ nokogiri (>= 1.8.5)
51
+ actionview (7.0.3.1)
52
+ activesupport (= 7.0.3.1)
20
53
  builder (~> 3.1)
21
54
  erubi (~> 1.4)
22
55
  rails-dom-testing (~> 2.0)
23
56
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
24
- activejob (6.1.3.2)
25
- activesupport (= 6.1.3.2)
57
+ activejob (7.0.3.1)
58
+ activesupport (= 7.0.3.1)
26
59
  globalid (>= 0.3.6)
27
- activemodel (6.1.3.2)
28
- activesupport (= 6.1.3.2)
29
- activerecord (6.1.3.2)
30
- activemodel (= 6.1.3.2)
31
- activesupport (= 6.1.3.2)
32
- activesupport (6.1.3.2)
60
+ activemodel (7.0.3.1)
61
+ activesupport (= 7.0.3.1)
62
+ activerecord (7.0.3.1)
63
+ activemodel (= 7.0.3.1)
64
+ activesupport (= 7.0.3.1)
65
+ activestorage (7.0.3.1)
66
+ actionpack (= 7.0.3.1)
67
+ activejob (= 7.0.3.1)
68
+ activerecord (= 7.0.3.1)
69
+ activesupport (= 7.0.3.1)
70
+ marcel (~> 1.0)
71
+ mini_mime (>= 1.1.0)
72
+ activesupport (7.0.3.1)
33
73
  concurrent-ruby (~> 1.0, >= 1.0.2)
34
74
  i18n (>= 1.6, < 2)
35
75
  minitest (>= 5.1)
36
76
  tzinfo (~> 2.0)
37
- zeitwerk (~> 2.3)
77
+ addressable (2.8.0)
78
+ public_suffix (>= 2.0.2, < 5.0)
38
79
  ast (2.4.2)
39
80
  builder (3.2.4)
40
- coderay (1.1.3)
41
- concurrent-ruby (1.1.9)
81
+ combustion (1.3.7)
82
+ activesupport (>= 3.0.0)
83
+ railties (>= 3.0.0)
84
+ thor (>= 0.14.6)
85
+ concurrent-ruby (1.1.10)
42
86
  connection_pool (2.2.5)
43
87
  crass (1.0.6)
44
- database_cleaner (2.0.1)
45
- database_cleaner-active_record (~> 2.0.0)
46
- database_cleaner-active_record (2.0.1)
47
- activerecord (>= 5.a)
48
- database_cleaner-core (~> 2.0.0)
49
- database_cleaner-core (2.0.1)
88
+ digest (3.1.0)
50
89
  docile (1.4.0)
90
+ domain_name (0.5.20190701)
91
+ unf (>= 0.0.5, < 1.0.0)
51
92
  erubi (1.10.0)
52
- globalid (0.4.2)
53
- activesupport (>= 4.2.0)
54
- i18n (1.8.10)
93
+ ffi (1.15.5)
94
+ ffi-compiler (1.0.1)
95
+ ffi (>= 1.0.0)
96
+ rake
97
+ globalid (1.0.0)
98
+ activesupport (>= 5.0)
99
+ http (5.1.0)
100
+ addressable (~> 2.8)
101
+ http-cookie (~> 1.0)
102
+ http-form_data (~> 2.2)
103
+ llhttp-ffi (~> 0.4.0)
104
+ http-cookie (1.0.5)
105
+ domain_name (~> 0.5)
106
+ http-form_data (2.3.0)
107
+ i18n (1.12.0)
55
108
  concurrent-ruby (~> 1.0)
56
- loofah (2.12.0)
109
+ json (2.6.2)
110
+ llhttp-ffi (0.4.0)
111
+ ffi-compiler (~> 1.0)
112
+ rake (~> 13.0)
113
+ loofah (2.18.0)
57
114
  crass (~> 1.0.2)
58
115
  nokogiri (>= 1.5.9)
116
+ mail (2.7.1)
117
+ mini_mime (>= 0.1.1)
118
+ marcel (1.0.2)
59
119
  method_source (1.0.0)
60
- mini_portile2 (2.6.1)
61
- minitest (5.14.4)
62
- nokogiri (1.12.3)
63
- mini_portile2 (~> 2.6.1)
120
+ mini_mime (1.1.2)
121
+ mini_portile2 (2.8.0)
122
+ minitest (5.16.2)
123
+ net-imap (0.2.3)
124
+ digest
125
+ net-protocol
126
+ strscan
127
+ net-pop (0.1.1)
128
+ digest
129
+ net-protocol
130
+ timeout
131
+ net-protocol (0.1.3)
132
+ timeout
133
+ net-smtp (0.3.1)
134
+ digest
135
+ net-protocol
136
+ timeout
137
+ nio4r (2.5.8)
138
+ nokogiri (1.13.7)
139
+ mini_portile2 (~> 2.8.0)
140
+ racc (~> 1.4)
141
+ nokogiri (1.13.7-x86_64-darwin)
64
142
  racc (~> 1.4)
65
- parallel (1.20.1)
66
- parser (3.0.1.1)
143
+ noticed (1.5.9)
144
+ http (>= 4.0.0)
145
+ rails (>= 5.2.0)
146
+ parallel (1.22.1)
147
+ parser (3.1.2.0)
67
148
  ast (~> 2.4.1)
68
- pry (0.14.1)
69
- coderay (~> 1.1)
70
- method_source (~> 1.0)
71
- racc (1.5.2)
72
- rack (2.2.3)
73
- rack-test (1.1.0)
74
- rack (>= 1.0, < 3)
149
+ psych (4.0.4)
150
+ stringio
151
+ public_suffix (4.0.7)
152
+ racc (1.6.0)
153
+ rack (2.2.4)
154
+ rack-test (2.0.2)
155
+ rack (>= 1.3)
156
+ rails (7.0.3.1)
157
+ actioncable (= 7.0.3.1)
158
+ actionmailbox (= 7.0.3.1)
159
+ actionmailer (= 7.0.3.1)
160
+ actionpack (= 7.0.3.1)
161
+ actiontext (= 7.0.3.1)
162
+ actionview (= 7.0.3.1)
163
+ activejob (= 7.0.3.1)
164
+ activemodel (= 7.0.3.1)
165
+ activerecord (= 7.0.3.1)
166
+ activestorage (= 7.0.3.1)
167
+ activesupport (= 7.0.3.1)
168
+ bundler (>= 1.15.0)
169
+ railties (= 7.0.3.1)
75
170
  rails-dom-testing (2.0.3)
76
171
  activesupport (>= 4.2.0)
77
172
  nokogiri (>= 1.6)
78
- rails-html-sanitizer (1.4.1)
173
+ rails-html-sanitizer (1.4.3)
79
174
  loofah (~> 2.3)
80
- railties (6.1.3.2)
81
- actionpack (= 6.1.3.2)
82
- activesupport (= 6.1.3.2)
175
+ railties (7.0.3.1)
176
+ actionpack (= 7.0.3.1)
177
+ activesupport (= 7.0.3.1)
83
178
  method_source
84
- rake (>= 0.8.7)
179
+ rake (>= 12.2)
85
180
  thor (~> 1.0)
86
- rainbow (3.0.0)
87
- rake (13.0.4)
88
- redis (4.4.0)
89
- regexp_parser (2.1.1)
181
+ zeitwerk (~> 2.5)
182
+ rainbow (3.1.1)
183
+ rake (13.0.6)
184
+ redis (4.7.1)
185
+ regexp_parser (2.5.0)
90
186
  rexml (3.2.5)
91
- rubocop (1.18.3)
187
+ rubocop (1.31.2)
188
+ json (~> 2.3)
92
189
  parallel (~> 1.10)
93
- parser (>= 3.0.0.0)
190
+ parser (>= 3.1.0.0)
94
191
  rainbow (>= 2.2.2, < 4.0)
95
192
  regexp_parser (>= 1.8, < 3.0)
96
- rexml
97
- rubocop-ast (>= 1.7.0, < 2.0)
193
+ rexml (>= 3.2.5, < 4.0)
194
+ rubocop-ast (>= 1.18.0, < 2.0)
98
195
  ruby-progressbar (~> 1.7)
99
196
  unicode-display_width (>= 1.4.0, < 3.0)
100
- rubocop-ast (1.7.0)
101
- parser (>= 3.0.1.1)
102
- rubocop-minitest (0.14.0)
197
+ rubocop-ast (1.19.1)
198
+ parser (>= 3.1.1.0)
199
+ rubocop-minitest (0.20.1)
103
200
  rubocop (>= 0.90, < 2.0)
104
201
  rubocop-rake (0.6.0)
105
202
  rubocop (~> 1.0)
106
203
  ruby-progressbar (1.11.0)
107
- sidekiq (6.2.2)
204
+ sidekiq (6.5.1)
108
205
  connection_pool (>= 2.2.2)
109
206
  rack (~> 2.0)
110
207
  redis (>= 4.2.0)
@@ -113,13 +210,23 @@ GEM
113
210
  simplecov-html (~> 0.11)
114
211
  simplecov_json_formatter (~> 0.1)
115
212
  simplecov-html (0.12.3)
116
- simplecov_json_formatter (0.1.3)
117
- sqlite3 (1.4.2)
118
- thor (1.1.0)
213
+ simplecov_json_formatter (0.1.4)
214
+ sqlite3 (1.4.4)
215
+ stringio (3.0.2)
216
+ strscan (3.0.3)
217
+ thor (1.2.1)
218
+ timeout (0.3.0)
119
219
  tzinfo (2.0.4)
120
220
  concurrent-ruby (~> 1.0)
121
- unicode-display_width (2.0.0)
122
- zeitwerk (2.4.2)
221
+ unf (0.1.4)
222
+ unf_ext
223
+ unf_ext (0.0.8.2)
224
+ unicode-display_width (2.2.0)
225
+ warning (1.3.0)
226
+ websocket-driver (0.7.5)
227
+ websocket-extensions (>= 0.1.0)
228
+ websocket-extensions (0.1.5)
229
+ zeitwerk (2.6.0)
123
230
 
124
231
  PLATFORMS
125
232
  ruby
@@ -127,19 +234,20 @@ PLATFORMS
127
234
 
128
235
  DEPENDENCIES
129
236
  acidic_job!
130
- activejob (~> 6.1.3.2)
131
- activerecord (~> 6.1.3.2)
132
- database_cleaner
133
- minitest (~> 5.0)
134
- pry
135
- railties (>= 4.0)
136
- rake (~> 13.0)
137
- rubocop (~> 1.7)
237
+ combustion
238
+ minitest
239
+ net-smtp
240
+ noticed
241
+ psych (> 4.0)
242
+ railties
243
+ rake
244
+ rubocop
138
245
  rubocop-minitest
139
246
  rubocop-rake
140
247
  sidekiq
141
248
  simplecov
142
249
  sqlite3
250
+ warning
143
251
 
144
252
  BUNDLED WITH
145
- 2.2.31
253
+ 2.2.32