knapsack_pro 2.4.0 → 2.6.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: be2eb19b6bc60ed03791ae1fd85b0893d85a42f96be0a584f7774174572e4982
4
- data.tar.gz: e500f47322535c432f3cc89eed024708cf5e9e66162cecf3af5e6793d90a6794
3
+ metadata.gz: b4167b51e7f0af27a7d1482efb7a6c019f9aa99dd849f9488e47c4a33b5bd943
4
+ data.tar.gz: fff1d5e557813cd2829298c422d4ffae857e047d27aa001cf746a516270d9259
5
5
  SHA512:
6
- metadata.gz: 2303b72bfe98c25b1b7ec464f0632ce80ae20233457d990c0f92755fff63173bfad4da9dd2f9dc12873892c5157919cdd618d9b3999bef82f46242758bbc18b7
7
- data.tar.gz: f3f49a0618a13876aaec016e3458a673a4a1ce7a6fb168f8f44409c10d00791a8e2e8c4c542f6c015951d4bcb17c2052e613dcbba69cf898f1d653818ce3eca1
6
+ metadata.gz: fd9b442c01b5b58b295e6fc36d3879ddbf97b8770d4f96243f594f225ef3f73e23e75555cfba7adb6439dd5afa39a38ea756e5758628eed54c9305a12bd8b716
7
+ data.tar.gz: 7401c76f35ce8485a7dc8dc5742514803c8a045d7f431899b32aaa4795433b723b68e554386b7670abb367b1f9dfde2be9e4bc8b661ead354dbab366b56c1705
@@ -1,5 +1,21 @@
1
1
  # Change Log
2
2
 
3
+ ### 2.6.0
4
+
5
+ * Improve logger to show failed requests URL and when retry will happen
6
+
7
+ https://github.com/KnapsackPro/knapsack_pro-ruby/pull/127
8
+
9
+ https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v2.5.0...v2.6.0
10
+
11
+ ### 2.5.0
12
+
13
+ * Add production branch to non encryptable branches names
14
+
15
+ https://github.com/KnapsackPro/knapsack_pro-ruby/pull/126
16
+
17
+ https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v2.4.0...v2.5.0
18
+
3
19
  ### 2.4.0
4
20
 
5
21
  * Update list of non encryptable branches
data/README.md CHANGED
@@ -3258,6 +3258,8 @@ $ gem build knapsack_pro.gemspec
3258
3258
  $ gem push knapsack_pro-X.X.X.gem
3259
3259
  ```
3260
3260
 
3261
+ Update the latest available gem version in `TestSuiteClientVersionChecker` for the Knapsack Pro API repository.
3262
+
3261
3263
  ## Mentions
3262
3264
 
3263
3265
  List of articles where people mentioned Knapsack Pro:
@@ -115,14 +115,19 @@ module KnapsackPro
115
115
 
116
116
  response_body
117
117
  rescue ServerError, Errno::ECONNREFUSED, Errno::ETIMEDOUT, Errno::EPIPE, EOFError, SocketError, Net::OpenTimeout, Net::ReadTimeout, OpenSSL::SSL::SSLError => e
118
+ logger.warn("#{action.http_method.to_s.upcase} #{endpoint_url}")
119
+ logger.warn('Request failed due to:')
118
120
  logger.warn(e.inspect)
119
121
  retries += 1
120
122
  if retries < max_request_retries
121
123
  wait = retries * REQUEST_RETRY_TIMEBOX
122
- logger.warn("Wait #{wait}s and retry request to Knapsack Pro API.")
123
124
  print_every = 2 # seconds
124
125
  (wait / print_every).ceil.times do |i|
125
- logger.warn("Next request in #{wait - i * print_every}s...")
126
+ if i == 0
127
+ logger.warn("Wait for #{wait}s before retrying the request to Knapsack Pro API.")
128
+ else
129
+ logger.warn("#{wait - i * print_every}s left before retry...")
130
+ end
126
131
  Kernel.sleep(print_every)
127
132
  end
128
133
  retry
@@ -8,6 +8,7 @@ module KnapsackPro
8
8
  'development',
9
9
  'dev',
10
10
  'staging',
11
+ 'production',
11
12
  # GitHub Actions has branch names starting with refs/heads/
12
13
  'refs/heads/master',
13
14
  'refs/heads/main',
@@ -15,6 +16,7 @@ module KnapsackPro
15
16
  'refs/heads/development',
16
17
  'refs/heads/dev',
17
18
  'refs/heads/staging',
19
+ 'refs/heads/production',
18
20
  ]
19
21
 
20
22
  def self.call(branch)
@@ -1,3 +1,3 @@
1
1
  module KnapsackPro
2
- VERSION = '2.4.0'
2
+ VERSION = '2.6.0'
3
3
  end
@@ -84,22 +84,22 @@ shared_examples 'when retry request' do
84
84
  expect(logger).to receive(:error).exactly(3).with(parsed_response)
85
85
 
86
86
  server_error = described_class::ServerError.new(parsed_response)
87
+ expect(logger).to receive(:warn).exactly(3).with("#{expected_http_method} http://api.knapsackpro.test:3000/v1/fake_endpoint")
88
+ expect(logger).to receive(:warn).exactly(3).with('Request failed due to:')
87
89
  expect(logger).to receive(:warn).exactly(3).with(server_error.inspect)
88
90
 
89
- expect(logger).to receive(:warn).with("Wait 8s and retry request to Knapsack Pro API.")
90
- expect(logger).to receive(:warn).with("Next request in 8s...")
91
- expect(logger).to receive(:warn).with("Next request in 6s...")
92
- expect(logger).to receive(:warn).with("Next request in 4s...")
93
- expect(logger).to receive(:warn).with("Next request in 2s...")
94
- expect(logger).to receive(:warn).with("Wait 16s and retry request to Knapsack Pro API.")
95
- expect(logger).to receive(:warn).with("Next request in 16s...")
96
- expect(logger).to receive(:warn).with("Next request in 14s...")
97
- expect(logger).to receive(:warn).with("Next request in 12s...")
98
- expect(logger).to receive(:warn).with("Next request in 10s...")
99
- expect(logger).to receive(:warn).with("Next request in 8s...")
100
- expect(logger).to receive(:warn).with("Next request in 6s...")
101
- expect(logger).to receive(:warn).with("Next request in 4s...")
102
- expect(logger).to receive(:warn).with("Next request in 2s...")
91
+ expect(logger).to receive(:warn).with("Wait for 8s before retrying the request to Knapsack Pro API.")
92
+ expect(logger).to receive(:warn).with("6s left before retry...")
93
+ expect(logger).to receive(:warn).with("4s left before retry...")
94
+ expect(logger).to receive(:warn).with("2s left before retry...")
95
+ expect(logger).to receive(:warn).with("Wait for 16s before retrying the request to Knapsack Pro API.")
96
+ expect(logger).to receive(:warn).with("14s left before retry...")
97
+ expect(logger).to receive(:warn).with("12s left before retry...")
98
+ expect(logger).to receive(:warn).with("10s left before retry...")
99
+ expect(logger).to receive(:warn).with("8s left before retry...")
100
+ expect(logger).to receive(:warn).with("6s left before retry...")
101
+ expect(logger).to receive(:warn).with("4s left before retry...")
102
+ expect(logger).to receive(:warn).with("2s left before retry...")
103
103
  expect(Kernel).to receive(:sleep).exactly(12).with(2)
104
104
 
105
105
  expect(subject).to eq(parsed_response)
@@ -123,27 +123,27 @@ shared_examples 'when retry request' do
123
123
  expect(logger).to receive(:error).exactly(4).with(parsed_response)
124
124
 
125
125
  server_error = described_class::ServerError.new(parsed_response)
126
+ expect(logger).to receive(:warn).exactly(4).with("#{expected_http_method} http://api.knapsackpro.test:3000/v1/fake_endpoint")
127
+ expect(logger).to receive(:warn).exactly(4).with('Request failed due to:')
126
128
  expect(logger).to receive(:warn).exactly(4).with(server_error.inspect)
127
129
 
128
- expect(logger).to receive(:warn).with("Wait 8s and retry request to Knapsack Pro API.")
129
- expect(logger).to receive(:warn).with("Next request in 8s...")
130
- expect(logger).to receive(:warn).with("Next request in 6s...")
131
- expect(logger).to receive(:warn).with("Next request in 4s...")
132
- expect(logger).to receive(:warn).with("Next request in 2s...")
133
-
134
- expect(logger).to receive(:warn).with("Wait 16s and retry request to Knapsack Pro API.")
135
- expect(logger).to receive(:warn).with("Next request in 16s...")
136
- expect(logger).to receive(:warn).with("Next request in 14s...")
137
- expect(logger).to receive(:warn).with("Next request in 12s...")
138
- expect(logger).to receive(:warn).with("Next request in 10s...")
139
- expect(logger).to receive(:warn).with("Next request in 8s...")
140
- expect(logger).to receive(:warn).with("Next request in 6s...")
141
- expect(logger).to receive(:warn).with("Next request in 4s...")
142
- expect(logger).to receive(:warn).with("Next request in 2s...")
143
-
144
- expect(logger).to receive(:warn).with("Wait 24s and retry request to Knapsack Pro API.")
145
- 12.times do |i|
146
- expect(logger).to receive(:warn).with("Next request in #{(i+1)*2}s...")
130
+ expect(logger).to receive(:warn).with("Wait for 8s before retrying the request to Knapsack Pro API.")
131
+ expect(logger).to receive(:warn).with("6s left before retry...")
132
+ expect(logger).to receive(:warn).with("4s left before retry...")
133
+ expect(logger).to receive(:warn).with("2s left before retry...")
134
+
135
+ expect(logger).to receive(:warn).with("Wait for 16s before retrying the request to Knapsack Pro API.")
136
+ expect(logger).to receive(:warn).with("14s left before retry...")
137
+ expect(logger).to receive(:warn).with("12s left before retry...")
138
+ expect(logger).to receive(:warn).with("10s left before retry...")
139
+ expect(logger).to receive(:warn).with("8s left before retry...")
140
+ expect(logger).to receive(:warn).with("6s left before retry...")
141
+ expect(logger).to receive(:warn).with("4s left before retry...")
142
+ expect(logger).to receive(:warn).with("2s left before retry...")
143
+
144
+ expect(logger).to receive(:warn).with("Wait for 24s before retrying the request to Knapsack Pro API.")
145
+ 11.times do |i|
146
+ expect(logger).to receive(:warn).with("#{(i+1)*2}s left before retry...")
147
147
  end
148
148
 
149
149
  expect(Kernel).to receive(:sleep).exactly(4+8+12).with(2)
@@ -170,37 +170,37 @@ shared_examples 'when retry request' do
170
170
  expect(logger).to receive(:error).exactly(6).with(parsed_response)
171
171
 
172
172
  server_error = described_class::ServerError.new(parsed_response)
173
+ expect(logger).to receive(:warn).exactly(6).with("#{expected_http_method} http://api.knapsackpro.test:3000/v1/fake_endpoint")
174
+ expect(logger).to receive(:warn).exactly(6).with('Request failed due to:')
173
175
  expect(logger).to receive(:warn).exactly(6).with(server_error.inspect)
174
176
 
175
- expect(logger).to receive(:warn).with("Wait 8s and retry request to Knapsack Pro API.")
176
- expect(logger).to receive(:warn).with("Next request in 8s...")
177
- expect(logger).to receive(:warn).with("Next request in 6s...")
178
- expect(logger).to receive(:warn).with("Next request in 4s...")
179
- expect(logger).to receive(:warn).with("Next request in 2s...")
180
-
181
- expect(logger).to receive(:warn).with("Wait 16s and retry request to Knapsack Pro API.")
182
- expect(logger).to receive(:warn).with("Next request in 16s...")
183
- expect(logger).to receive(:warn).with("Next request in 14s...")
184
- expect(logger).to receive(:warn).with("Next request in 12s...")
185
- expect(logger).to receive(:warn).with("Next request in 10s...")
186
- expect(logger).to receive(:warn).with("Next request in 8s...")
187
- expect(logger).to receive(:warn).with("Next request in 6s...")
188
- expect(logger).to receive(:warn).with("Next request in 4s...")
189
- expect(logger).to receive(:warn).with("Next request in 2s...")
190
-
191
- expect(logger).to receive(:warn).with("Wait 24s and retry request to Knapsack Pro API.")
192
- 12.times do |i|
193
- expect(logger).to receive(:warn).with("Next request in #{(i+1)*2}s...")
177
+ expect(logger).to receive(:warn).with("Wait for 8s before retrying the request to Knapsack Pro API.")
178
+ expect(logger).to receive(:warn).with("6s left before retry...")
179
+ expect(logger).to receive(:warn).with("4s left before retry...")
180
+ expect(logger).to receive(:warn).with("2s left before retry...")
181
+
182
+ expect(logger).to receive(:warn).with("Wait for 16s before retrying the request to Knapsack Pro API.")
183
+ expect(logger).to receive(:warn).with("14s left before retry...")
184
+ expect(logger).to receive(:warn).with("12s left before retry...")
185
+ expect(logger).to receive(:warn).with("10s left before retry...")
186
+ expect(logger).to receive(:warn).with("8s left before retry...")
187
+ expect(logger).to receive(:warn).with("6s left before retry...")
188
+ expect(logger).to receive(:warn).with("4s left before retry...")
189
+ expect(logger).to receive(:warn).with("2s left before retry...")
190
+
191
+ expect(logger).to receive(:warn).with("Wait for 24s before retrying the request to Knapsack Pro API.")
192
+ 11.times do |i|
193
+ expect(logger).to receive(:warn).with("#{(i+1)*2}s left before retry...")
194
194
  end
195
195
 
196
- expect(logger).to receive(:warn).with("Wait 32s and retry request to Knapsack Pro API.")
197
- 16.times do |i|
198
- expect(logger).to receive(:warn).with("Next request in #{(i+1)*2}s...")
196
+ expect(logger).to receive(:warn).with("Wait for 32s before retrying the request to Knapsack Pro API.")
197
+ 15.times do |i|
198
+ expect(logger).to receive(:warn).with("#{(i+1)*2}s left before retry...")
199
199
  end
200
200
 
201
- expect(logger).to receive(:warn).with("Wait 40s and retry request to Knapsack Pro API.")
202
- 20.times do |i|
203
- expect(logger).to receive(:warn).with("Next request in #{(i+1)*2}s...")
201
+ expect(logger).to receive(:warn).with("Wait for 40s before retrying the request to Knapsack Pro API.")
202
+ 19.times do |i|
203
+ expect(logger).to receive(:warn).with("#{(i+1)*2}s left before retry...")
204
204
  end
205
205
 
206
206
  expect(Kernel).to receive(:sleep).exactly(60).with(2)
@@ -227,37 +227,37 @@ shared_examples 'when retry request' do
227
227
  expect(logger).to receive(:error).exactly(6).with(parsed_response)
228
228
 
229
229
  server_error = described_class::ServerError.new(parsed_response)
230
+ expect(logger).to receive(:warn).exactly(6).with("#{expected_http_method} http://api.knapsackpro.test:3000/v1/fake_endpoint")
231
+ expect(logger).to receive(:warn).exactly(6).with('Request failed due to:')
230
232
  expect(logger).to receive(:warn).exactly(6).with(server_error.inspect)
231
233
 
232
- expect(logger).to receive(:warn).with("Wait 8s and retry request to Knapsack Pro API.")
233
- expect(logger).to receive(:warn).with("Next request in 8s...")
234
- expect(logger).to receive(:warn).with("Next request in 6s...")
235
- expect(logger).to receive(:warn).with("Next request in 4s...")
236
- expect(logger).to receive(:warn).with("Next request in 2s...")
237
-
238
- expect(logger).to receive(:warn).with("Wait 16s and retry request to Knapsack Pro API.")
239
- expect(logger).to receive(:warn).with("Next request in 16s...")
240
- expect(logger).to receive(:warn).with("Next request in 14s...")
241
- expect(logger).to receive(:warn).with("Next request in 12s...")
242
- expect(logger).to receive(:warn).with("Next request in 10s...")
243
- expect(logger).to receive(:warn).with("Next request in 8s...")
244
- expect(logger).to receive(:warn).with("Next request in 6s...")
245
- expect(logger).to receive(:warn).with("Next request in 4s...")
246
- expect(logger).to receive(:warn).with("Next request in 2s...")
247
-
248
- expect(logger).to receive(:warn).with("Wait 24s and retry request to Knapsack Pro API.")
249
- 12.times do |i|
250
- expect(logger).to receive(:warn).with("Next request in #{(i+1)*2}s...")
234
+ expect(logger).to receive(:warn).with("Wait for 8s before retrying the request to Knapsack Pro API.")
235
+ expect(logger).to receive(:warn).with("6s left before retry...")
236
+ expect(logger).to receive(:warn).with("4s left before retry...")
237
+ expect(logger).to receive(:warn).with("2s left before retry...")
238
+
239
+ expect(logger).to receive(:warn).with("Wait for 16s before retrying the request to Knapsack Pro API.")
240
+ expect(logger).to receive(:warn).with("14s left before retry...")
241
+ expect(logger).to receive(:warn).with("12s left before retry...")
242
+ expect(logger).to receive(:warn).with("10s left before retry...")
243
+ expect(logger).to receive(:warn).with("8s left before retry...")
244
+ expect(logger).to receive(:warn).with("6s left before retry...")
245
+ expect(logger).to receive(:warn).with("4s left before retry...")
246
+ expect(logger).to receive(:warn).with("2s left before retry...")
247
+
248
+ expect(logger).to receive(:warn).with("Wait for 24s before retrying the request to Knapsack Pro API.")
249
+ 11.times do |i|
250
+ expect(logger).to receive(:warn).with("#{(i+1)*2}s left before retry...")
251
251
  end
252
252
 
253
- expect(logger).to receive(:warn).with("Wait 32s and retry request to Knapsack Pro API.")
254
- 16.times do |i|
255
- expect(logger).to receive(:warn).with("Next request in #{(i+1)*2}s...")
253
+ expect(logger).to receive(:warn).with("Wait for 32s before retrying the request to Knapsack Pro API.")
254
+ 15.times do |i|
255
+ expect(logger).to receive(:warn).with("#{(i+1)*2}s left before retry...")
256
256
  end
257
257
 
258
- expect(logger).to receive(:warn).with("Wait 40s and retry request to Knapsack Pro API.")
259
- 20.times do |i|
260
- expect(logger).to receive(:warn).with("Next request in #{(i+1)*2}s...")
258
+ expect(logger).to receive(:warn).with("Wait for 40s before retrying the request to Knapsack Pro API.")
259
+ 19.times do |i|
260
+ expect(logger).to receive(:warn).with("#{(i+1)*2}s left before retry...")
261
261
  end
262
262
 
263
263
  expect(Kernel).to receive(:sleep).exactly(60).with(2)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knapsack_pro
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0
4
+ version: 2.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ArturT
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-17 00:00:00.000000000 Z
11
+ date: 2020-09-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake