Repository navigation
Bake: pick the build box by its Hetzner server_id - #290
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
POST /api/admin/bakerefused any deployment whose project holds more than one server record. Everydeploy --force-newadds 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 thebakebinary 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; aserver_idgiven there must match too.Tests (
tests/admin_bake.rs): several records withoutserver_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