acidic_job 0.7.7 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/.github/FUNDING.yml +13 -0
  3. data/.github/workflows/main.yml +36 -12
  4. data/.gitignore +6 -0
  5. data/.rubocop.yml +21 -0
  6. data/.tool-versions +1 -0
  7. data/Gemfile +0 -25
  8. data/Gemfile.lock +176 -74
  9. data/README.md +299 -46
  10. data/UPGRADE_GUIDE.md +81 -0
  11. data/acidic_job.gemspec +15 -2
  12. data/bin/console +5 -2
  13. data/combustion/log/test.log +0 -0
  14. data/gemfiles/rails_6.1_sidekiq_6.4.gemfile +10 -0
  15. data/gemfiles/rails_6.1_sidekiq_6.5.gemfile +10 -0
  16. data/gemfiles/rails_7.0_sidekiq_6.4.gemfile +10 -0
  17. data/gemfiles/rails_7.0_sidekiq_6.5.gemfile +10 -0
  18. data/gemfiles/rails_7.1_sidekiq_6.4.gemfile +10 -0
  19. data/gemfiles/rails_7.1_sidekiq_6.5.gemfile +10 -0
  20. data/lib/acidic_job/active_kiq.rb +114 -0
  21. data/lib/acidic_job/arguments.rb +22 -0
  22. data/lib/acidic_job/base.rb +11 -0
  23. data/lib/acidic_job/errors.rb +11 -17
  24. data/lib/acidic_job/extensions/action_mailer.rb +19 -0
  25. data/lib/acidic_job/extensions/noticed.rb +46 -0
  26. data/lib/acidic_job/{response.rb → finished_point.rb} +5 -7
  27. data/lib/acidic_job/idempotency_key.rb +27 -0
  28. data/lib/acidic_job/logger.rb +31 -0
  29. data/lib/acidic_job/mixin.rb +250 -0
  30. data/lib/acidic_job/perform_wrapper.rb +14 -27
  31. data/lib/acidic_job/processor.rb +95 -0
  32. data/lib/acidic_job/rails.rb +40 -0
  33. data/lib/acidic_job/recovery_point.rb +4 -5
  34. data/lib/acidic_job/run.rb +303 -0
  35. data/lib/acidic_job/serializer.rb +24 -0
  36. data/lib/acidic_job/serializers/exception_serializer.rb +41 -0
  37. data/lib/acidic_job/serializers/finished_point_serializer.rb +24 -0
  38. data/lib/acidic_job/serializers/job_serializer.rb +27 -0
  39. data/lib/acidic_job/serializers/range_serializer.rb +28 -0
  40. data/lib/acidic_job/serializers/recovery_point_serializer.rb +25 -0
  41. data/lib/acidic_job/serializers/worker_serializer.rb +27 -0
  42. data/lib/acidic_job/test_case.rb +9 -0
  43. data/lib/acidic_job/testing.rb +73 -0
  44. data/lib/acidic_job/version.rb +1 -1
  45. data/lib/acidic_job/workflow.rb +70 -0
  46. data/lib/acidic_job/workflow_builder.rb +35 -0
  47. data/lib/acidic_job/workflow_step.rb +103 -0
  48. data/lib/acidic_job.rb +25 -334
  49. data/lib/generators/acidic_job/drop_tables_generator.rb +26 -0
  50. data/lib/generators/acidic_job/install_generator.rb +27 -0
  51. data/lib/generators/acidic_job/templates/create_acidic_job_runs_migration.rb.erb +19 -0
  52. data/lib/generators/{templates/create_acidic_job_keys_migration.rb.erb → acidic_job/templates/drop_acidic_job_keys_migration.rb.erb} +10 -3
  53. metadata +214 -18
  54. data/.ruby_version +0 -1
  55. data/lib/acidic_job/deliver_transactionally_extension.rb +0 -26
  56. data/lib/acidic_job/key.rb +0 -33
  57. data/lib/acidic_job/no_op.rb +0 -11
  58. data/lib/acidic_job/perform_transactionally_extension.rb +0 -33
  59. data/lib/acidic_job/sidekiq_callbacks.rb +0 -45
  60. data/lib/acidic_job/staged.rb +0 -50
  61. data/lib/generators/acidic_job_generator.rb +0 -44
  62. 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: a8027a99e7fc6d5602e3269445211abefe4b835f69a7a33b0dea1f70fffec642
4
+ data.tar.gz: 6a38451eb30528b774a2a4ee31ac8f2733dea2035c25c3713ecad873c10759c8
5
5
  SHA512:
6
- metadata.gz: 8dd451aeb1da7539193db26a4a42adc0b04b1ad48ecf71438cee14a78c8b352e287d43f838716eb4f4d8957210aba583b12c0d8e064dcbf6d4aa746310e4489f
7
- data.tar.gz: aab8e61fc8292a6354e993ea98eaffe30350649c0cfce56ba974c732aa5c43f4c51b3f94a9aeec7cf0613ff36ebf1af6e761df85196426867ae1e1dd33679e0d
6
+ metadata.gz: ce9eab1470bb0dbc63d92c2b3f8baa124e9f6a5dde95899248376b893a326ba71e6604d5892950677294d1226eb9e2fd8cc658952dee9222dea7c35c0c2f95f3
7
+ data.tar.gz: 981613d28454547304c3123250256b74eb80b6af7d3212e138cfbdc3e59c347dfed5c0b96ca95498a511b0391fd893ad0d871ef3dc07939118d3231208370fb3
@@ -0,0 +1,13 @@
1
+ # These are supported funding model platforms
2
+
3
+ github: fractaledmind
4
+ patreon: # Replace with a single Patreon username
5
+ open_collective: # Replace with a single Open Collective username
6
+ ko_fi: # Replace with a single Ko-fi username
7
+ tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8
+ community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9
+ liberapay: # Replace with a single Liberapay username
10
+ issuehunt: # Replace with a single IssueHunt username
11
+ otechie: # Replace with a single Otechie username
12
+ lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
13
+ custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
@@ -1,18 +1,42 @@
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
+ sidekiq: ["6.4", "6.5"]
15
+ services:
16
+ redis:
17
+ image: redis
18
+ options: >-
19
+ --health-cmd "redis-cli ping"
20
+ --health-interval 10s
21
+ --health-timeout 5s
22
+ --health-retries 5
23
+ ports:
24
+ - 6379:6379
25
+
26
+ env:
27
+ BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails_${{ matrix.rails }}_sidekiq_${{ matrix.sidekiq }}.gemfile
28
+
8
29
  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
30
+ - uses: actions/checkout@v2
31
+
32
+ - name: Set up Ruby
33
+ # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
34
+ # change this to (see https://github.com/ruby/setup-ruby#versioning):
35
+ uses: ruby/setup-ruby@v1
36
+ with:
37
+ bundler-cache: true # 'bundle install' and cache gems
38
+ ruby-version: ${{ matrix.ruby }}
39
+
40
+ - name: Run the default task
41
+ run: bundle exec rake
42
+ 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/*.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,125 +1,228 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- acidic_job (0.7.7)
5
- activerecord (>= 4.0.0)
4
+ acidic_job (0.8.0)
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
+ public_suffix (4.0.7)
150
+ racc (1.6.0)
151
+ rack (2.2.4)
152
+ rack-test (2.0.2)
153
+ rack (>= 1.3)
154
+ rails (7.0.3.1)
155
+ actioncable (= 7.0.3.1)
156
+ actionmailbox (= 7.0.3.1)
157
+ actionmailer (= 7.0.3.1)
158
+ actionpack (= 7.0.3.1)
159
+ actiontext (= 7.0.3.1)
160
+ actionview (= 7.0.3.1)
161
+ activejob (= 7.0.3.1)
162
+ activemodel (= 7.0.3.1)
163
+ activerecord (= 7.0.3.1)
164
+ activestorage (= 7.0.3.1)
165
+ activesupport (= 7.0.3.1)
166
+ bundler (>= 1.15.0)
167
+ railties (= 7.0.3.1)
75
168
  rails-dom-testing (2.0.3)
76
169
  activesupport (>= 4.2.0)
77
170
  nokogiri (>= 1.6)
78
- rails-html-sanitizer (1.4.1)
171
+ rails-html-sanitizer (1.4.3)
79
172
  loofah (~> 2.3)
80
- railties (6.1.3.2)
81
- actionpack (= 6.1.3.2)
82
- activesupport (= 6.1.3.2)
173
+ railties (7.0.3.1)
174
+ actionpack (= 7.0.3.1)
175
+ activesupport (= 7.0.3.1)
83
176
  method_source
84
- rake (>= 0.8.7)
177
+ rake (>= 12.2)
85
178
  thor (~> 1.0)
86
- rainbow (3.0.0)
87
- rake (13.0.4)
88
- redis (4.4.0)
89
- regexp_parser (2.1.1)
179
+ zeitwerk (~> 2.5)
180
+ rainbow (3.1.1)
181
+ rake (13.0.6)
182
+ redis (4.7.1)
183
+ regexp_parser (2.5.0)
90
184
  rexml (3.2.5)
91
- rubocop (1.18.3)
185
+ rubocop (1.31.2)
186
+ json (~> 2.3)
92
187
  parallel (~> 1.10)
93
- parser (>= 3.0.0.0)
188
+ parser (>= 3.1.0.0)
94
189
  rainbow (>= 2.2.2, < 4.0)
95
190
  regexp_parser (>= 1.8, < 3.0)
96
- rexml
97
- rubocop-ast (>= 1.7.0, < 2.0)
191
+ rexml (>= 3.2.5, < 4.0)
192
+ rubocop-ast (>= 1.18.0, < 2.0)
98
193
  ruby-progressbar (~> 1.7)
99
194
  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)
195
+ rubocop-ast (1.19.1)
196
+ parser (>= 3.1.1.0)
197
+ rubocop-minitest (0.20.1)
103
198
  rubocop (>= 0.90, < 2.0)
104
199
  rubocop-rake (0.6.0)
105
200
  rubocop (~> 1.0)
106
201
  ruby-progressbar (1.11.0)
107
- sidekiq (6.2.2)
202
+ sidekiq (6.5.3)
108
203
  connection_pool (>= 2.2.2)
109
204
  rack (~> 2.0)
110
- redis (>= 4.2.0)
205
+ redis (>= 4.5.0)
111
206
  simplecov (0.21.2)
112
207
  docile (~> 1.1)
113
208
  simplecov-html (~> 0.11)
114
209
  simplecov_json_formatter (~> 0.1)
115
210
  simplecov-html (0.12.3)
116
- simplecov_json_formatter (0.1.3)
117
- sqlite3 (1.4.2)
118
- thor (1.1.0)
211
+ simplecov_json_formatter (0.1.4)
212
+ sqlite3 (1.4.4)
213
+ strscan (3.0.3)
214
+ thor (1.2.1)
215
+ timeout (0.3.0)
119
216
  tzinfo (2.0.4)
120
217
  concurrent-ruby (~> 1.0)
121
- unicode-display_width (2.0.0)
122
- zeitwerk (2.4.2)
218
+ unf (0.1.4)
219
+ unf_ext
220
+ unf_ext (0.0.8.2)
221
+ unicode-display_width (2.2.0)
222
+ websocket-driver (0.7.5)
223
+ websocket-extensions (>= 0.1.0)
224
+ websocket-extensions (0.1.5)
225
+ zeitwerk (2.6.0)
123
226
 
124
227
  PLATFORMS
125
228
  ruby
@@ -127,14 +230,13 @@ PLATFORMS
127
230
 
128
231
  DEPENDENCIES
129
232
  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)
233
+ combustion
234
+ minitest
235
+ net-smtp
236
+ noticed
237
+ railties
238
+ rake
239
+ rubocop
138
240
  rubocop-minitest
139
241
  rubocop-rake
140
242
  sidekiq
@@ -142,4 +244,4 @@ DEPENDENCIES
142
244
  sqlite3
143
245
 
144
246
  BUNDLED WITH
145
- 2.2.31
247
+ 2.3.19