fix: v0.10.0 — compose up after cached build; recover CREATED projects

A build: project whose image was already cached landed in CREATED without
its containers being started: build_stream runs `docker compose build`, and
on a cache hit DSM's implicit `up` does not fire, leaving the project stuck
(start_project -> DSM 2104, redeploy_project -> "unexpected status CREATED").

- create_project / redeploy_project: after build_stream, read status and, if
  not RUNNING, issue SYNO.Docker.Project/start (= docker compose up) via new
  _ensure_project_up helper, then re-read. Best-effort: a rejected start is
  surfaced as a clear "containers are not running" hint, not a silent stick.
- redeploy_project: accept CREATED as an input status and recover it.
- start_project: support CREATED/STOPPED; graceful 2104 hint with the
  cold-rebuild workaround; no-op message when already RUNNING.

Confirmed against live DSM: start brings STOPPED -> RUNNING; the cold-build
path was already RUNNING and is unchanged. 329 tests pass; ruff clean.
This commit is contained in:
2026-06-23 15:28:41 +00:00
parent 34327520b6
commit f6f550fdcb
5 changed files with 350 additions and 22 deletions
+24
View File
@@ -2,6 +2,30 @@
All notable changes to this project will be documented in this file.
## [0.10.0] - 2026-06-23
### Fixed (cached `build:` projects no longer stick in CREATED)
- `create_project` / `redeploy_project`: after `build_stream` finishes, the
project status is checked and, when the build left it CREATED — a `build:`
project whose image was already cached, so DSM's implicit `up` never fired —
`SYNO.Docker.Project/start` (confirmed to map to `docker compose up`) is
issued to bring the containers to RUNNING. Previously such projects were left
stuck in CREATED, with `start_project` returning DSM 2104 and
`redeploy_project` refusing with "unexpected status".
- `redeploy_project`: now recovers a project that is already in CREATED
(stop → build → compose up) instead of refusing it.
- `start_project`: supports CREATED (compose up) and STOPPED. On a DSM
rejection from CREATED (observed as code 2104 on some firmware) it returns an
actionable recovery hint (retry `redeploy_project`, or delete the base image
to force a cold rebuild) instead of a bare error code, and is a no-op with a
clear message when the project is already RUNNING.
### Notes
- The post-build compose-up is best-effort: if DSM rejects `start`, the tools
surface a clear "containers are not running" hint instead of a silent stuck
state. Behaviour confirmed against live DSM: `start` brings STOPPED → RUNNING;
the cold-build path was already RUNNING and is unchanged.
## [0.9.1] - 2026-06-22
### Fixed