Builder::Remote.inspect_builder requires both checks to pass#1611
Merged
djmb merged 1 commit intobasecamp:mainfrom Aug 11, 2025
Merged
Builder::Remote.inspect_builder requires both checks to pass#1611djmb merged 1 commit intobasecamp:mainfrom
Builder::Remote.inspect_builder requires both checks to pass#1611djmb merged 1 commit intobasecamp:mainfrom
Conversation
35148fd to
887ffac
Compare
Previously, if either of the builder or the remote context were in a bad state, the build would proceed anyway and fail.
887ffac to
8e470ed
Compare
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.
This change updates
Builder::Remote#inspect_builderto require that the checks for the builder and the remote context both pass in order for the inspection to succeed.Previously, if exactly one of the builder or the remote context were in a bad state, the build would proceed anyway and fail.
Reproduction
To reproduce the troublesome scenario, set up a remote builder, and then remove the remote context.
So if you have this builder and context:
then run
docker context rm kamal-remote-ssh---app-docker-builder-102-context. At this point, the builder check succeeds:and the remote context check would fail if it was checked:
But since the builder check passes, the remove context is never checked. And so the build continues and fails:
With the change in this PR, the check successfully fails, and the builder and remote context are both cleaned up and recreated:
Test coverage
Currently there doesn't appear to be any test coverage for the builder inspection, since the "build create" command is separate from the inspection/creation logic in "build push".
I think it would be nice if the same inspection/creation logic was used in both commands, but that feels a little out of scope for this bug fix. LMK if you'd like to see a pull request that does that!
But in the meantime, the test I added is pretty blunt and checks for the presence of the entire inspection command, with a "&&" joining the first two clauses.