CD phase 1 — foundations for automatic deploys #11

Closed
opened 2026-09-15 08:59:23 +01:00 by cruelacid · 2 comments
Owner

Sha baked into both images (NECTENDA_VERSION, revision label) and reported with the schema version on /api/health; downgrade guard in server and identity migrations (identity gains the contiguity check); compose healthcheck at 5 s so up --wait returns in seconds; Caddy lb_try_duration 30s so requests are held across the gap; plugin treats close 1001 as restarting (1 s then 2 s retries for 60 s, status bar only, no notice); backup-cli in server and identity producing a verified pre-deploy SQLite copy. Checkpoint: /api/health on eu1 shows the deployed sha and schema; a hand up -d --wait returns in under 15 s; restart e2e (two vaults typing across a server restart, no divergence, reconnect within 4 s) green; mutation checks per test.

Sha baked into both images (NECTENDA_VERSION, revision label) and reported with the schema version on /api/health; downgrade guard in server and identity migrations (identity gains the contiguity check); compose healthcheck at 5 s so up --wait returns in seconds; Caddy lb_try_duration 30s so requests are held across the gap; plugin treats close 1001 as restarting (1 s then 2 s retries for 60 s, status bar only, no notice); backup-cli in server and identity producing a verified pre-deploy SQLite copy. Checkpoint: /api/health on eu1 shows the deployed sha and schema; a hand up -d --wait returns in under 15 s; restart e2e (two vaults typing across a server restart, no divergence, reconnect within 4 s) green; mutation checks per test.
Author
Owner

Checkpoint, 15 Sep 2026 — 7440096 (+4446a33 ignore fix). Both images carry the sha (ARG GIT_SHA → NECTENDA_VERSION + revision label); /api/health reports version and schema on both services; downgrade guard on both, identity gained the contiguity check; ops-common verifiedCopy/preDeployCopy + backup-cli in server and identity; compose healthcheck 5 s; Caddy lb_try_duration 30s; plugin treats 1001 as restarting (1 s then 2 s for 60 s, status bar only). Tests: 8 mutation checks caught; unit 358/337/67/36 green; full multi-vault suite 57 passed incl. the new restart.test.ts (two vaults typing across a server restart, converge, no conflict copies, reconnect within 4 s). Live: compose + Caddyfiles pushed to both hosts with a graceful caddy reload; hand deploy of 4446a33 — identity up --wait 6.1 s, eu1 6.8 s, health reports the exact sha and schema (4 and 7); pre-deploy copies written by the CLI; 311 external probes of eu1 /api/ready at 4/s across the restart saw zero failures, slowest held 2.7 s. Trap recorded: run the backup CLI from the image about to be deployed, not via compose on the current tag.

Checkpoint, 15 Sep 2026 — 7440096 (+4446a33 ignore fix). Both images carry the sha (ARG GIT_SHA → NECTENDA_VERSION + revision label); /api/health reports version and schema on both services; downgrade guard on both, identity gained the contiguity check; ops-common verifiedCopy/preDeployCopy + backup-cli in server and identity; compose healthcheck 5 s; Caddy lb_try_duration 30s; plugin treats 1001 as restarting (1 s then 2 s for 60 s, status bar only). Tests: 8 mutation checks caught; unit 358/337/67/36 green; full multi-vault suite 57 passed incl. the new restart.test.ts (two vaults typing across a server restart, converge, no conflict copies, reconnect within 4 s). Live: compose + Caddyfiles pushed to both hosts with a graceful caddy reload; hand deploy of 4446a33 — identity up --wait 6.1 s, eu1 6.8 s, health reports the exact sha and schema (4 and 7); pre-deploy copies written by the CLI; 311 external probes of eu1 /api/ready at 4/s across the restart saw zero failures, slowest held 2.7 s. Trap recorded: run the backup CLI from the image about to be deployed, not via compose on the current tag.
Author
Owner

Closed by the phase 2 checkpoint, which exercised every foundation this issue added.

/api/health on both hosts reports the deployed sha and the schema version, and the deployer reads both: it verifies a deploy by waiting for the literal version string, and it decides whether a rollback is safe by comparing the schema before and after. Four hand deploys on 15 September moved accounts and eu1 between 4446a33 and 23db287 in 6.3 to 7.4 s each, with readiness probed through Caddy at 2/s and no failure in any of them, which is the Caddy hold doing its job. The restart e2e test and the downgrade guards ship in both images.

Detail and the measured table are on #12 and in docs/releasing.md.

Closed by the phase 2 checkpoint, which exercised every foundation this issue added. `/api/health` on both hosts reports the deployed sha and the schema version, and the deployer reads both: it verifies a deploy by waiting for the literal version string, and it decides whether a rollback is safe by comparing the schema before and after. Four hand deploys on 15 September moved `accounts` and `eu1` between 4446a33 and 23db287 in 6.3 to 7.4 s each, with readiness probed through Caddy at 2/s and no failure in any of them, which is the Caddy hold doing its job. The restart e2e test and the downgrade guards ship in both images. Detail and the measured table are on #12 and in `docs/releasing.md`.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Nectenda/nectenda#11
No description provided.