persist api-http-stack deployment state across restarts #1096

Merged
kiara merged 1 commit from kiara/fediversity:api-http-stack-persist-state into main 2026-06-18 18:48:59 +02:00
Owner

The local api-http-stack dev stack wiped its SQLite state DB (state.db) on every start, so a deployment made before a restart was silently lost.

This keeps the DB by default and gates the wipe behind an explicit API_RESET_STATE=1. Restarting api/ -- for example after rebuilding it against a different module source -- no longer destroys deployment state.

This is a prerequisite for the schema-change view (#213): demonstrating it means deploying under an old schema, restarting api/ baked against the new one, then reopening the form -- which only works if the deployment row survives the restart. The schema-change-viz branch documents that end-to-end flow and should land after this.

Verified: nix-build ./api -A api-http-stack builds clean (its writeShellApplication runs shellcheck over the new conditional); treefmt reports no change.

Disclaimer: I used a coding agent in the creation of this patch.

The local `api-http-stack` dev stack wiped its SQLite state DB (`state.db`) on every start, so a deployment made before a restart was silently lost. This keeps the DB by default and gates the wipe behind an explicit `API_RESET_STATE=1`. Restarting api/ -- for example after rebuilding it against a different module source -- no longer destroys deployment state. This is a prerequisite for the schema-change view (#213): demonstrating it means deploying under an old schema, restarting api/ baked against the new one, then reopening the form -- which only works if the deployment row survives the restart. The `schema-change-viz` branch documents that end-to-end flow and should land after this. Verified: `nix-build ./api -A api-http-stack` builds clean (its `writeShellApplication` runs shellcheck over the new conditional); treefmt reports no change. Disclaimer: I used a coding agent in the creation of this patch.
kiara force-pushed api-http-stack-persist-state from dc6ba67506
Some checks failed
checks-api-assets-fresh / api-assets-fresh (pull_request) Successful in 4s
checks-api-asyncapi-validate / api-asyncapi-validate (pull_request) Successful in 7s
checks-api-docs / api-docs (pull_request) Successful in 7s
checks-api-openapi-validate / api-openapi-validate (pull_request) Successful in 6s
checks-api-python-tests / api-python-tests (pull_request) Successful in 7s
checks-contracts-chaining / contracts-chaining (pull_request) Successful in 9s
checks-contracts-filesecrets-hardcoded-secret / contracts-filesecrets-hardcoded-secret (pull_request) Successful in 10s
checks-contracts-generatefiles-vars / contracts-generatefiles-vars (pull_request) Successful in 9s
checks-contracts-cross-node / contracts-cross-node (pull_request) Successful in 12s
checks-contracts-generatefiles-vars-openbao / contracts-generatefiles-vars-openbao (pull_request) Successful in 11s
checks-contracts-ldap-lldap / contracts-ldap-lldap (pull_request) Successful in 10s
checks-contracts-ldap-hardcoded / contracts-ldap-hardcoded (pull_request) Successful in 10s
checks-contracts-filebackup-hardcoded-file-backup / contracts-filebackup-hardcoded-file-backup (pull_request) Successful in 13s
checks-contracts-s3-hardcoded / contracts-s3-hardcoded (pull_request) Successful in 9s
checks-contracts-smtp-hardcoded / contracts-smtp-hardcoded (pull_request) Successful in 10s
checks-contracts-smtp-maddy / contracts-smtp-maddy (pull_request) Successful in 10s
checks-contracts-ssl-self-signed / contracts-ssl-self-signed (pull_request) Successful in 10s
checks-contracts-streamingbackup-hardcoded / contracts-streamingbackup-hardcoded (pull_request) Successful in 9s
checks-contracts-sso-hardcoded / contracts-sso-hardcoded (pull_request) Successful in 11s
checks-contracts-systemd-openbaod / contracts-systemd-openbaod (pull_request) Successful in 10s
checks-resources-secrets-agenix / resources-secrets-agenix (pull_request) Successful in 11s
checks-integrations-spire-openbao / integrations-spire-openbao (pull_request) Successful in 14s
checks-test-otel-wiring / test-otel-wiring (pull_request) Successful in 11s
checks-treefmt / treefmt (pull_request) Successful in 11s
devShells-default / default (pull_request) Successful in 15s
checks-api-http / api-http (pull_request) Successful in 44s
nix-unit-contracts-lib / contracts-lib (pull_request) Successful in 18s
nix-unit-effects-tf-common-conversion / effects-tf-common-conversion (pull_request) Successful in 18s
nix-unit-lib-data-model / lib-data-model (pull_request) Successful in 17s
nix-unit-lib-function / lib-function (pull_request) Successful in 18s
nix-unit-lib-lib / lib-lib (pull_request) Successful in 16s
nix-unit-effects-common-lib / effects-common-lib (pull_request) Successful in 23s
nix-unit-lib-renames-for-source / lib-renames-for-source (pull_request) Successful in 18s
nixosConfigurations-hosting-provider-api / hosting-provider-api (pull_request) Successful in 13s
nixosConfigurations-hosting-provider-otel-collector / hosting-provider-otel-collector (pull_request) Successful in 12s
nixosConfigurations-hosting-provider-windmill / hosting-provider-windmill (pull_request) Successful in 14s
nixosConfigurations-operator-lldap / operator-lldap (pull_request) Successful in 14s
nix-unit-resources-secrets / resources-secrets (pull_request) Successful in 20s
nixosConfigurations-operator-smtp / operator-smtp (pull_request) Successful in 15s
nix-unit-resources-generateFiles / resources-generateFiles (pull_request) Successful in 30s
nix-unit-resources-otel / resources-otel (pull_request) Successful in 33s
Nix flake completeness check / _complete (pull_request) Successful in 1m28s
flake-show / apps-ssh (pull_request) Successful in 1m52s
checks-docs / docs (pull_request) Failing after 3m17s
checks-apps-api / apps-api (pull_request) Has been cancelled
to e408816cc3
Some checks failed
checks-api-assets-fresh / api-assets-fresh (pull_request) Successful in 5s
checks-api-asyncapi-validate / api-asyncapi-validate (pull_request) Successful in 7s
checks-api-docs / api-docs (pull_request) Successful in 7s
checks-api-openapi-validate / api-openapi-validate (pull_request) Successful in 7s
checks-api-python-tests / api-python-tests (pull_request) Successful in 7s
checks-contracts-chaining / contracts-chaining (pull_request) Successful in 10s
checks-contracts-cross-node / contracts-cross-node (pull_request) Successful in 11s
checks-contracts-filesecrets-hardcoded-secret / contracts-filesecrets-hardcoded-secret (pull_request) Successful in 9s
checks-contracts-generatefiles-vars-openbao / contracts-generatefiles-vars-openbao (pull_request) Successful in 9s
checks-contracts-generatefiles-vars / contracts-generatefiles-vars (pull_request) Successful in 10s
checks-contracts-ldap-hardcoded / contracts-ldap-hardcoded (pull_request) Successful in 9s
checks-contracts-filebackup-hardcoded-file-backup / contracts-filebackup-hardcoded-file-backup (pull_request) Successful in 13s
checks-contracts-ldap-lldap / contracts-ldap-lldap (pull_request) Successful in 9s
checks-contracts-s3-hardcoded / contracts-s3-hardcoded (pull_request) Successful in 9s
checks-contracts-smtp-hardcoded / contracts-smtp-hardcoded (pull_request) Successful in 10s
checks-contracts-smtp-maddy / contracts-smtp-maddy (pull_request) Successful in 10s
checks-contracts-ssl-self-signed / contracts-ssl-self-signed (pull_request) Successful in 9s
checks-contracts-sso-hardcoded / contracts-sso-hardcoded (pull_request) Successful in 9s
checks-contracts-streamingbackup-hardcoded / contracts-streamingbackup-hardcoded (pull_request) Successful in 9s
checks-contracts-systemd-openbaod / contracts-systemd-openbaod (pull_request) Successful in 10s
checks-resources-secrets-agenix / resources-secrets-agenix (pull_request) Successful in 9s
checks-integrations-spire-openbao / integrations-spire-openbao (pull_request) Successful in 13s
checks-test-otel-wiring / test-otel-wiring (pull_request) Successful in 11s
checks-treefmt / treefmt (pull_request) Successful in 11s
devShells-default / default (pull_request) Successful in 14s
nix-unit-contracts-lib / contracts-lib (pull_request) Successful in 16s
nix-unit-effects-common-lib / effects-common-lib (pull_request) Successful in 17s
checks-api-http / api-http (pull_request) Successful in 45s
nix-unit-effects-tf-common-conversion / effects-tf-common-conversion (pull_request) Successful in 17s
nix-unit-lib-renames-for-source / lib-renames-for-source (pull_request) Successful in 9s
nix-unit-lib-data-model / lib-data-model (pull_request) Successful in 17s
nix-unit-lib-lib / lib-lib (pull_request) Successful in 17s
nix-unit-lib-function / lib-function (pull_request) Successful in 19s
nixosConfigurations-hosting-provider-api / hosting-provider-api (pull_request) Successful in 13s
nixosConfigurations-hosting-provider-otel-collector / hosting-provider-otel-collector (pull_request) Successful in 12s
nixosConfigurations-operator-lldap / operator-lldap (pull_request) Successful in 12s
nixosConfigurations-hosting-provider-windmill / hosting-provider-windmill (pull_request) Successful in 13s
nixosConfigurations-operator-smtp / operator-smtp (pull_request) Successful in 13s
nix-unit-resources-generateFiles / resources-generateFiles (pull_request) Successful in 29s
nix-unit-resources-secrets / resources-secrets (pull_request) Successful in 26s
nix-unit-resources-otel / resources-otel (pull_request) Successful in 32s
Nix flake completeness check / _complete (pull_request) Successful in 1m24s
flake-show / apps-ssh (pull_request) Successful in 1m49s
checks-docs / docs (pull_request) Failing after 3m16s
checks-apps-api / apps-api (pull_request) Successful in 39m6s
2026-06-18 18:40:58 +02:00
Compare
kiara changed title from WIP: persist api-http-stack deployment state across restarts to persist api-http-stack deployment state across restarts 2026-06-18 18:48:52 +02:00
kiara merged commit 674b0127c0 into main 2026-06-18 18:48:59 +02:00
kiara deleted branch api-http-stack-persist-state 2026-06-18 18:49:00 +02:00
Author
Owner

failing docs build seems unrelated, see #1080

failing docs build seems unrelated, see #1080
Sign in to join this conversation.
No reviewers
fediversity/developers
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
fediversity/fediversity!1096
No description provided.