cloudtasker 0.11.1 → 0.12.rc1

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: d0073665ed9d9a5422641a1e86d876f5d7de70a66a060c589b1a02958497dd2a
4
- data.tar.gz: eaa1e44611b8f3d312064ab3019a1ba2bfc5e368ef7ae2eabed3f69395b1ad05
3
+ metadata.gz: b89246a4e0d7f658fdb3115c3a00b54df0e55b930428fe52caef471386119906
4
+ data.tar.gz: 4fe22aa2588e95fffcb223e32e50a2baa5df2730d1e04f8f9d0202aa4138fbd4
5
5
  SHA512:
6
- metadata.gz: 7c21279533185a8067adb7b78d860703dc9f7f33a099ed74d6a88f1a8f804401751d3387912671ddf683121fed1aaf9437d89839ad346cf11dd456e8595564e6
7
- data.tar.gz: d03c95197c2a6195f16f9943d1d2621c3c2b759bb5cd721cb9218a33522fb40e936ddd378d01c0b073c1ef1c97653894ddc870d5ab0e566e195ae505f7f9b5ee
6
+ metadata.gz: 1ea18e7601bb394ad4d7f72838bf3eaa9d7ff05df0f0b4f3d08e5d7fa82cee52e51be0c4148d0ac282986f366f6159d0bcc634993f07fbbf28c63ec021d29b5e
7
+ data.tar.gz: 9282074934628583c6c7b5d2bc6efaf6fac87777bab718adf2204f3eb87143f8bce950711395f6d1ecc6dac6fb349fef52bc94eeb42352322d824b6b35011d5a
@@ -1,6 +1,10 @@
1
1
  name: Test
2
2
 
3
- on: [push, pull_request]
3
+ on:
4
+ push:
5
+ branches: [ master, 0.9-stable ]
6
+ pull_request:
7
+ branches: [ master, 0.9-stable ]
4
8
 
5
9
  jobs:
6
10
  build:
data/.rubocop.yml CHANGED
@@ -13,6 +13,8 @@ Metrics/ModuleLength:
13
13
 
14
14
  Metrics/AbcSize:
15
15
  Max: 20
16
+ Exclude:
17
+ - 'spec/support/*'
16
18
 
17
19
  Metrics/LineLength:
18
20
  Max: 120
@@ -47,4 +49,9 @@ Metrics/ParameterLists:
47
49
  CountKeywordArgs: false
48
50
 
49
51
  RSpec/MessageSpies:
50
- Enabled: false
52
+ Enabled: false
53
+
54
+ RSpec/MultipleExpectations:
55
+ Exclude:
56
+ - 'examples/**/*'
57
+ - 'spec/integration/**/*'
data/CHANGELOG.md CHANGED
@@ -1,30 +1,20 @@
1
1
  # Changelog
2
2
 
3
- ## [v0.11.1](https://github.com/keypup-io/cloudtasker/tree/v0.11.1) (2021-08-25)
3
+ ## Latest RC [v0.12.rc1](https://github.com/keypup-io/cloudtasker/tree/v0.12.rc1) (2021-03-11)
4
4
 
5
- [Full Changelog](https://github.com/keypup-io/cloudtasker/compare/v0.11.0...v0.11.1)
5
+ [Full Changelog](https://github.com/keypup-io/cloudtasker/compare/v0.11.0...v0.12.rc1)
6
6
 
7
- **Fixed bugs:**
8
- - Dependencies: Require `try` from `activesupport`. This was preventing non-Rails projects from properly running Cloudtasker jobs.
9
- - WorkerController: remove useless inheritance from local ApplicationController. The parent controller was not always loaded on Rails 5 which in turn created issues with authenticity token. Fixes [#40](https://github.com/keypup-io/cloudtasker/issues/40)
10
-
11
- ## [v0.10.2](https://github.com/keypup-io/cloudtasker/tree/v0.10.2) (2021-08-25)
12
-
13
- [Full Changelog](https://github.com/keypup-io/cloudtasker/compare/v0.10.1...v0.10.2)
14
-
15
- **Fixed bugs:**
16
- - Dependencies: Require `try` from `activesupport`. This was preventing non-Rails projects from properly running Cloudtasker jobs.
17
- - WorkerController: remove useless inheritance from local ApplicationController. The parent controller was not always loaded on Rails 5 which in turn created issues with authenticity token. Fixes [#40](https://github.com/keypup-io/cloudtasker/issues/40)
18
-
19
- ## [v0.9.5](https://github.com/keypup-io/cloudtasker/tree/v0.9.5) (2021-08-25)
20
-
21
- [Full Changelog](https://github.com/keypup-io/cloudtasker/compare/v0.9.4...v0.9.5)
7
+ **Improvements:**
8
+ - ActiveJob: do not double log errors (ActiveJob has its own error logging)
9
+ - Error logging: Use worker logger so as to include context (job args etc.)
10
+ - Error logging: Do not log exception and stack trace separately, combine them instead.
11
+ - Batch callbacks: Retry jobs when completion callback fails
12
+ - Redis: Use Redis Sets instead of key pattern matching for listing methods (Cron jobs and Local Server)
22
13
 
23
14
  **Fixed bugs:**
24
- - Dependencies: Require `try` from `activesupport`. This was preventing non-Rails projects from properly running Cloudtasker jobs.
25
- - WorkerController: remove useless inheritance from local ApplicationController. The parent controller was not always loaded on Rails 5 which in turn created issues with authenticity token. Fixes [#40](https://github.com/keypup-io/cloudtasker/issues/40)
15
+ - Retries: Enforce job retry limit on job processing. There was an edge case where jobs could be retried indefinitely on batch callback errors.
26
16
 
27
- ## [v0.11.0](https://github.com/keypup-io/cloudtasker/tree/v0.11.0) (2020-11-23)
17
+ ## [v0.11.0](https://github.com/keypup-io/cloudtasker/tree/v0.11.0) (2021-03-11)
28
18
 
29
19
  [Full Changelog](https://github.com/keypup-io/cloudtasker/compare/v0.10.0...v0.11.0)
30
20
 
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cloudtasker
4
+ # Base Cloudtasker controller
5
+ class ApplicationController < ActionController::Base
6
+ skip_before_action :verify_authenticity_token
7
+ end
8
+ end
@@ -2,10 +2,7 @@
2
2
 
3
3
  module Cloudtasker
4
4
  # Handle execution of workers
5
- class WorkerController < ActionController::Base
6
- # No need for CSRF verification on API endpoints
7
- skip_before_action :verify_authenticity_token
8
-
5
+ class WorkerController < ApplicationController
9
6
  # Authenticate all requests.
10
7
  before_action :authenticate!
11
8
 
@@ -22,32 +19,19 @@ module Cloudtasker
22
19
  # Process payload
23
20
  WorkerHandler.execute_from_payload!(payload)
24
21
  head :no_content
25
- rescue DeadWorkerError, MissingWorkerArgumentsError => e
22
+ rescue DeadWorkerError, MissingWorkerArgumentsError
26
23
  # 205: job will NOT be retried
27
- log_error(e)
28
24
  head :reset_content
29
- rescue InvalidWorkerError => e
25
+ rescue InvalidWorkerError
30
26
  # 404: Job will be retried
31
- log_error(e)
32
27
  head :not_found
33
- rescue StandardError => e
34
- # 404: Job will be retried
35
- log_error(e)
28
+ rescue StandardError
29
+ # 422: Job will be retried
36
30
  head :unprocessable_entity
37
31
  end
38
32
 
39
33
  private
40
34
 
41
- #
42
- # Log an error via cloudtasker logger.
43
- #
44
- # @param [Exception] e The error to log
45
- #
46
- def log_error(error)
47
- Cloudtasker.logger.error(error)
48
- Cloudtasker.logger.error(error.backtrace.join("\n"))
49
- end
50
-
51
35
  #
52
36
  # Parse the request body and return the actual job
53
37
  # payload.
@@ -13,95 +13,75 @@ PATH
13
13
  GEM
14
14
  remote: https://rubygems.org/
15
15
  specs:
16
- actioncable (6.1.4.1)
17
- actionpack (= 6.1.4.1)
18
- activesupport (= 6.1.4.1)
16
+ actioncable (6.1.3)
17
+ actionpack (= 6.1.3)
18
+ activesupport (= 6.1.3)
19
19
  nio4r (~> 2.0)
20
20
  websocket-driver (>= 0.6.1)
21
- actionmailbox (6.1.4.1)
22
- actionpack (= 6.1.4.1)
23
- activejob (= 6.1.4.1)
24
- activerecord (= 6.1.4.1)
25
- activestorage (= 6.1.4.1)
26
- activesupport (= 6.1.4.1)
21
+ actionmailbox (6.1.3)
22
+ actionpack (= 6.1.3)
23
+ activejob (= 6.1.3)
24
+ activerecord (= 6.1.3)
25
+ activestorage (= 6.1.3)
26
+ activesupport (= 6.1.3)
27
27
  mail (>= 2.7.1)
28
- actionmailer (6.1.4.1)
29
- actionpack (= 6.1.4.1)
30
- actionview (= 6.1.4.1)
31
- activejob (= 6.1.4.1)
32
- activesupport (= 6.1.4.1)
28
+ actionmailer (6.1.3)
29
+ actionpack (= 6.1.3)
30
+ actionview (= 6.1.3)
31
+ activejob (= 6.1.3)
32
+ activesupport (= 6.1.3)
33
33
  mail (~> 2.5, >= 2.5.4)
34
34
  rails-dom-testing (~> 2.0)
35
- actionpack (6.1.4.1)
36
- actionview (= 6.1.4.1)
37
- activesupport (= 6.1.4.1)
35
+ actionpack (6.1.3)
36
+ actionview (= 6.1.3)
37
+ activesupport (= 6.1.3)
38
38
  rack (~> 2.0, >= 2.0.9)
39
39
  rack-test (>= 0.6.3)
40
40
  rails-dom-testing (~> 2.0)
41
41
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
42
- actiontext (6.1.4.1)
43
- actionpack (= 6.1.4.1)
44
- activerecord (= 6.1.4.1)
45
- activestorage (= 6.1.4.1)
46
- activesupport (= 6.1.4.1)
42
+ actiontext (6.1.3)
43
+ actionpack (= 6.1.3)
44
+ activerecord (= 6.1.3)
45
+ activestorage (= 6.1.3)
46
+ activesupport (= 6.1.3)
47
47
  nokogiri (>= 1.8.5)
48
- actionview (6.1.4.1)
49
- activesupport (= 6.1.4.1)
48
+ actionview (6.1.3)
49
+ activesupport (= 6.1.3)
50
50
  builder (~> 3.1)
51
51
  erubi (~> 1.4)
52
52
  rails-dom-testing (~> 2.0)
53
53
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
54
- activejob (6.1.4.1)
55
- activesupport (= 6.1.4.1)
54
+ activejob (6.1.3)
55
+ activesupport (= 6.1.3)
56
56
  globalid (>= 0.3.6)
57
- activemodel (6.1.4.1)
58
- activesupport (= 6.1.4.1)
59
- activerecord (6.1.4.1)
60
- activemodel (= 6.1.4.1)
61
- activesupport (= 6.1.4.1)
62
- activestorage (6.1.4.1)
63
- actionpack (= 6.1.4.1)
64
- activejob (= 6.1.4.1)
65
- activerecord (= 6.1.4.1)
66
- activesupport (= 6.1.4.1)
67
- marcel (~> 1.0.0)
68
- mini_mime (>= 1.1.0)
69
- activesupport (6.1.4.1)
57
+ activemodel (6.1.3)
58
+ activesupport (= 6.1.3)
59
+ activerecord (6.1.3)
60
+ activemodel (= 6.1.3)
61
+ activesupport (= 6.1.3)
62
+ activestorage (6.1.3)
63
+ actionpack (= 6.1.3)
64
+ activejob (= 6.1.3)
65
+ activerecord (= 6.1.3)
66
+ activesupport (= 6.1.3)
67
+ marcel (~> 0.3.1)
68
+ mimemagic (~> 0.3.2)
69
+ activesupport (6.1.3)
70
70
  concurrent-ruby (~> 1.0, >= 1.0.2)
71
71
  i18n (>= 1.6, < 2)
72
72
  minitest (>= 5.1)
73
73
  tzinfo (~> 2.0)
74
74
  zeitwerk (~> 2.3)
75
- addressable (2.8.0)
75
+ addressable (2.7.0)
76
76
  public_suffix (>= 2.0.2, < 5.0)
77
- appraisal (2.4.1)
77
+ appraisal (2.4.0)
78
78
  bundler
79
79
  rake
80
80
  thor (>= 0.14.0)
81
81
  ast (2.4.2)
82
- async (1.30.1)
83
- console (~> 1.10)
84
- nio4r (~> 2.3)
85
- timers (~> 4.1)
86
- async-http (0.56.5)
87
- async (>= 1.25)
88
- async-io (>= 1.28)
89
- async-pool (>= 0.2)
90
- protocol-http (~> 0.22.0)
91
- protocol-http1 (~> 0.14.0)
92
- protocol-http2 (~> 0.14.0)
93
- async-http-faraday (0.11.0)
94
- async-http (~> 0.42)
95
- faraday
96
- async-io (1.32.2)
97
- async
98
- async-pool (0.3.8)
99
- async (>= 1.25)
100
82
  builder (3.2.4)
101
- concurrent-ruby (1.1.9)
102
- connection_pool (2.2.5)
103
- console (1.13.1)
104
- fiber-local
83
+ concurrent-ruby (1.1.8)
84
+ connection_pool (2.2.3)
105
85
  crack (0.4.5)
106
86
  rexml
107
87
  crass (1.0.6)
@@ -109,42 +89,26 @@ GEM
109
89
  erubi (1.10.0)
110
90
  et-orbi (1.2.4)
111
91
  tzinfo
112
- faraday (1.7.0)
113
- faraday-em_http (~> 1.0)
114
- faraday-em_synchrony (~> 1.0)
115
- faraday-excon (~> 1.1)
116
- faraday-httpclient (~> 1.0.1)
92
+ faraday (1.3.0)
117
93
  faraday-net_http (~> 1.0)
118
- faraday-net_http_persistent (~> 1.1)
119
- faraday-patron (~> 1.0)
120
- faraday-rack (~> 1.0)
121
94
  multipart-post (>= 1.2, < 3)
122
- ruby2_keywords (>= 0.0.4)
123
- faraday-em_http (1.0.0)
124
- faraday-em_synchrony (1.0.0)
125
- faraday-excon (1.1.0)
95
+ ruby2_keywords
126
96
  faraday-http-cache (2.2.0)
127
97
  faraday (>= 0.8)
128
- faraday-httpclient (1.0.1)
129
98
  faraday-net_http (1.0.1)
130
- faraday-net_http_persistent (1.2.0)
131
- faraday-patron (1.0.0)
132
- faraday-rack (1.0.0)
133
- fiber-local (1.0.0)
134
- fugit (1.5.1)
99
+ fugit (1.4.2)
135
100
  et-orbi (~> 1.1, >= 1.1.8)
136
101
  raabro (~> 1.4)
137
- github_changelog_generator (1.16.4)
102
+ github_changelog_generator (1.15.2)
138
103
  activesupport
139
- async (>= 1.25.0)
140
- async-http-faraday
141
104
  faraday-http-cache
142
105
  multi_json
143
106
  octokit (~> 4.6)
144
107
  rainbow (>= 2.2.1)
145
108
  rake (>= 10.0)
146
- globalid (0.5.2)
147
- activesupport (>= 5.0)
109
+ retriable (~> 3.0)
110
+ globalid (0.4.2)
111
+ activesupport (>= 4.2.0)
148
112
  google-cloud-tasks (1.0.0)
149
113
  google-gax (~> 1.3)
150
114
  googleapis-common-protos (>= 1.3.9, < 2.0)
@@ -155,100 +119,95 @@ GEM
155
119
  googleauth (~> 0.9)
156
120
  grpc (~> 1.24)
157
121
  rly (~> 0.2.3)
158
- google-protobuf (3.17.3)
122
+ google-protobuf (3.15.5)
159
123
  googleapis-common-protos (1.3.11)
160
124
  google-protobuf (~> 3.14)
161
125
  googleapis-common-protos-types (>= 1.0.6, < 2.0)
162
126
  grpc (~> 1.27)
163
- googleapis-common-protos-types (1.1.0)
127
+ googleapis-common-protos-types (1.0.6)
164
128
  google-protobuf (~> 3.14)
165
- googleauth (0.17.0)
129
+ googleauth (0.16.0)
166
130
  faraday (>= 0.17.3, < 2.0)
167
131
  jwt (>= 1.4, < 3.0)
168
132
  memoist (~> 0.16)
169
133
  multi_json (~> 1.11)
170
134
  os (>= 0.9, < 2.0)
171
135
  signet (~> 0.14)
172
- grpc (1.38.0)
173
- google-protobuf (~> 3.15)
136
+ grpc (1.36.0)
137
+ google-protobuf (~> 3.14)
174
138
  googleapis-common-protos-types (~> 1.0)
175
139
  grpc-google-iam-v1 (0.6.11)
176
140
  google-protobuf (~> 3.14)
177
141
  googleapis-common-protos (>= 1.3.11, < 2.0)
178
142
  grpc (~> 1.27)
179
143
  hashdiff (1.0.1)
180
- i18n (1.8.10)
144
+ i18n (1.8.9)
181
145
  concurrent-ruby (~> 1.0)
182
146
  jaro_winkler (1.5.4)
183
- jwt (2.2.3)
184
- loofah (2.12.0)
147
+ jwt (2.2.2)
148
+ loofah (2.9.0)
185
149
  crass (~> 1.0.2)
186
150
  nokogiri (>= 1.5.9)
187
151
  mail (2.7.1)
188
152
  mini_mime (>= 0.1.1)
189
- marcel (1.0.1)
153
+ marcel (0.3.3)
154
+ mimemagic (~> 0.3.2)
190
155
  memoist (0.16.2)
191
156
  method_source (1.0.0)
192
- mini_mime (1.1.1)
193
- mini_portile2 (2.6.1)
157
+ mimemagic (0.3.5)
158
+ mini_mime (1.0.2)
159
+ mini_portile2 (2.5.0)
194
160
  minitest (5.14.4)
195
161
  multi_json (1.15.0)
196
162
  multipart-post (2.1.1)
197
- nio4r (2.5.8)
198
- nokogiri (1.12.3)
199
- mini_portile2 (~> 2.6.1)
163
+ nio4r (2.5.7)
164
+ nokogiri (1.11.2)
165
+ mini_portile2 (~> 2.5.0)
200
166
  racc (~> 1.4)
201
- octokit (4.21.0)
167
+ octokit (4.20.0)
202
168
  faraday (>= 0.9)
203
169
  sawyer (~> 0.8.0, >= 0.5.3)
204
170
  os (1.1.1)
205
171
  parallel (1.20.1)
206
- parser (3.0.2.0)
172
+ parser (3.0.0.0)
207
173
  ast (~> 2.4.1)
208
- protocol-hpack (1.4.2)
209
- protocol-http (0.22.5)
210
- protocol-http1 (0.14.2)
211
- protocol-http (~> 0.22)
212
- protocol-http2 (0.14.2)
213
- protocol-hpack (~> 1.4)
214
- protocol-http (~> 0.18)
215
174
  public_suffix (4.0.6)
216
175
  raabro (1.4.0)
217
176
  racc (1.5.2)
218
177
  rack (2.2.3)
219
178
  rack-test (1.1.0)
220
179
  rack (>= 1.0, < 3)
221
- rails (6.1.4.1)
222
- actioncable (= 6.1.4.1)
223
- actionmailbox (= 6.1.4.1)
224
- actionmailer (= 6.1.4.1)
225
- actionpack (= 6.1.4.1)
226
- actiontext (= 6.1.4.1)
227
- actionview (= 6.1.4.1)
228
- activejob (= 6.1.4.1)
229
- activemodel (= 6.1.4.1)
230
- activerecord (= 6.1.4.1)
231
- activestorage (= 6.1.4.1)
232
- activesupport (= 6.1.4.1)
180
+ rails (6.1.3)
181
+ actioncable (= 6.1.3)
182
+ actionmailbox (= 6.1.3)
183
+ actionmailer (= 6.1.3)
184
+ actionpack (= 6.1.3)
185
+ actiontext (= 6.1.3)
186
+ actionview (= 6.1.3)
187
+ activejob (= 6.1.3)
188
+ activemodel (= 6.1.3)
189
+ activerecord (= 6.1.3)
190
+ activestorage (= 6.1.3)
191
+ activesupport (= 6.1.3)
233
192
  bundler (>= 1.15.0)
234
- railties (= 6.1.4.1)
193
+ railties (= 6.1.3)
235
194
  sprockets-rails (>= 2.0.0)
236
195
  rails-dom-testing (2.0.3)
237
196
  activesupport (>= 4.2.0)
238
197
  nokogiri (>= 1.6)
239
- rails-html-sanitizer (1.4.2)
198
+ rails-html-sanitizer (1.3.0)
240
199
  loofah (~> 2.3)
241
- railties (6.1.4.1)
242
- actionpack (= 6.1.4.1)
243
- activesupport (= 6.1.4.1)
200
+ railties (6.1.3)
201
+ actionpack (= 6.1.3)
202
+ activesupport (= 6.1.3)
244
203
  method_source
245
- rake (>= 0.13)
204
+ rake (>= 0.8.7)
246
205
  thor (~> 1.0)
247
206
  rainbow (3.0.0)
248
- rake (13.0.6)
249
- redis (4.4.0)
207
+ rake (13.0.3)
208
+ redis (4.2.5)
250
209
  retriable (3.1.2)
251
- rexml (3.2.5)
210
+ rexml (3.2.4)
252
211
  rly (0.2.3)
253
212
  rspec (3.10.0)
254
213
  rspec-core (~> 3.10.0)
@@ -263,7 +222,7 @@ GEM
263
222
  rspec-mocks (3.10.2)
264
223
  diff-lcs (>= 1.2.0, < 2.0)
265
224
  rspec-support (~> 3.10.0)
266
- rspec-rails (5.0.2)
225
+ rspec-rails (5.0.0)
267
226
  actionpack (>= 5.2)
268
227
  activesupport (>= 5.2)
269
228
  railties (>= 5.2)
@@ -282,11 +241,11 @@ GEM
282
241
  rubocop-rspec (1.37.0)
283
242
  rubocop (>= 0.68.1)
284
243
  ruby-progressbar (1.11.0)
285
- ruby2_keywords (0.0.5)
244
+ ruby2_keywords (0.0.4)
286
245
  sawyer (0.8.2)
287
246
  addressable (>= 2.3.5)
288
247
  faraday (> 0.8, < 2.0)
289
- semantic_logger (4.8.2)
248
+ semantic_logger (4.7.4)
290
249
  concurrent-ruby (~> 1.0)
291
250
  signet (0.15.0)
292
251
  addressable (~> 2.3)
@@ -303,15 +262,14 @@ GEM
303
262
  sqlite3 (1.4.2)
304
263
  thor (1.1.0)
305
264
  timecop (0.9.4)
306
- timers (4.3.3)
307
265
  tzinfo (2.0.4)
308
266
  concurrent-ruby (~> 1.0)
309
267
  unicode-display_width (1.6.1)
310
- webmock (3.14.0)
311
- addressable (>= 2.8.0)
268
+ webmock (3.12.1)
269
+ addressable (>= 2.3.6)
312
270
  crack (>= 0.3.2)
313
271
  hashdiff (>= 0.4.0, < 2.0.0)
314
- websocket-driver (0.7.5)
272
+ websocket-driver (0.7.3)
315
273
  websocket-extensions (>= 0.1.0)
316
274
  websocket-extensions (0.1.5)
317
275
  zeitwerk (2.4.2)