emerge 0.7.7 → 0.7.10
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/lib/commands/upload/build.rb +3 -1
- data/lib/commands/upload/snapshots/snapshots.rb +4 -2
- data/lib/utils/network.rb +16 -4
- data/lib/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ec85fd3665d24bb53ef1dfcc3bfa6d1d6ecb0fafe31326f701125206d4ecc08a
|
|
4
|
+
data.tar.gz: 37827fe1ba2c4bca6da93bfe4c0215197dfd97625fc7db7a4626413595cdc4d5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dcb8dae73cb8ad4da39d1ae9b4a98b1e11df56f553d623a6d61f5b10149588bf19d85449ed2ce8119e399caf177c9f001517746dd4b1506fd6def6dc43ee6ece
|
|
7
|
+
data.tar.gz: dfa64c0413b182e2261056446afbe829dc1e92df7ca88a58e6bcb8bff6f87fd3a1f962bfd03abdd40a8a8cff4cc31c8f86ec842fc84c847dd6bf15e2b9d2d486
|
|
@@ -23,6 +23,7 @@ module EmergeCLI
|
|
|
23
23
|
option :base_sha, type: :string, required: false, desc: 'Base SHA'
|
|
24
24
|
option :previous_sha, type: :string, required: false, desc: 'Previous SHA'
|
|
25
25
|
option :pr_number, type: :string, required: false, desc: 'PR number'
|
|
26
|
+
option :tag, type: :string, required: false, desc: 'Tag to associate with this build'
|
|
26
27
|
|
|
27
28
|
def initialize(network: nil, git_info_provider: nil)
|
|
28
29
|
@network = network
|
|
@@ -102,7 +103,8 @@ module EmergeCLI
|
|
|
102
103
|
# Optional
|
|
103
104
|
base_sha:,
|
|
104
105
|
previous_sha:,
|
|
105
|
-
pr_number: pr_number&.to_s
|
|
106
|
+
pr_number: pr_number&.to_s,
|
|
107
|
+
tag: @options[:tag]
|
|
106
108
|
}.compact
|
|
107
109
|
|
|
108
110
|
upload_response = @network.post(
|
|
@@ -27,6 +27,7 @@ module EmergeCLI
|
|
|
27
27
|
option :base_sha, type: :string, required: false, desc: 'Base SHA'
|
|
28
28
|
option :previous_sha, type: :string, required: false, desc: 'Previous SHA'
|
|
29
29
|
option :pr_number, type: :string, required: false, desc: 'PR number'
|
|
30
|
+
option :tag, type: :string, required: false, desc: 'Tag to associate with this snapshot run'
|
|
30
31
|
option :concurrency, type: :integer, default: 5,
|
|
31
32
|
desc: 'Number of concurrency for parallel image uploads when not using batch mode'
|
|
32
33
|
|
|
@@ -178,7 +179,8 @@ module EmergeCLI
|
|
|
178
179
|
# Optional
|
|
179
180
|
base_sha:,
|
|
180
181
|
previous_sha:,
|
|
181
|
-
pr_number: pr_number&.to_s
|
|
182
|
+
pr_number: pr_number&.to_s,
|
|
183
|
+
tag: @options[:tag]
|
|
182
184
|
}.compact
|
|
183
185
|
|
|
184
186
|
response = @network.post(path: '/v1/snapshots/run', body: payload)
|
|
@@ -262,7 +264,7 @@ module EmergeCLI
|
|
|
262
264
|
end
|
|
263
265
|
|
|
264
266
|
Logger.info 'Uploading images...'
|
|
265
|
-
Logger.debug "Uploading batch zip file to #{upload_url}"
|
|
267
|
+
Logger.debug "Uploading batch zip file to #{EmergeCLI::Network.redact_uri(upload_url)}"
|
|
266
268
|
@profiler.measure('upload_batch_zip') do
|
|
267
269
|
@network.put(
|
|
268
270
|
path: upload_url,
|
data/lib/utils/network.rb
CHANGED
|
@@ -33,6 +33,15 @@ module EmergeCLI
|
|
|
33
33
|
@internet.close
|
|
34
34
|
end
|
|
35
35
|
|
|
36
|
+
# Returns the URI with its query string replaced, so it is safe to log.
|
|
37
|
+
def self.redact_uri(uri)
|
|
38
|
+
uri_string = uri.to_s
|
|
39
|
+
query_start = uri_string.index('?')
|
|
40
|
+
return uri_string unless query_start
|
|
41
|
+
|
|
42
|
+
"#{uri_string[0...query_start]}?[REDACTED]"
|
|
43
|
+
end
|
|
44
|
+
|
|
36
45
|
private
|
|
37
46
|
|
|
38
47
|
def request(method, path, body, custom_headers, query = nil, max_retries = MAX_RETRIES)
|
|
@@ -47,6 +56,9 @@ module EmergeCLI
|
|
|
47
56
|
)
|
|
48
57
|
end
|
|
49
58
|
absolute_uri = uri.to_s
|
|
59
|
+
# Never log the query string: presigned upload URLs carry signatures and
|
|
60
|
+
# temporary credentials there, and CLI output often ends up in public CI logs.
|
|
61
|
+
loggable_uri = self.class.redact_uri(absolute_uri)
|
|
50
62
|
|
|
51
63
|
headers = {
|
|
52
64
|
'User-Agent' => "emerge-cli/#{EmergeCLI::VERSION}"
|
|
@@ -57,15 +69,15 @@ module EmergeCLI
|
|
|
57
69
|
|
|
58
70
|
body = JSON.dump(body) if body.is_a?(Hash) && method == :post
|
|
59
71
|
|
|
60
|
-
Logger.debug "Request: #{method} #{truncate_uri(
|
|
72
|
+
Logger.debug "Request: #{method} #{truncate_uri(loggable_uri)} #{method == :post ? body : 'N/A'}"
|
|
61
73
|
|
|
62
74
|
retries = 0
|
|
63
75
|
begin
|
|
64
76
|
response = perform_request(method, absolute_uri, headers, body)
|
|
65
77
|
|
|
66
78
|
unless response.success?
|
|
67
|
-
Logger.error "Request failed: #{
|
|
68
|
-
raise "Request failed: #{
|
|
79
|
+
Logger.error "Request failed: #{loggable_uri} #{response}"
|
|
80
|
+
raise "Request failed: #{loggable_uri} #{response}"
|
|
69
81
|
end
|
|
70
82
|
|
|
71
83
|
response
|
|
@@ -88,7 +100,7 @@ module EmergeCLI
|
|
|
88
100
|
retry
|
|
89
101
|
else
|
|
90
102
|
unless max_retries == 0
|
|
91
|
-
Logger.error "Request failed after #{max_retries} attempts: #{
|
|
103
|
+
Logger.error "Request failed after #{max_retries} attempts: #{loggable_uri} #{e.message}"
|
|
92
104
|
end
|
|
93
105
|
raise e
|
|
94
106
|
end
|
data/lib/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: emerge
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.7.
|
|
4
|
+
version: 0.7.10
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Emerge Tools
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-11-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: async-http
|
|
@@ -278,7 +278,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
278
278
|
- !ruby/object:Gem::Version
|
|
279
279
|
version: '0'
|
|
280
280
|
requirements: []
|
|
281
|
-
rubygems_version: 3.5.
|
|
281
|
+
rubygems_version: 3.5.22
|
|
282
282
|
signing_key:
|
|
283
283
|
specification_version: 4
|
|
284
284
|
summary: Emerge CLI
|