begin-testbox: self-terminate when phone-home is rejected by the backend#10
Open
taha-au wants to merge 1 commit into
Open
begin-testbox: self-terminate when phone-home is rejected by the backend#10taha-au wants to merge 1 commit into
taha-au wants to merge 1 commit into
Conversation
Co-authored-by: Codesmith <codesmith-bot@users.noreply.github.com>
pbardea
approved these changes
Jun 11, 2026
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.
When a testbox is dispatched against one backend environment but the runner is served by the other (staging vs production), the hydrating phone-home reaches a backend that has no record of the testbox. Today that 404 is swallowed by
curl -fand treated the same as a network blip: the action continues in degraded mode and the runner idles until the timeout, while the CLI hangs against the dispatching backend. This PR makes the testbox self-terminate on a definitive backend rejection.How it works:
-w "%{http_code}") and body separately instead of collapsing all failures via-f.::error::annotations, remove the state directory, and exit 1. The failed step fails the job, andrun-testbox(even withif: always()) exits immediately when the state directory is missing, so the VM terminates right away instead of waiting out the idle timeout.This is the defensive complement to the dispatch-time guard in useblacksmith/web (the backend now rejects cross-environment runner labels at warmup). The success path is byte-for-byte unchanged, and yamllint passes. After merge, the
v2tag needs to be moved to pick this up.Need help on this PR? Tag
/codesmithwith what you need. Autofix is enabled.Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled. (Staging)