Skip to content

Bake: pick the build box by its Hetzner server_id - #290

Merged
vsilent merged 1 commit into
devfrom
feature/bake-server-id
Oct 16, 2026
Merged

vsilent merged 1 commit into
devfrom
feature/bake-server-id

Conversation

@vsilent

@vsilent vsilent commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator

POST /api/admin/bake refused any deployment whose project holds more than one server record. Every deploy --force-new adds one, and Hetzner gives a new box an old box's IP, so after a few attempts a project could not be baked at all.

The request now takes an optional server_id - the Hetzner id, as the bake binary takes it. With several records, the endpoint asks Hetzner which server sits at each record's IP, uses the newest record at the IP where Hetzner has that id, and refuses with 409 when none matches - nothing on a box is touched until Hetzner confirms it. A single-server project behaves as before; a server_id given there must match too.

Tests (tests/admin_bake.rs): several records without server_id -> 409; an unknown id -> 409, no job; the right id -> 202 on the newest record at the box's IP. The new case fails against the old endpoint (more than one server) and passes now. Full suite: 2872 passed, 36 skipped.

🤖 Generated with Claude Code

https://claude.ai/code/session_012TKZy6f5shPzM9WLdswH6f

Every `deploy --force-new` leaves a server record in the project, and
Hetzner hands a new box an old box's IP, so a project soon holds several
servers and POST /api/admin/bake refused them all. The request now takes
an optional server_id - the Hetzner id, as the bake binary takes it - and
uses the newest record at the IP where Hetzner has that server. Nothing
is touched unless Hetzner confirms the id at one of the project's IPs; a
single-server project behaves as before.

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