apisonator 3.2.0 → 3.3.2

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: 1036d32ab3793674c8fe3d815e471581d0056c9a7739b46079ce67f89827bc40
4
- data.tar.gz: 63bd9f6b690a4e5ec8fa276839001979cbf25f38e9105727679dfcb6d962a0ea
3
+ metadata.gz: 881dcbb24dbe3757ed8d786f49cdf6aab9dce3bb060f26387f142b4e825e06a1
4
+ data.tar.gz: e25f370546c286d5400fdbf19331ef554f34ce47c91df522007039c1fbf322e4
5
5
  SHA512:
6
- metadata.gz: 669fa971a4f210d6709f40bac15bad1768e803f5bd4b979a66046151e8f8b572735088dd4e164866edafba681b6de7311abcce4bab9bb951e3b7fcfc128e1cb4
7
- data.tar.gz: 58775cf983c7ba17ff823a9f11d41ef7790b63c3f206cf718f4ba605be8781bc5c8fe99830b8e2bb9da4951dfd7108655b83e055f99bc8c91d6950c891f0234b
6
+ metadata.gz: 618be1a317cee54f1892357f7a64739b79eb0e203e15ae03a367176642e4d526c72d283a59438640e1e6503fd5e72a85be230deab76e6ac13c2305e8080aacd5
7
+ data.tar.gz: e7150ec528c2dc2b2b0f53a69fa50b2f5b7af52f736ca0a74196a38ae6be1b8a6913fd81fc609f00e18278c2fab571a7a926f647635b9b264b7abd7099673584
data/CHANGELOG.md CHANGED
@@ -2,6 +2,71 @@
2
2
 
3
3
  Notable changes to Apisonator will be tracked in this document.
4
4
 
5
+ ## 3.3.2 - 2021-02-23
6
+
7
+ ### Fixed
8
+
9
+ - Fixed nil exception in `Aggregator.process`
10
+ ([#269](https://github.com/3scale/apisonator/pull/269)).
11
+
12
+ ### Changed
13
+
14
+ - Updated to Ruby 2.7 in Docker images
15
+ ([#265](https://github.com/3scale/apisonator/pull/265)) and
16
+ ([#266](https://github.com/3scale/apisonator/pull/266)).
17
+ - Updated pry to 0.14.0 and pry-doc to 1.1.0
18
+ ([#267](https://github.com/3scale/apisonator/pull/267)).
19
+ - Updated Docker image to be based on RHEL UBI 8
20
+ ([#268](https://github.com/3scale/apisonator/pull/268)).
21
+
22
+ ### Removed
23
+
24
+ - Removed redundant prometheus config params
25
+ (`listener_prometheus_metrics.enabled` and `listener_prometheus_metrics.port`)
26
+ ([#270](https://github.com/3scale/apisonator/pull/270)).
27
+
28
+ ## 3.3.1.1 - 2021-02-12
29
+
30
+ ### Changed
31
+
32
+ - Updated our Puma fork to v4.3.7
33
+ ([#261](https://github.com/3scale/apisonator/pull/261)).
34
+
35
+ ## 3.3.1 - 2021-02-11
36
+
37
+ ### Fixed
38
+
39
+ - Usages with `#0` (set to 0) no longer generate unnecessary stats keys in Redis
40
+ ([#258](https://github.com/3scale/apisonator/pull/258)).
41
+
42
+ ## 3.3.0 - 2021-02-09
43
+
44
+ ### Added
45
+
46
+ - Rake task to delete stats keys set to 0 in the DB left there because of [this
47
+ issue](https://github.com/3scale/apisonator/pull/247)
48
+ ([#250](https://github.com/3scale/apisonator/pull/250)).
49
+
50
+ ### Fixed
51
+
52
+ - Made the worker more reliable when configured in async mode. Now it handles
53
+ connection errors better
54
+ ([#253](https://github.com/3scale/apisonator/pull/253)),
55
+ ([#254](https://github.com/3scale/apisonator/pull/254)), and
56
+ ([#255](https://github.com/3scale/apisonator/pull/255)).
57
+
58
+ ### Changed
59
+
60
+ - Updated async-redis to v0.5.1
61
+ ([#251](https://github.com/3scale/apisonator/pull/251)).
62
+
63
+ ## 3.2.1 - 2021-01-22
64
+
65
+ ### Fixed
66
+
67
+ - Reports of 0 hits no longer generate unnecessary stats keys in Redis
68
+ ([#247](https://github.com/3scale/apisonator/pull/247)).
69
+
5
70
  ## 3.2.0 - 2021-01-19
6
71
 
7
72
  ### Added
data/Gemfile.base CHANGED
@@ -15,11 +15,15 @@ platform :ruby do
15
15
  end
16
16
 
17
17
  group :test do
18
+ # Newer versions of rack-test don't work well with rspec-api-documentation.
19
+ # See https://github.com/rack/rack-test/pull/223 &
20
+ # https://github.com/zipmark/rspec_api_documentation/issues/342
21
+ gem 'rack-test', '= 0.8.2'
22
+
18
23
  gem 'benchmark-ips', '~> 2.7.2'
19
24
  gem 'mocha', '~> 1.3'
20
25
  gem 'nokogiri', '~> 1.10.8'
21
26
  gem 'pkg-config', '~> 1.1.7'
22
- gem 'rack-test', '~> 0.8.2'
23
27
  gem 'resque_unit', '~> 0.4.4', source: 'https://rubygems.org'
24
28
  gem 'test-unit', '~> 3.2.6'
25
29
  gem 'resque_spec', '~> 0.17.0'
@@ -32,8 +36,8 @@ end
32
36
  group :development do
33
37
  gem 'sshkit'
34
38
  gem 'source2swagger', git: 'https://github.com/3scale/source2swagger', branch: 'backend'
35
- gem 'pry', '~> 0.11.3'
36
- gem 'pry-doc', '~> 0.11.1'
39
+ gem 'pry', '~> 0.14'
40
+ gem 'pry-doc', '~> 1.1'
37
41
  gem 'license_finder', '~> 5'
38
42
  end
39
43
 
@@ -42,7 +46,7 @@ group :development, :test do
42
46
  end
43
47
 
44
48
  # Default server by platform
45
- gem 'puma', git: 'https://github.com/3scale/puma', ref: 'b034371406690d3e6c2a9301c4a48bd721f3efc3'
49
+ gem 'puma', git: 'https://github.com/3scale/puma', branch: '3scale-4.3.7'
46
50
  # gems required by the runner
47
51
  gem 'gli', '~> 2.16.1', require: nil
48
52
  # Workers
@@ -53,13 +57,14 @@ gem 'rake', '~> 13.0'
53
57
  gem 'builder', '= 3.2.3'
54
58
  # Use a patched resque to allow reusing their Airbrake Failure class
55
59
  gem 'resque', git: 'https://github.com/3scale/resque', branch: '3scale'
60
+ gem 'redis-namespace', '~>1.8.0'
56
61
  gem 'rack', '~> 2.1.4'
57
62
  gem 'sinatra', '~> 2.0.3'
58
63
  gem 'sinatra-contrib', '~> 2.0.3'
59
64
  # Optional external error logging services
60
65
  gem 'bugsnag', '~> 6', require: nil
61
66
  gem 'yabeda-prometheus', '~> 0.5.0'
62
- gem 'async-redis', '~> 0.5'
67
+ gem 'async-redis', '~> 0.5.1'
63
68
  gem 'falcon', '~> 0.35'
64
69
 
65
70
  # Use a patched redis-rb that fixes an issue when trying to connect with
data/Gemfile.lock CHANGED
@@ -1,9 +1,10 @@
1
1
  GIT
2
2
  remote: https://github.com/3scale/puma
3
- revision: b034371406690d3e6c2a9301c4a48bd721f3efc3
4
- ref: b034371406690d3e6c2a9301c4a48bd721f3efc3
3
+ revision: c0601d08695839b8ffd0f380e91c3b91c1e8b754
4
+ branch: 3scale-4.3.7
5
5
  specs:
6
- puma (2.15.3)
6
+ puma (4.3.7)
7
+ nio4r (~> 2.0)
7
8
 
8
9
  GIT
9
10
  remote: https://github.com/3scale/redis-rb
@@ -35,7 +36,7 @@ GIT
35
36
  PATH
36
37
  remote: .
37
38
  specs:
38
- apisonator (3.2.0)
39
+ apisonator (3.3.2)
39
40
 
40
41
  GEM
41
42
  remote: https://rubygems.org/
@@ -70,7 +71,7 @@ GEM
70
71
  async (~> 1.14)
71
72
  async-pool (0.2.0)
72
73
  async (~> 1.8)
73
- async-redis (0.5.0)
74
+ async-redis (0.5.1)
74
75
  async (~> 1.8)
75
76
  async-io (~> 1.10)
76
77
  async-pool (~> 0.2)
@@ -95,7 +96,7 @@ GEM
95
96
  chronic (0.10.2)
96
97
  codeclimate-test-reporter (0.6.0)
97
98
  simplecov (>= 0.7.1, < 1.0.0)
98
- coderay (1.1.2)
99
+ coderay (1.1.3)
99
100
  concurrent-ruby (1.1.6)
100
101
  console (1.8.2)
101
102
  daemons (1.2.4)
@@ -130,7 +131,7 @@ GEM
130
131
  localhost (1.1.6)
131
132
  mapping (1.1.1)
132
133
  metaclass (0.0.4)
133
- method_source (0.9.0)
134
+ method_source (1.0.0)
134
135
  mini_portile2 (2.4.0)
135
136
  minitest (5.14.1)
136
137
  mocha (1.3.0)
@@ -142,7 +143,7 @@ GEM
142
143
  net-scp (1.2.1)
143
144
  net-ssh (>= 2.6.5)
144
145
  net-ssh (4.2.0)
145
- nio4r (2.5.2)
146
+ nio4r (2.5.4)
146
147
  nokogiri (1.10.9)
147
148
  mini_portile2 (~> 2.4.0)
148
149
  parslet (1.8.2)
@@ -163,22 +164,22 @@ GEM
163
164
  protocol-hpack (~> 1.4)
164
165
  protocol-http (~> 0.15)
165
166
  protocol-redis (0.5.0)
166
- pry (0.11.3)
167
- coderay (~> 1.1.0)
168
- method_source (~> 0.9.0)
167
+ pry (0.14.0)
168
+ coderay (~> 1.1)
169
+ method_source (~> 1.0)
169
170
  pry-byebug (3.5.1)
170
171
  byebug (~> 9.1)
171
172
  pry (~> 0.10)
172
- pry-doc (0.11.1)
173
- pry (~> 0.9)
174
- yard (~> 0.9)
173
+ pry-doc (1.1.0)
174
+ pry (~> 0.11)
175
+ yard (~> 0.9.11)
175
176
  rack (2.1.4)
176
177
  rack-protection (2.0.3)
177
178
  rack
178
179
  rack-test (0.8.2)
179
180
  rack (>= 1.0, < 3)
180
181
  rake (13.0.1)
181
- redis-namespace (1.6.0)
182
+ redis-namespace (1.8.0)
182
183
  redis (>= 3.0.4)
183
184
  resque_spec (0.17.0)
184
185
  resque (>= 1.19.0)
@@ -241,7 +242,7 @@ GEM
241
242
  thread_safe (0.3.6)
242
243
  tilt (2.0.8)
243
244
  timecop (0.9.1)
244
- timers (4.3.0)
245
+ timers (4.3.2)
245
246
  toml (0.2.0)
246
247
  parslet (~> 1.8.0)
247
248
  tzinfo (1.2.7)
@@ -259,7 +260,7 @@ GEM
259
260
  prometheus-client (~> 1.0)
260
261
  yabeda (~> 0.5)
261
262
  yajl-ruby (1.3.1)
262
- yard (0.9.20)
263
+ yard (0.9.26)
263
264
 
264
265
  PLATFORMS
265
266
  ruby
@@ -267,7 +268,7 @@ PLATFORMS
267
268
  DEPENDENCIES
268
269
  airbrake (= 4.3.1)
269
270
  apisonator!
270
- async-redis (~> 0.5)
271
+ async-redis (~> 0.5.1)
271
272
  async-rspec
272
273
  aws-sdk (= 2.4.2)
273
274
  benchmark-ips (~> 2.7.2)
@@ -283,14 +284,15 @@ DEPENDENCIES
283
284
  nokogiri (~> 1.10.8)
284
285
  pg (= 0.20.0)
285
286
  pkg-config (~> 1.1.7)
286
- pry (~> 0.11.3)
287
+ pry (~> 0.14)
287
288
  pry-byebug (~> 3.5.1)
288
- pry-doc (~> 0.11.1)
289
+ pry-doc (~> 1.1)
289
290
  puma!
290
291
  rack (~> 2.1.4)
291
- rack-test (~> 0.8.2)
292
+ rack-test (= 0.8.2)
292
293
  rake (~> 13.0)
293
294
  redis!
295
+ redis-namespace (~> 1.8.0)
294
296
  resque!
295
297
  resque_spec (~> 0.17.0)
296
298
  resque_unit (~> 0.4.4)!
data/Gemfile.on_prem.lock CHANGED
@@ -1,9 +1,10 @@
1
1
  GIT
2
2
  remote: https://github.com/3scale/puma
3
- revision: b034371406690d3e6c2a9301c4a48bd721f3efc3
4
- ref: b034371406690d3e6c2a9301c4a48bd721f3efc3
3
+ revision: c0601d08695839b8ffd0f380e91c3b91c1e8b754
4
+ branch: 3scale-4.3.7
5
5
  specs:
6
- puma (2.15.3)
6
+ puma (4.3.7)
7
+ nio4r (~> 2.0)
7
8
 
8
9
  GIT
9
10
  remote: https://github.com/3scale/redis-rb
@@ -35,7 +36,7 @@ GIT
35
36
  PATH
36
37
  remote: .
37
38
  specs:
38
- apisonator (3.2.0)
39
+ apisonator (3.3.2)
39
40
 
40
41
  GEM
41
42
  remote: https://rubygems.org/
@@ -67,7 +68,7 @@ GEM
67
68
  async (~> 1.14)
68
69
  async-pool (0.2.0)
69
70
  async (~> 1.8)
70
- async-redis (0.5.0)
71
+ async-redis (0.5.1)
71
72
  async (~> 1.8)
72
73
  async-io (~> 1.10)
73
74
  async-pool (~> 0.2)
@@ -85,7 +86,7 @@ GEM
85
86
  byebug (9.1.0)
86
87
  codeclimate-test-reporter (0.6.0)
87
88
  simplecov (>= 0.7.1, < 1.0.0)
88
- coderay (1.1.2)
89
+ coderay (1.1.3)
89
90
  concurrent-ruby (1.1.6)
90
91
  console (1.8.2)
91
92
  daemons (1.2.4)
@@ -119,7 +120,7 @@ GEM
119
120
  localhost (1.1.6)
120
121
  mapping (1.1.1)
121
122
  metaclass (0.0.4)
122
- method_source (0.9.0)
123
+ method_source (1.0.0)
123
124
  mini_portile2 (2.4.0)
124
125
  minitest (5.14.1)
125
126
  mocha (1.3.0)
@@ -131,7 +132,7 @@ GEM
131
132
  net-scp (1.2.1)
132
133
  net-ssh (>= 2.6.5)
133
134
  net-ssh (4.2.0)
134
- nio4r (2.5.2)
135
+ nio4r (2.5.4)
135
136
  nokogiri (1.10.9)
136
137
  mini_portile2 (~> 2.4.0)
137
138
  parslet (1.8.2)
@@ -151,22 +152,22 @@ GEM
151
152
  protocol-hpack (~> 1.4)
152
153
  protocol-http (~> 0.15)
153
154
  protocol-redis (0.5.0)
154
- pry (0.11.3)
155
- coderay (~> 1.1.0)
156
- method_source (~> 0.9.0)
155
+ pry (0.14.0)
156
+ coderay (~> 1.1)
157
+ method_source (~> 1.0)
157
158
  pry-byebug (3.5.1)
158
159
  byebug (~> 9.1)
159
160
  pry (~> 0.10)
160
- pry-doc (0.11.1)
161
- pry (~> 0.9)
162
- yard (~> 0.9)
161
+ pry-doc (1.1.0)
162
+ pry (~> 0.11)
163
+ yard (~> 0.9.11)
163
164
  rack (2.1.4)
164
165
  rack-protection (2.0.3)
165
166
  rack
166
167
  rack-test (0.8.2)
167
168
  rack (>= 1.0, < 3)
168
169
  rake (13.0.1)
169
- redis-namespace (1.6.0)
170
+ redis-namespace (1.8.0)
170
171
  redis (>= 3.0.4)
171
172
  resque_spec (0.17.0)
172
173
  resque (>= 1.19.0)
@@ -227,7 +228,7 @@ GEM
227
228
  thread_safe (0.3.6)
228
229
  tilt (2.0.8)
229
230
  timecop (0.9.1)
230
- timers (4.3.0)
231
+ timers (4.3.2)
231
232
  toml (0.2.0)
232
233
  parslet (~> 1.8.0)
233
234
  tzinfo (1.2.7)
@@ -243,14 +244,14 @@ GEM
243
244
  prometheus-client (~> 1.0)
244
245
  yabeda (~> 0.5)
245
246
  yajl-ruby (1.3.1)
246
- yard (0.9.20)
247
+ yard (0.9.26)
247
248
 
248
249
  PLATFORMS
249
250
  ruby
250
251
 
251
252
  DEPENDENCIES
252
253
  apisonator!
253
- async-redis (~> 0.5)
254
+ async-redis (~> 0.5.1)
254
255
  async-rspec
255
256
  benchmark-ips (~> 2.7.2)
256
257
  bugsnag (~> 6)
@@ -264,14 +265,15 @@ DEPENDENCIES
264
265
  mocha (~> 1.3)
265
266
  nokogiri (~> 1.10.8)
266
267
  pkg-config (~> 1.1.7)
267
- pry (~> 0.11.3)
268
+ pry (~> 0.14)
268
269
  pry-byebug (~> 3.5.1)
269
- pry-doc (~> 0.11.1)
270
+ pry-doc (~> 1.1)
270
271
  puma!
271
272
  rack (~> 2.1.4)
272
- rack-test (~> 0.8.2)
273
+ rack-test (= 0.8.2)
273
274
  rake (~> 13.0)
274
275
  redis!
276
+ redis-namespace (~> 1.8.0)
275
277
  resque!
276
278
  resque_spec (~> 0.17.0)
277
279
  resque_unit (~> 0.4.4)!
data/Rakefile CHANGED
@@ -261,27 +261,49 @@ task :reschedule_failed_jobs do
261
261
  "Pending failed jobs: #{result[:failed_current]}."
262
262
  end
263
263
 
264
- desc 'Delete stats of services marked for deletion'
265
264
  namespace :stats do
265
+ desc 'Delete stats of services marked for deletion'
266
266
  task :cleanup, [:redis_urls, :log_deleted_keys] do |_, args|
267
- redis_urls = args[:redis_urls] && args[:redis_urls].split(' ')
267
+ redis_conns = redis_conns(args[:redis_urls])
268
268
 
269
- if redis_urls.nil? || redis_urls.empty?
269
+ if redis_conns.empty?
270
270
  puts 'No Redis URLs specified'
271
271
  exit(false)
272
272
  end
273
273
 
274
- redis_clients = redis_urls.map do |redis_url|
275
- parsed_uri = URI.parse(ThreeScale::Backend::Storage::Helpers.send(
276
- :to_redis_uri, redis_url)
277
- )
278
- Redis.new(host: parsed_uri.host, port: parsed_uri.port)
274
+ ThreeScale::Backend::Stats::Cleaner.delete!(
275
+ redis_conns, log_deleted_keys: logger_for_deleted_keys(args[:log_deleted_keys])
276
+ )
277
+ end
278
+
279
+ desc 'Delete stats keys set to 0'
280
+ task :delete_stats_keys_set_to_0, [:redis_urls, :log_deleted_keys] do |_, args|
281
+ redis_conns = redis_conns(args[:redis_urls])
282
+
283
+ if redis_conns.empty?
284
+ puts 'No Redis URLs specified'
285
+ exit(false)
279
286
  end
280
287
 
281
- log_deleted = args[:log_deleted_keys] == 'true' ? STDOUT : nil
288
+ ThreeScale::Backend::Stats::Cleaner.delete_stats_keys_set_to_0(
289
+ redis_conns, log_deleted_keys: logger_for_deleted_keys(args[:log_deleted_keys])
290
+ )
291
+ end
292
+ end
282
293
 
283
- ThreeScale::Backend::Stats::Cleaner.delete!(
284
- redis_clients, log_deleted_keys: log_deleted
294
+ def redis_conns(urls)
295
+ redis_urls = urls && urls.split(' ')
296
+
297
+ return [] if redis_urls.nil? || redis_urls.empty?
298
+
299
+ redis_urls.map do |redis_url|
300
+ parsed_uri = URI.parse(ThreeScale::Backend::Storage::Helpers.send(
301
+ :to_redis_uri, redis_url)
285
302
  )
303
+ Redis.new(host: parsed_uri.host, port: parsed_uri.port)
286
304
  end
287
305
  end
306
+
307
+ def logger_for_deleted_keys(arg_log_deleted_keys)
308
+ arg_log_deleted_keys == 'true' ? STDOUT : nil
309
+ end