Skip to content

Record the bake server type; validate returns it with the rates - #291

Merged
vsilent merged 1 commit into
devfrom
feature/quick-deploy-server-type
Oct 16, 2026
Merged

vsilent merged 1 commit into
devfrom
feature/quick-deploy-server-type

Conversation

@vsilent

@vsilent vsilent commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator

A Quick Deploy clones a baked snapshot, and the snapshot carries the disk of the server type it was baked on. Until now that type was not recorded, so a clone could be offered and priced as a smaller type.

  • Migration: baked_snapshots.server_type TEXT NULL (older snapshots stay NULL).
  • Admin bake records the build box's server type. The CLI bake does not know it and records NULL.
  • POST /api/v1/deploy/validate returns quick_deploy { server_type, rates }: the type of the snapshot a clone would use (exact version when the stacker.yml pins one, else the latest) and the daily rate / monthly cap of every server type from server_type_daily_rate. Without a pool (unit tests) it returns null and no rates.

Tests: tests/quick_deploy_server_type.rs (red first). Full nextest 2874 passed / 0 failed / 36 skipped; BDD 334/334. cargo clippy -D warnings already fails on dev with the current toolchain (build.rs, td-audit, others); none in the files changed here.

After deploy, snapshots baked before this need their type set by hand, e.g. UPDATE baked_snapshots SET server_type = 'cpx42' WHERE id = <id>;

🤖 Generated with Claude Code

https://claude.ai/code/session_012TKZy6f5shPzM9WLdswH6f

The bake stores the build box server type on the snapshot.
POST /api/v1/deploy/validate returns quick_deploy {server_type, rates}: the
type of the snapshot a clone of the stack uses, and every type daily rate
and monthly cap, so the price shown matches the type deployed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012TKZy6f5shPzM9WLdswH6f
@vsilent
vsilent merged commit b755c1f into dev Oct 16, 2026
10 checks passed
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.

2 participants