heroku_hatchet 4.0.0 → 4.0.1
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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/hatchet/api_rate_limit.rb +1 -1
- data/lib/hatchet/app.rb +8 -5
- data/lib/hatchet/test_run.rb +5 -0
- data/lib/hatchet/version.rb +1 -1
- 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: c8c96b7abf1268588dab46ad3ac1047df8420dd0835adb7414f05805526e1fb3
|
4
|
+
data.tar.gz: 0d68e35be7b4bbd23e2d48ee6dc0a178e90a90230bebf88354672011788988bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c4eaf334f446527a1d16904f5e6e61649bfeca7999b0b6e20f099795527f8db0c473700a0e5df393a016ca2e98cb1ab1514e01c58860241cedbb9625f1c31e20
|
7
|
+
data.tar.gz: 5edd405fe8bb11ab24dc0384655f05140033f5367d6e57836ac35f29f52d10b6dda3f90a0cd1a8123ce112f346b776e7026fae70d0c557d6190a0610df62e64d
|
data/CHANGELOG.md
CHANGED
@@ -23,7 +23,7 @@ class ApiRateLimit
|
|
23
23
|
# Unfortunatley `@platform_api.rate_limit` is an extra API
|
24
24
|
# call, so by checking our limit, we also are using our limit 😬
|
25
25
|
# to partially mitigate this, only check capacity every 5
|
26
|
-
# api calls, or if the
|
26
|
+
# api calls, or if the current capacity is under 1000
|
27
27
|
def call
|
28
28
|
@called += 1
|
29
29
|
|
data/lib/hatchet/app.rb
CHANGED
@@ -236,11 +236,14 @@ module Hatchet
|
|
236
236
|
|
237
237
|
# create_app
|
238
238
|
# platform_api.pipeline_coupling.create(app: name, pipeline: @pipeline_id, stage: "development")
|
239
|
-
test_run = TestRun.new(
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
239
|
+
test_run = TestRun.new(
|
240
|
+
token: api_key,
|
241
|
+
buildpacks: @buildpacks,
|
242
|
+
timeout: timeout,
|
243
|
+
app: self,
|
244
|
+
pipeline: @pipeline_id,
|
245
|
+
api_rate_limit: api_rate_limit
|
246
|
+
)
|
244
247
|
|
245
248
|
Hatchet::RETRIES.times.retry do
|
246
249
|
test_run.create_test_run
|
data/lib/hatchet/test_run.rb
CHANGED
@@ -22,6 +22,7 @@ module Hatchet
|
|
22
22
|
buildpacks:,
|
23
23
|
app:,
|
24
24
|
pipeline:,
|
25
|
+
api_rate_limit:,
|
25
26
|
timeout: 10,
|
26
27
|
pause: 5,
|
27
28
|
commit_sha: "sha",
|
@@ -41,6 +42,7 @@ module Hatchet
|
|
41
42
|
@app = app
|
42
43
|
@mutex = Mutex.new
|
43
44
|
@status = false
|
45
|
+
@api_rate_limit = api_rate_limit
|
44
46
|
end
|
45
47
|
attr_reader :app
|
46
48
|
|
@@ -164,6 +166,7 @@ module Hatchet
|
|
164
166
|
|
165
167
|
source_put_url = @app.create_source
|
166
168
|
Hatchet::RETRIES.times.retry do
|
169
|
+
@api_rate_limit.call
|
167
170
|
Excon.put(source_put_url,
|
168
171
|
expects: [200],
|
169
172
|
body: File.read('slug.tgz'))
|
@@ -174,6 +177,7 @@ module Hatchet
|
|
174
177
|
|
175
178
|
private
|
176
179
|
def get_contents_or_whatever(url)
|
180
|
+
@api_rate_limit.call
|
177
181
|
Excon.get(url, read_timeout: @pause).body
|
178
182
|
rescue Excon::Error::Timeout
|
179
183
|
""
|
@@ -197,6 +201,7 @@ module Hatchet
|
|
197
201
|
options[:body] = JSON.generate(options[:body]) if options[:body]
|
198
202
|
|
199
203
|
Hatchet::RETRIES.times.retry do
|
204
|
+
@api_rate_limit.call
|
200
205
|
connection = Excon.new("https://api.heroku.com")
|
201
206
|
return connection.request(options)
|
202
207
|
end
|
data/lib/hatchet/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: heroku_hatchet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Schneeman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-06-
|
11
|
+
date: 2018-06-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: platform-api
|