brainiac-fizzy 0.0.35 → 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: f955d8bdd850598beb38a7779cee4018d05983e92fba4b331032915d4681716f
4
- data.tar.gz: 7151d9a8f1b8ccdcfc2d1bb0d7a695ece787e279dbc88e7c567c7d8ea11cbe14
3
+ metadata.gz: d19bae8ece38c0924c091878a1bd2a5c6583089a0b6243ac69ff0cd9adaf1ab9
4
+ data.tar.gz: a149679a7117ca6312e9f854024bd9f51994e813df628f56a819b5e5d7610e5c
5
5
  SHA512:
6
- metadata.gz: 8e9c9b4b9de9d348eda0279358b0353be2b40a281e59b33e2ba0b3d425113b69096e501dde2fa8b459b3bb5d4d7273ba05830189716740910ac0c25f1ffda1fe
7
- data.tar.gz: 8ae711d9382289a266374f9a5291286c2710ec13e6f83cf601ffb81a907c2f41bfc3dc5330bb59ca7caf339a0e343bd5e9dac0e8f66af666b3d76655f3c0b6bd
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
- Thread.new do
403
- # First provisioning of a fresh env must be a full deploy — it stands up
404
- # S3/CloudFront/backend. The frontend-only shortcut is only safe once the
405
- # env is actually live (probe the derived public URL). Otherwise `belt
406
- # deploy frontend` runs against a bucket that doesn't exist yet and fails
407
- # with "Could not determine S3 bucket."
408
- frontend_only =
409
- ephemeral_env_live?(worktree_path, env_name) &&
410
- BeltEnvironment.frontend_only_changes?(worktree: worktree_path)
411
- BeltEnvironment.deploy(worktree: worktree_path, env_name: env_name, frontend_only: frontend_only)
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
@@ -110,7 +110,7 @@ def build_comment_context(eventable:, plain_text:, tags:, card_internal_id:, car
110
110
  clean_text = tags[:clean_text]
111
111
 
112
112
  inline_cli = detect_cli_provider(text: plain_text, tags: card_tags)
113
- inline_model, inline_model_explicit = detect_model_explicit(project_config, text: plain_text)
113
+ inline_model, inline_model_explicit = detect_model_explicit(project_config, text: plain_text, tags: card_tags)
114
114
  inline_effort = detect_effort(project_config, tags: card_tags, text: plain_text)
115
115
  inline_profile = detect_comment_profile(plain_text, card_tags, tags)
116
116
 
@@ -3,7 +3,7 @@
3
3
  module Brainiac
4
4
  module Plugins
5
5
  module Fizzy
6
- VERSION = "0.0.35"
6
+ VERSION = "0.0.37"
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brainiac-fizzy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.35
4
+ version: 0.0.37
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Davis