ADR 0021 — Restart and Up scoped to one service
Status: accepted.
Context
Restarting or updating a single service (web) without touching db is a
daily need. Compose offers both, with different semantics that the panel must
not blur: restart only restarts, while up recreates from the Compose file
and images. Service discovery (listServices, ADR 0020) is reused unchanged.
Decision
- Form, not new actions.
POST /stacks/<name>/operationsaccepts an optionalservicefield next toaction.action=restart&service=webandaction=up&service=webare the only scoped combinations:restartrunscompose restart --no-deps -- <service>(--no-depsso dependents are not restarted; without it the "only this service" promise would be false).uprunscompose up -d --no-deps -- <service>: normalUpsemantics (Compose may pull or build per its policy — no "local images only" promise), limited to the service, without starting its dependencies.
- Creation rules (server-enforced, not UI-only).
upwithout service may create the stack (unchanged).upwith service requires a deployed stack:absentis refused, it never creates.restartwith or without service requires a deployed stack (unchanged).- A
servicefield ondown,pull,startorpull-upis refused (400), never silently ignored.
- Validation, same as logs (ADR 0020). Syntax check, then exact
membership in
listServices;400/503/409before any mutation subprocess is spawned (the discovery call itself is expected). Names pass after--in a fixed argument array, never through a shell. No--profilesflag is ever passed. - Visibility.
OperationViewand the activity log carry the service, so the UI and the audit trail read "Restart · web", not bare "Restart". - Locking. One operation per stack, scoped or not: a service action holds the same per-stack lock and project reservation as a stack action.
- UI. The Services table offers per-service Restart/Up forms (plain
POST, no JavaScript required); the Actions card stays stack-wide. Scoped
buttons follow the same state table as stack actions (nothing on
unknown).
Not decided here
- Scoped
stop/start/log tail per service beyond ADR 0020,build + up, exec presets (v0.4). restart --no-depsand--separator support depend on the embedded Compose: verified against it in the lab suite, not assumed.
Consequences
- Provider
up/restartreadtarget.service; other mutations never receive one (the handler refuses it first). - The lab suite covers the exact argument arrays against real Compose,
including that
--no-depsleaves dependents alone.