Skip to content

App Deployments (3b): customer ordering + lifecycle#223

Merged
v0l merged 1 commit into
masterfrom
feat/app-deployments-ordering
Jul 24, 2026
Merged

App Deployments (3b): customer ordering + lifecycle#223
v0l merged 1 commit into
masterfrom
feat/app-deployments-ordering

Conversation

@v0l

@v0l v0l commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

The customer-facing ordering flow — the payment-integrated core of the epic. Builds on the read-only API (#217), capacity (#222), and operator reconcile (#220).

Endpoints

  • POST /api/v1/app-deployments{ app_id, name, region_id, config }. Validates the DNS-safe name and the config against the app's compose config schema (required present, unknown rejected, defaults filled), admits it against the region's cluster capacity (select_in_region), then creates a Subscription + App line item + the deployment (pending). Config is stored encrypted.
  • PATCH /api/v1/app-deployments/{id}/stop|start — toggle desired_state (stop scales to 0, data retained).
  • DELETE /api/v1/app-deployments/{id} — deactivate the subscription (stop billing) + soft-delete (operator GCs the namespace/volumes).

Billing

Reuses the existing subscription engine — the renew flow already bills flat non-VPS line items, so App needs no special case. A new order is pending/unpaid; the customer pays via /api/v1/subscriptions/{id}/renew. The operator only runs paid (is_setup) + unexpired deployments, so an unpaid order stays at 0 replicas until paid.

Tests / docs

  • Unit: validate_deployment_name, resolve_config (required/unknown/default/override).
  • e2e: full ordering lifecycle (order → pending w/ subscription; name/config/capacity rejection; stop/start; delete → 404).
  • API_DOCUMENTATION.md + API_CHANGELOG.md.

Payment-adjacent — flagging for review of the subscription/line-item creation. No changes to the payment/invoice engine itself; App line items flow through the existing renew path.

Next

  1. seed launch apps (strfry / HAVEN / route96+MariaDB / Blossom).

Increment 3b of the App Deployments epic. Customers can now deploy apps.

- POST /api/v1/app-deployments: validate DNS-safe name + config (against the
  app's compose config schema), admit against the region's cluster capacity
  (AppClusterCapacityService::select_in_region), then create a Subscription +
  App line item + the deployment (pending). Config stored encrypted.
  Activated by paying the subscription via the standard flow — the renew
  engine already bills flat non-VPS line items, so App needs no special case.
- DELETE: deactivate the subscription (stop billing) + soft-delete (operator
  GCs the namespace/volumes). PATCH .../stop|start toggle desired_state.
  All ownership-checked.
- Operator: only run paid (subscription is_setup) + unexpired deployments, so
  an unpaid new order stays at 0 replicas until paid.
- Unit tests (validate_deployment_name, resolve_config) + e2e ordering test
  (order, name/config/capacity rejection, stop/start, delete). Docs + changelog.

Part of work/app-deployments.md.
@v0l
v0l merged commit 5c909a5 into master Jul 24, 2026
8 checks passed
@v0l
v0l deleted the feat/app-deployments-ordering branch July 24, 2026 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant