diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index cb05d09..b776d83 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -3,6 +3,9 @@ Release notes for the AD Build System (Software Factory) ## Releases: +* tag:1.2.3 13-Apr-2026 P. Nisperos (pnispero) + * Fix admin onboard git workflow file with brackets missing + * tag:1.2.2 10-Apr-2026 P. Nisperos (pnispero) * Fix admin onboard post steps diff --git a/bs_cli/adbs_cli/admin_commands.py b/bs_cli/adbs_cli/admin_commands.py index a69eefc..8bb0b37 100644 --- a/bs_cli/adbs_cli/admin_commands.py +++ b/bs_cli/adbs_cli/admin_commands.py @@ -251,12 +251,12 @@ def onboard_repo(ctx, verbose: bool=False): deploy: uses: ad-build-test/build-system-playbooks/.github/workflows/request-deployment.yml@main with: - deploy_to_dev: ${{ inputs.deploy_to_dev }} - deploy_to_lcls: ${{ inputs.deploy_to_lcls }} - deploy_to_facet: ${{ inputs.deploy_to_facet }} - deploy_to_testfac: ${{ inputs.deploy_to_testfac }} - tag: ${{ inputs.tag }} - playbook: '{playbook}' + deploy_to_dev: ${{{{ inputs.deploy_to_dev }}}} + deploy_to_lcls: ${{{{ inputs.deploy_to_lcls }}}} + deploy_to_facet: ${{{{ inputs.deploy_to_facet }}}} + deploy_to_testfac: ${{{{ inputs.deploy_to_testfac }}}} + tag: ${{{{ inputs.tag }}}} + playbook: '{playbook}' """ deploy_yml_path = os.path.join(top_level, '.github/workflows/deploy.yml') os.makedirs(os.path.dirname(deploy_yml_path), exist_ok=True) diff --git a/bs_cli/dist/adbs_cli-1.2.2.tar.gz b/bs_cli/dist/adbs_cli-1.2.2.tar.gz deleted file mode 100644 index ec6ecf7..0000000 Binary files a/bs_cli/dist/adbs_cli-1.2.2.tar.gz and /dev/null differ diff --git a/bs_cli/dist/adbs_cli-1.2.2-py3-none-any.whl b/bs_cli/dist/adbs_cli-1.2.3-py3-none-any.whl similarity index 71% rename from bs_cli/dist/adbs_cli-1.2.2-py3-none-any.whl rename to bs_cli/dist/adbs_cli-1.2.3-py3-none-any.whl index 0e2a3eb..2cdc8b2 100644 Binary files a/bs_cli/dist/adbs_cli-1.2.2-py3-none-any.whl and b/bs_cli/dist/adbs_cli-1.2.3-py3-none-any.whl differ diff --git a/bs_cli/dist/adbs_cli-1.2.3.tar.gz b/bs_cli/dist/adbs_cli-1.2.3.tar.gz new file mode 100644 index 0000000..c5c2887 Binary files /dev/null and b/bs_cli/dist/adbs_cli-1.2.3.tar.gz differ diff --git a/bs_cli/setup.py b/bs_cli/setup.py index eede48c..5290e3e 100644 --- a/bs_cli/setup.py +++ b/bs_cli/setup.py @@ -2,7 +2,7 @@ # Avoided using pyproject.toml, becuase can't get an editable version installed (pip install -e .) setup( name='adbs_cli', - version='1.2.2', + version='1.2.3', description="Command line interface for the accelerator directorate build system (software factory)", author="Patrick Nisperos, Jerry Katzung, Claudio Bisegni", author_email="pnispero@slac.stanford.edu, katzung@slac.stanford.edu, bisegni@slac.stanford.edu", diff --git a/deploy_controller/deployment_controller.py b/deploy_controller/deployment_controller.py index a07da30..39c1b0d 100644 --- a/deploy_controller/deployment_controller.py +++ b/deploy_controller/deployment_controller.py @@ -192,6 +192,8 @@ class DeployDict(Component): artifact_type: Optional[str] = None # rpm, tar, zip # Generic extra vars forwarded to the playbook as-is extra_vars: Optional[dict] = None + # When True, blocks until deployment completes and returns full result (used by CBS webhook) + sync: Optional[bool] = False class InitialDeploymentDict(Component): # Used for the initial deployment endpoint @@ -737,10 +739,20 @@ async def revert_ioc_deployment(ioc_to_deploy: RevertDict, background_tasks: Bac @app.put("/deployment") async def deploy(deploy_request: DeployDict, background_tasks: BackgroundTasks): """Unified deployment endpoint. Routes to IOC, PyDM, container, or generic handler - based on the playbook field (e.g. 'ioc_module/...', 'pydm_module/...', 'container_module/...').""" + based on the playbook field (e.g. 'ioc_module/...', 'pydm_module/...', 'container_module/...'). + When deploy_request.sync=True, blocks until deployment completes and returns the full result (success, elog_url). + When deploy_request.sync=False (default), returns immediately with a task_id for status polling.""" task_id = str(uuid.uuid4()) task = DeploymentTask(task_id, save_callback=save_task) save_task(task) + if deploy_request.sync: + await deploy_async(task_id, deploy_request) + final_task = get_task(task_id) + if final_task and final_task.status == "completed": + return JSONResponse(status_code=200, content=final_task.result) + else: + error = final_task.error if final_task else "Unknown error" + return JSONResponse(status_code=500, content={"success": False, "elog_url": "", "error": error}) background_tasks.add_task(deploy_async, task_id, deploy_request) return JSONResponse(status_code=202, content={"task_id": task_id, "status": "pending"})