feat(slm): implement autobot-backend Docker deployment API bridge (SLM → Ansible → Docker)#3416
feat(slm): implement autobot-backend Docker deployment API bridge (SLM → Ansible → Docker)#3416mrveiss merged 2 commits intoDev_new_guifrom
Conversation
✅ SSOT Configuration Compliance: Passing🎉 No hardcoded values detected that have SSOT config equivalents! |
Code reviewFound 4 issues.
🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
… fix deploy_docker dependency; remove /v1 prefix - lifespan.py: call init_orchestrator(get_slm_client()) after SLM client init so the singleton is never None at request time - deployment_orchestrator.py: implement execute_deployment() — transitions QUEUED→RUNNING, fans SLM create_deployment calls per target node, transitions to COMPLETED/FAILED - deployments.py: execute_deployment API calls orch.execute_deployment() instead of setting ctx.status silently; deploy_docker uses get_slm_client() directly instead of accessing private orch._client - feature_routers.py: remove non-standard /v1 prefix — router already prefixes /slm/deployments, yielding /api/slm/deployments to match all other routes Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Code reviewFound 1 additional issue not covered by the existing review. Missing authentication on all 7 deployment endpoints (score: 100) None of the new routes in Affected routes: Fix: add from auth_middleware import get_current_user
@router.post("/docker", ...)
async def deploy_docker(
request: DockerDeploymentRequest,
current_user: dict = Depends(get_current_user),
) -> DockerDeploymentStatus:AutoBot-AI/autobot-backend/api/slm/deployments.py Lines 108 to 140 in b1b38a7 The 4 issues from the prior review (orchestrator never initialised, execute sets RUNNING but spawns no work, deploy_docker bypasses 🤖 Generated with Claude Code |
Summary
models/infrastructure.py: newPortMapping,DockerContainerSpec,DockerDeploymentRequest,DockerDeploymentStatusPydantic modelsservices/slm/deployment_orchestrator.py:SLMDeploymentOrchestrator— wraps SLM HTTP client to callPOST /deploymentswith playbook + extra_vars built from container spec; providesdeploy_docker(),get_deployment(),list_deployments()api/slm/deployments.py: real implementation replacing mock-only stub —POST /api/v1/slm/deployments/docker,GET /api/v1/slm/deployments/{id},GET /api/v1/slm/deploymentsinitialization/router_registry/feature_routers.py: registered the new SLM deployments routerdeployments_api_test.py: updated to useSLMDeploymentOrchestratorwith httpx test-double instead of raw MagicMockdocs/guides/slm-docker-ansible-deployment.md: added "Trigger from AutoBot Backend" section with Python example using the new endpointCloses #3407