Files
ServerKit/backend/app/services
Juan DenisandClaude Opus 4.8 85265df138 feat(jobs): run template installs as a deploy.install unified job (Phase 5)
Migrate deployment installs off their ad-hoc daemon thread onto the unified
job system. DeploymentJobService.install_template now enqueues a
'deploy.install' Job instead of spawning a thread via _start_background_job
(retired); the JobConsumer runs it by calling the existing run_job.

- max_attempts=1: installs create containers/files/an app row and are not
  idempotent, so no auto-retry (preserves prior single-shot behavior).
- The unified Job shares the DeploymentJob's correlation_id and links back via
  owner_type='deployment_job'/owner_id; the DeploymentJob row stays the rich
  record (plan/steps/logs/progress). A failed run raises so both rows show failed.
- Bonus: CLI `deploy-template` (no --wait) now persists to the queue and runs
  when a consumer is available, instead of dying with the CLI process.
- tests: handler success/failure mapping + install_template enqueues-not-threads.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21 21:01:38 -04:00
..