brainiac-fizzy 0.0.36 → 0.0.37
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: d19bae8ece38c0924c091878a1bd2a5c6583089a0b6243ac69ff0cd9adaf1ab9
|
|
4
|
+
data.tar.gz: a149679a7117ca6312e9f854024bd9f51994e813df628f56a819b5e5d7610e5c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ca5ec9b110034ed0829014410cb50395b2ac23c2ee9d4ae43067ba8565626a1a148e002e9195fa07e605e9d520055df51230916780bf013097bb6a0b5ae98e5e
|
|
7
|
+
data.tar.gz: c2cdb76c0ab5622eef2edb97425b86329f68226bfbbab984ad2408fd365538f11fcc16ba4860e66d957e27bafb27f88d2c94e4b1a0088b155ccb99110b745564
|
|
@@ -269,12 +269,16 @@ def maybe_create_ephemeral_belt_env(worktree_path:, card_number:, project_key:,
|
|
|
269
269
|
end
|
|
270
270
|
|
|
271
271
|
LOG.info "[EphemeralEnv] Card ##{card_number} has deploy tag; #{env_name} not in worktree — creating from '#{parent_env}'"
|
|
272
|
+
# Manual setups (force: true) have a caller waiting on the result — there is
|
|
273
|
+
# no agent to unblock, so deploy synchronously and let failures surface.
|
|
274
|
+
# Agent-triggered deploys stay backgrounded so the agent isn't blocked.
|
|
272
275
|
create_and_deploy_ephemeral_env(
|
|
273
276
|
worktree_path: worktree_path, env_name: env_name, parent_env: parent_env,
|
|
274
|
-
card_number: card_number, project_key: project_key
|
|
277
|
+
card_number: card_number, project_key: project_key, synchronous: force
|
|
275
278
|
)
|
|
276
279
|
rescue StandardError => e
|
|
277
280
|
LOG.error "[EphemeralEnv] Error creating ephemeral env: #{e.message}"
|
|
281
|
+
raise if force
|
|
278
282
|
end
|
|
279
283
|
|
|
280
284
|
def ensure_ephemeral_env_for_comment(ctx, card_number, worktree)
|
|
@@ -383,12 +387,14 @@ def track_ephemeral_env_if_needed(env_name, card_number, project_key, parent_env
|
|
|
383
387
|
"worktree" => worktree_path)
|
|
384
388
|
end
|
|
385
389
|
|
|
386
|
-
def create_and_deploy_ephemeral_env(worktree_path:, env_name:, parent_env:, card_number:, project_key:)
|
|
390
|
+
def create_and_deploy_ephemeral_env(worktree_path:, env_name:, parent_env:, card_number:, project_key:, synchronous: false)
|
|
387
391
|
success = BeltEnvironment.create_environment(
|
|
388
392
|
worktree: worktree_path, env_name: env_name, parent_env: parent_env
|
|
389
393
|
)
|
|
390
394
|
unless success
|
|
391
395
|
LOG.error "[EphemeralEnv] Failed to create environment '#{env_name}'"
|
|
396
|
+
raise "Failed to create environment '#{env_name}'" if synchronous
|
|
397
|
+
|
|
392
398
|
return
|
|
393
399
|
end
|
|
394
400
|
|
|
@@ -397,19 +403,31 @@ def create_and_deploy_ephemeral_env(worktree_path:, env_name:, parent_env:, card
|
|
|
397
403
|
"project" => project_key,
|
|
398
404
|
"parent_env" => parent_env,
|
|
399
405
|
"worktree" => worktree_path)
|
|
400
|
-
LOG.info "[EphemeralEnv] Configured #{env_name} in worktree, deploying in background"
|
|
401
406
|
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
rescue StandardError => e
|
|
413
|
-
LOG.error "[EphemeralEnv] Error deploying '#{env_name}': #{e.message}"
|
|
407
|
+
if synchronous
|
|
408
|
+
LOG.info "[EphemeralEnv] Configured #{env_name} in worktree, deploying synchronously"
|
|
409
|
+
deploy_ephemeral_env(worktree_path, env_name)
|
|
410
|
+
else
|
|
411
|
+
LOG.info "[EphemeralEnv] Configured #{env_name} in worktree, deploying in background"
|
|
412
|
+
Thread.new do
|
|
413
|
+
deploy_ephemeral_env(worktree_path, env_name)
|
|
414
|
+
rescue StandardError => e
|
|
415
|
+
LOG.error "[EphemeralEnv] Error deploying '#{env_name}': #{e.message}"
|
|
416
|
+
end
|
|
414
417
|
end
|
|
415
418
|
end
|
|
419
|
+
|
|
420
|
+
# Run the actual `belt deploy` for a freshly configured ephemeral env.
|
|
421
|
+
# Raises on failure so synchronous callers can surface the error; the
|
|
422
|
+
# background path wraps this in its own rescue.
|
|
423
|
+
def deploy_ephemeral_env(worktree_path, env_name)
|
|
424
|
+
# First provisioning of a fresh env must be a full deploy — it stands up
|
|
425
|
+
# S3/CloudFront/backend. The frontend-only shortcut is only safe once the
|
|
426
|
+
# env is actually live (probe the derived public URL). Otherwise `belt
|
|
427
|
+
# deploy frontend` runs against a bucket that doesn't exist yet and fails
|
|
428
|
+
# with "Could not determine S3 bucket."
|
|
429
|
+
frontend_only =
|
|
430
|
+
ephemeral_env_live?(worktree_path, env_name) &&
|
|
431
|
+
BeltEnvironment.frontend_only_changes?(worktree: worktree_path)
|
|
432
|
+
BeltEnvironment.deploy(worktree: worktree_path, env_name: env_name, frontend_only: frontend_only)
|
|
433
|
+
end
|