knapsack_pro 2.4.0 → 2.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -0
- data/README.md +2 -0
- data/lib/knapsack_pro/client/connection.rb +7 -2
- data/lib/knapsack_pro/crypto/branch_encryptor.rb +2 -0
- data/lib/knapsack_pro/version.rb +1 -1
- data/spec/knapsack_pro/client/connection_spec.rb +83 -83
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b4167b51e7f0af27a7d1482efb7a6c019f9aa99dd849f9488e47c4a33b5bd943
|
4
|
+
data.tar.gz: fff1d5e557813cd2829298c422d4ffae857e047d27aa001cf746a516270d9259
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd9b442c01b5b58b295e6fc36d3879ddbf97b8770d4f96243f594f225ef3f73e23e75555cfba7adb6439dd5afa39a38ea756e5758628eed54c9305a12bd8b716
|
7
|
+
data.tar.gz: 7401c76f35ce8485a7dc8dc5742514803c8a045d7f431899b32aaa4795433b723b68e554386b7670abb367b1f9dfde2be9e4bc8b661ead354dbab366b56c1705
|
data/CHANGELOG.md
CHANGED
@@ -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
|
-
|
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)
|
data/lib/knapsack_pro/version.rb
CHANGED
@@ -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
|
90
|
-
expect(logger).to receive(:warn).with("
|
91
|
-
expect(logger).to receive(:warn).with("
|
92
|
-
expect(logger).to receive(:warn).with("
|
93
|
-
expect(logger).to receive(:warn).with("
|
94
|
-
expect(logger).to receive(:warn).with("
|
95
|
-
expect(logger).to receive(:warn).with("
|
96
|
-
expect(logger).to receive(:warn).with("
|
97
|
-
expect(logger).to receive(:warn).with("
|
98
|
-
expect(logger).to receive(:warn).with("
|
99
|
-
expect(logger).to receive(:warn).with("
|
100
|
-
expect(logger).to receive(:warn).with("
|
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
|
129
|
-
expect(logger).to receive(:warn).with("
|
130
|
-
expect(logger).to receive(:warn).with("
|
131
|
-
expect(logger).to receive(:warn).with("
|
132
|
-
|
133
|
-
|
134
|
-
expect(logger).to receive(:warn).with("
|
135
|
-
expect(logger).to receive(:warn).with("
|
136
|
-
expect(logger).to receive(:warn).with("
|
137
|
-
expect(logger).to receive(:warn).with("
|
138
|
-
expect(logger).to receive(:warn).with("
|
139
|
-
expect(logger).to receive(:warn).with("
|
140
|
-
expect(logger).to receive(:warn).with("
|
141
|
-
|
142
|
-
expect(logger).to receive(:warn).with("
|
143
|
-
|
144
|
-
|
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
|
176
|
-
expect(logger).to receive(:warn).with("
|
177
|
-
expect(logger).to receive(:warn).with("
|
178
|
-
expect(logger).to receive(:warn).with("
|
179
|
-
|
180
|
-
|
181
|
-
expect(logger).to receive(:warn).with("
|
182
|
-
expect(logger).to receive(:warn).with("
|
183
|
-
expect(logger).to receive(:warn).with("
|
184
|
-
expect(logger).to receive(:warn).with("
|
185
|
-
expect(logger).to receive(:warn).with("
|
186
|
-
expect(logger).to receive(:warn).with("
|
187
|
-
expect(logger).to receive(:warn).with("
|
188
|
-
|
189
|
-
expect(logger).to receive(:warn).with("
|
190
|
-
|
191
|
-
|
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
|
197
|
-
|
198
|
-
expect(logger).to receive(:warn).with("
|
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
|
202
|
-
|
203
|
-
expect(logger).to receive(:warn).with("
|
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
|
233
|
-
expect(logger).to receive(:warn).with("
|
234
|
-
expect(logger).to receive(:warn).with("
|
235
|
-
expect(logger).to receive(:warn).with("
|
236
|
-
|
237
|
-
|
238
|
-
expect(logger).to receive(:warn).with("
|
239
|
-
expect(logger).to receive(:warn).with("
|
240
|
-
expect(logger).to receive(:warn).with("
|
241
|
-
expect(logger).to receive(:warn).with("
|
242
|
-
expect(logger).to receive(:warn).with("
|
243
|
-
expect(logger).to receive(:warn).with("
|
244
|
-
expect(logger).to receive(:warn).with("
|
245
|
-
|
246
|
-
expect(logger).to receive(:warn).with("
|
247
|
-
|
248
|
-
|
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
|
254
|
-
|
255
|
-
expect(logger).to receive(:warn).with("
|
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
|
259
|
-
|
260
|
-
expect(logger).to receive(:warn).with("
|
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
|
+
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-
|
11
|
+
date: 2020-09-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|