cast/src
claude-hdb d8d5cf8397 feat: diff and apply a database's backup schedule (#51)
Backup schedules were write-only, filed under "known limitations" on the
claim that "live Coolify state doesn't expose it back". The parenthesis was
load-bearing and false: a schedule is not on the database's own GET, but it
was never meant to be — it has its own route, GET /databases/{uuid}/backups,
which cast had been POSTing to all along and had simply never read.

The cost was exact. A database created before its `backup:` block was
declared never got one (apply set the schedule only inside the create
branch); a schedule deleted in the UI was invisible; and the `--full` diff
that gates a production cutover passed with an unbacked-up production
database.

Shape settled from the source rather than the vendored spec, which documents
the body as "Content is very complex. Will be implemented later.":
DatabasesController@database_backup_details_uuid (v4.1.2) returns a raw
Eloquent collection — a JSON array of ScheduledDatabaseBackup rows, columns
per $fillable (uuid, enabled, frequency,
database_backup_retention_amount_locally). `frequency` round-trips verbatim:
the controller validates it and stores $request->only(...) unchanged, with no
mutator on the model. The "diffing it would flag spurious drift" fear was a
guess about a read nobody had performed.

- `backup` becomes a diffed field like any other (resolve.ts), replacing the
  side channel that carried it around the diff.
- The live side reads the route (coolify.ts, fetchLive), and apply sets the
  schedule on UPDATE as well as create — POST or PATCH, decided by a read.
- A disabled schedule is a row that backs nothing up: neither clean nor
  absent. cast diffs it and re-enables it.

Degrades honestly, since no live box was probed: an unreachable or
unrecognized response can only ever produce "declared, NOT compared — verify
in the Coolify UI", never invented drift and never a clean bill on an
unread database. On the write side the same failure raises rather than
guessing — POSTing blind would duplicate a schedule that may already exist.
2026-07-14 23:07:54 +00:00
..
apply.ts fix(apply): refuse to write the generated-secret placeholder over a live value 2026-07-14 22:56:27 +00:00
bindings.ts feat(destroy): a scoped teardown verb, gated in state (#43) 2026-07-14 22:52:17 +00:00
capture.ts Merge pull request #56 from claude-hdb/fix/reserved-env-names 2026-07-14 23:54:15 +01:00
cli.ts feat: diff and apply a database's backup schedule (#51) 2026-07-14 23:07:54 +00:00
config.ts feat: select the Coolify instance by name instead of editing .coolify.env (#14) 2026-07-13 16:42:45 +00:00
coolify.ts feat: diff and apply a database's backup schedule (#51) 2026-07-14 23:07:54 +00:00
destroy.ts feat(destroy): a scoped teardown verb, gated in state (#43) 2026-07-14 22:52:17 +00:00
diff.ts feat: diff and apply a database's backup schedule (#51) 2026-07-14 23:07:54 +00:00
draft.ts fix: never write an env var whose name Coolify injects itself (#50) 2026-07-14 22:29:23 +00:00
envtemplate.ts feat: read-side coordinates (#17, #18) + cast inventory (#19) 2026-07-13 18:20:53 +00:00
fleet.ts feat: --all — every project in an environment, and a report that says so (#26) 2026-07-13 20:23:23 +00:00
inventory.ts fix(inventory): biome lint — a bare template literal and a string concat 2026-07-13 19:22:07 +00:00
manifest.ts fix(manifest): refuse checkout paths that are not absolute (#49) 2026-07-14 22:20:27 +00:00
reserved.ts fix: never write an env var whose name Coolify injects itself (#50) 2026-07-14 22:29:23 +00:00
resolve.ts feat: diff and apply a database's backup schedule (#51) 2026-07-14 23:07:54 +00:00
secrets.ts fix: hand the age identity to age on stdin — fd paths resolve only in cast's process 2026-07-13 22:43:00 +00:00
server.ts feat: cast — the Coolify executor, extracted from the infra state repo 2026-07-11 12:25:44 +00:00
smoke.ts fix: never write an env var whose name Coolify injects itself (#50) 2026-07-14 22:29:23 +00:00
team.ts feat: assert the token's team before touching Coolify (fail-closed) 2026-07-12 20:55:04 +00:00