brainiac-fizzy 0.0.21 → 0.0.22
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 55c60df15ffb87640dfbfce7a3dd64033bdf14a6c551e2269fb252468a96e4bb
|
|
4
|
+
data.tar.gz: cc1eb7dad2215000df5fd608f12a54ee0246e5474f19b03dcc3a98716d3d76f8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1fa2208a211311ce53f677da3ff14786f154b506c457659ee026afc08f9495d78737282361f737d2fabc3a4474d3f11bc9f8c0e2e8a06aae90b8e8a1b63a9256
|
|
7
|
+
data.tar.gz: fb6d51f31357250bd28c0f3d58d6115fc379afafa117316b17095e6576068a45e5a0524232acc997c9eaef5a56c2d762d42b04e57dede7b19e6c813642720ae6
|
|
@@ -111,14 +111,14 @@ module Brainiac
|
|
|
111
111
|
project_config)
|
|
112
112
|
Thread.new do
|
|
113
113
|
wait_for_process_or_timeout(pid, timeout: 60)
|
|
114
|
-
sleep
|
|
114
|
+
sleep 5 # Wait for Fizzy API propagation before checking
|
|
115
115
|
|
|
116
116
|
unless agent_commented_on_card?(card_number, agent_name, repo_path: repo_path, since: session_started_at)
|
|
117
117
|
post_fallback_comment(card_number, branch, agent_name, project_config)
|
|
118
118
|
end
|
|
119
119
|
rescue Errno::ECHILD
|
|
120
120
|
# Process already reaped by session manager — check for comment
|
|
121
|
-
sleep
|
|
121
|
+
sleep 5
|
|
122
122
|
unless agent_commented_on_card?(card_number, agent_name, repo_path: repo_path, since: session_started_at)
|
|
123
123
|
post_fallback_comment(card_number, branch, agent_name, project_config)
|
|
124
124
|
end
|
|
@@ -48,6 +48,17 @@ module Brainiac
|
|
|
48
48
|
agent_name: ctx[:agent_name],
|
|
49
49
|
since: ctx[:source_context]&.dig(:dispatched_at))
|
|
50
50
|
|
|
51
|
+
# Retry once after a short delay to account for Fizzy API propagation.
|
|
52
|
+
# The agent may have posted its comment just before exiting, and the API
|
|
53
|
+
# might not return it immediately in a list call.
|
|
54
|
+
if !found_comment
|
|
55
|
+
sleep 5
|
|
56
|
+
found_comment = Helpers.append_fizzy_comment_footer(card_number,
|
|
57
|
+
project_config: ctx[:project_config],
|
|
58
|
+
agent_name: ctx[:agent_name],
|
|
59
|
+
since: ctx[:source_context]&.dig(:dispatched_at))
|
|
60
|
+
end
|
|
61
|
+
|
|
51
62
|
# If the agent didn't post any comment during this session, re-dispatch to summarize from memory.
|
|
52
63
|
# Uses dispatched_at from source_context to only check for comments made during THIS session,
|
|
53
64
|
# not previous sessions on the same card.
|
|
@@ -171,6 +171,27 @@ module Brainiac
|
|
|
171
171
|
LOG.info "[Fizzy:Deploy] #{env_key} marked deploying via API"
|
|
172
172
|
{ status: "deploying", env: env_key }.to_json
|
|
173
173
|
end
|
|
174
|
+
|
|
175
|
+
app.post "/api/deployments/:env/failed" do
|
|
176
|
+
content_type :json
|
|
177
|
+
env_key = params["env"]
|
|
178
|
+
config = DEPLOYMENTS_CONFIG["environments"] || {}
|
|
179
|
+
halt 404, { error: "Unknown environment: #{env_key}" }.to_json unless config.key?(env_key)
|
|
180
|
+
request.body.rewind
|
|
181
|
+
payload = begin
|
|
182
|
+
JSON.parse(request.body.read)
|
|
183
|
+
rescue StandardError
|
|
184
|
+
{}
|
|
185
|
+
end
|
|
186
|
+
state = load_deployment_state
|
|
187
|
+
state[env_key] ||= {}
|
|
188
|
+
state[env_key]["last_deploy_status"] = "failed"
|
|
189
|
+
state[env_key]["last_deploy_at"] = Time.now.iso8601
|
|
190
|
+
save_deployment_state(state)
|
|
191
|
+
DEPLOYMENT_STATE.replace(state)
|
|
192
|
+
LOG.info "[Fizzy:Deploy] #{env_key} marked failed via API"
|
|
193
|
+
{ status: "failed", env: env_key }.to_json
|
|
194
|
+
end
|
|
174
195
|
end
|
|
175
196
|
|
|
176
197
|
public
|