fast_ci 1.0.10 → 1.1.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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/fast_ci/version.rb +1 -1
- data/lib/fast_ci.rb +27 -18
- 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: c198e20b22117ce90305fa7c2f82c512ef268097b46c63fcb9cdfaaa9c45aa1d
|
4
|
+
data.tar.gz: cede75f91ab2fad8ee74715660a273ed9a0f229f40beb0875b4edc6ae253d550
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 04040e4fff496fe2065fc2f120160fc29f253322abe3f6f526f9516e88bd9feb98ddb1319ce161858f204eacc2c59d6dccd2390645b1f168e254a91ad1ccb89e
|
7
|
+
data.tar.gz: 168c07fddb1154357fa647d5d59e61a8a248206f933a96f437ff4ac8d2a485b56c8b15b0cecc05a9974ad181d8cff8cc999129767ae92de4993c6ea20fdbd40c
|
data/Gemfile.lock
CHANGED
data/lib/fast_ci/version.rb
CHANGED
data/lib/fast_ci.rb
CHANGED
@@ -54,8 +54,16 @@ module FastCI
|
|
54
54
|
minitest_ws.await
|
55
55
|
end
|
56
56
|
|
57
|
+
def error(msg)
|
58
|
+
STDERR.puts "\e[31m[FastCI] #{msg}\e[0m"
|
59
|
+
end
|
60
|
+
|
57
61
|
def debug(msg)
|
58
|
-
puts "\
|
62
|
+
puts "\e[36mDEBUG: \e[0m #{msg}\n" if ENV["FAST_CI_DEBUG"]
|
63
|
+
end
|
64
|
+
|
65
|
+
def log(msg)
|
66
|
+
puts "\e[0m[FastCI] #{msg}\e[0m"
|
59
67
|
end
|
60
68
|
|
61
69
|
def report_options(run_key, content)
|
@@ -132,22 +140,21 @@ module FastCI
|
|
132
140
|
self.connection = connection
|
133
141
|
self.task = task
|
134
142
|
yield
|
143
|
+
|
144
|
+
leave
|
135
145
|
end
|
136
146
|
rescue Async::WebSocket::ProtocolError => e
|
137
147
|
case e.message
|
138
148
|
when "Failed to negotiate connection: 401"
|
139
|
-
|
149
|
+
FastCI.error("Failed to connect: Invalid secret key!")
|
140
150
|
exit 2
|
141
151
|
when "Failed to negotiate connection: 403"
|
142
|
-
|
152
|
+
FastCI.error("Failed to connect: Invalid or disabled run key!")
|
143
153
|
exit 2
|
144
|
-
|
145
|
-
|
154
|
+
else
|
155
|
+
FastCI.error("Failed to connect: General connection error!")
|
146
156
|
exit 2
|
147
157
|
end
|
148
|
-
ensure
|
149
|
-
|
150
|
-
leave
|
151
158
|
end
|
152
159
|
end
|
153
160
|
end
|
@@ -164,7 +171,7 @@ module FastCI
|
|
164
171
|
|
165
172
|
case response&.dig(:event) || message[:event]
|
166
173
|
when "phx_error"
|
167
|
-
raise("
|
174
|
+
raise("Unexpected server error")
|
168
175
|
when "join"
|
169
176
|
handle_join(response)
|
170
177
|
when "failed_join"
|
@@ -180,15 +187,12 @@ module FastCI
|
|
180
187
|
else
|
181
188
|
break
|
182
189
|
end
|
183
|
-
when "error"
|
184
|
-
raise(response.inspect)
|
185
190
|
else
|
186
|
-
|
191
|
+
raise(response.inspect)
|
187
192
|
end
|
188
193
|
end
|
189
194
|
rescue => e
|
190
|
-
|
191
|
-
puts e.backtrace.join("\n")
|
195
|
+
FastCI.error("Unexpected error: #{e.message}\n\t#{e.backtrace.join("\n\t")}")
|
192
196
|
task&.stop
|
193
197
|
end
|
194
198
|
end
|
@@ -199,7 +203,7 @@ module FastCI
|
|
199
203
|
def leave
|
200
204
|
send_msg("leave")
|
201
205
|
connection.close
|
202
|
-
rescue
|
206
|
+
rescue
|
203
207
|
# noop
|
204
208
|
end
|
205
209
|
|
@@ -228,8 +232,13 @@ module FastCI
|
|
228
232
|
end
|
229
233
|
|
230
234
|
def handle_join_fail(response)
|
231
|
-
|
232
|
-
|
235
|
+
if response[:state] == "passed"
|
236
|
+
FastCI.log("Can't join because of run's state being: #{response[:state]}")
|
237
|
+
exit 0
|
238
|
+
else
|
239
|
+
FastCI.error("Can't join because of run's state being: #{response[:state]}")
|
240
|
+
exit 1
|
241
|
+
end
|
233
242
|
end
|
234
243
|
|
235
244
|
def handle_deq_request(_response)
|
@@ -241,7 +250,7 @@ module FastCI
|
|
241
250
|
end
|
242
251
|
|
243
252
|
def topic
|
244
|
-
"test_orchestrator:#{run_key}-#{FastCI.configuration.build_id}"
|
253
|
+
"test_orchestrator:#{run_key}-#{FastCI.configuration.commit}-#{FastCI.configuration.build_id}"
|
245
254
|
end
|
246
255
|
|
247
256
|
def endpoint
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fast_ci
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nesha Zoric
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-12-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: console
|