Files
sim/apps
Waleed cd324d5657 refactor(deployments): consolidate version reads, status mapping, and v1 auth prologue (#5013)
* refactor(deployments): consolidate version-list reads onto listWorkflowVersions

The UI deployments list route and the mothership get_deployment_log handler
each had their own inline version query; both now consume the shared
persistence helper, so every deployment surface (UI, v1, admin, tools,
mothership) reads versions through one code path.

* refactor(deployments): shared status mapper, single-version fetch, and v1 workflow resolver

- statusForOrchestrationError maps orchestration error codes to HTTP statuses
  in one place (was an identical ternary in six routes: UI deploy/activate,
  v1 deploy/rollback, tool deploy/promote)
- getWorkflowDeploymentVersion consolidates the single-version fetch used by
  the UI version GET and the deployments tool version route
- resolveV1DeploymentWorkflow extracts the v1 mutation prologue (active-record
  load, admin permission check, 404 masking) shared by deploy, undeploy, and
  rollback
2026-06-12 17:12:06 -07:00
..