cfhighlander 0.13.7 → 0.13.8
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/README.md +6 -0
- data/lib/cfhighlander.factory.templatefinder.rb +32 -1
- data/lib/cfhighlander.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: 9e99bfdd32db2b3787a3ff8df606c22a7e96b20b09abcc2d5b6dfeee96777a9b
|
|
4
|
+
data.tar.gz: fa14fff206c44be0d5f852f656d84d9efdf77920f415a752ee9486271ee33c5a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e9d26a287eeb4da12dde26b51542a95ac82aeeee7f67cdada3ca05098503ddf48c5cd62ff05f631b5ffd47e8967b1a570fe8168c8a3b7acc82cf42ff85a79a58
|
|
7
|
+
data.tar.gz: 0d2b98c38cb3940992dc94f2c3cab6027c02f8413acacdff03c27d2927f374f6d265cfc62ca2eeae728c378ed86cb8552fef05623c226cc58e8a24fb2e8f7f72
|
data/README.md
CHANGED
|
@@ -987,6 +987,12 @@ generated files are placed
|
|
|
987
987
|
`CFHIGHLANDER_AWS_RETRY_LIMIT` - defaults to 10. Number of retries for AWS SDK before giving up.
|
|
988
988
|
AWS SDK uses exponential backoff to make the API calls
|
|
989
989
|
|
|
990
|
+
`CFHIGHLANDER_COMPONENT_FETCH_RETRIES` - defaults to 3. Number of retries when fetching a
|
|
991
|
+
component from git before giving up. Uses exponential backoff between attempts.
|
|
992
|
+
|
|
993
|
+
`CFHIGHLANDER_COMPONENT_FETCH_RETRY_DELAY` - defaults to 1. Base delay in seconds used for the
|
|
994
|
+
exponential backoff between component fetch retries (delay doubles with each retry).
|
|
995
|
+
|
|
990
996
|
|
|
991
997
|
|
|
992
998
|
## Testing components
|
|
@@ -73,7 +73,24 @@ module Cfhighlander
|
|
|
73
73
|
puts "Trying to load #{component_name}/#{component_version} from #{git_url}##{branch} ... "
|
|
74
74
|
clone_opts = { depth: 1 }
|
|
75
75
|
clone_opts[:branch] = branch if not (branch.nil? or branch.empty?)
|
|
76
|
-
|
|
76
|
+
|
|
77
|
+
max_retries = parse_non_negative_int(ENV['CFHIGHLANDER_COMPONENT_FETCH_RETRIES'], 3)
|
|
78
|
+
retry_delay = parse_non_negative_int(ENV['CFHIGHLANDER_COMPONENT_FETCH_RETRY_DELAY'], 1)
|
|
79
|
+
|
|
80
|
+
attempt = 0
|
|
81
|
+
begin
|
|
82
|
+
Git.clone git_url, cache_path, clone_opts
|
|
83
|
+
rescue StandardError => clone_error
|
|
84
|
+
attempt += 1
|
|
85
|
+
if attempt <= max_retries
|
|
86
|
+
delay = retry_delay * (2**(attempt - 1))
|
|
87
|
+
STDERR.puts "Component fetch failed (attempt #{attempt}/#{max_retries}), retrying in #{delay}s: #{clone_error}"
|
|
88
|
+
sleep delay
|
|
89
|
+
retry
|
|
90
|
+
else
|
|
91
|
+
raise clone_error
|
|
92
|
+
end
|
|
93
|
+
end
|
|
77
94
|
puts "\t .. cached in #{cache_path}\n"
|
|
78
95
|
# return from cache once it's cloned
|
|
79
96
|
return findTemplateGit(cache_path, component_name, component_version, git_url, branch)
|
|
@@ -247,6 +264,20 @@ module Cfhighlander
|
|
|
247
264
|
template_location: template_location)
|
|
248
265
|
end
|
|
249
266
|
|
|
267
|
+
private
|
|
268
|
+
|
|
269
|
+
# Parses a value (typically from an env var) as a non-negative integer,
|
|
270
|
+
# falling back to the given default when the value is nil, empty,
|
|
271
|
+
# non-numeric or negative.
|
|
272
|
+
def parse_non_negative_int(value, default)
|
|
273
|
+
return default if value.nil? || value.to_s.strip.empty?
|
|
274
|
+
|
|
275
|
+
parsed = Integer(value)
|
|
276
|
+
parsed >= 0 ? parsed : default
|
|
277
|
+
rescue ArgumentError, TypeError
|
|
278
|
+
default
|
|
279
|
+
end
|
|
280
|
+
|
|
250
281
|
end
|
|
251
282
|
|
|
252
283
|
end
|
data/lib/cfhighlander.version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cfhighlander
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.13.
|
|
4
|
+
version: 0.13.8
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Nikola Tosic
|
|
@@ -10,7 +10,7 @@ authors:
|
|
|
10
10
|
autorequire:
|
|
11
11
|
bindir: bin
|
|
12
12
|
cert_chain: []
|
|
13
|
-
date:
|
|
13
|
+
date: 2026-09-08 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: highline
|