Uh oh!
There was an error while loading. Please reload this page.
feat: emit build recipe when CLI owns the docker build (#63) - #64
Merged
antoinetoussaint-byte merged 2 commits intoAug 23, 2026
Merged
Conversation
When BuildRequest.output_directory is set, render the bootstrap image's Dockerfile and build context there and return a DockerBuildPlan instead of running docker in-process. The CLI builds the recipe multi-arch and pushes a manifest list; the legacy in-agent build stays for the empty case. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ipe (#63) buildRecipe only emptied the builder/ and migrations/ subdirs, but BuildDockerBuildPlan inventories the whole output directory and the recipe context is its root (COPY .). Any content a caller left in a reused or pre-populated output directory therefore leaked into the plan digest and the built image — e.g. stale migrations survived a switch to no-migration. Empty the whole directory the agent owns before rendering, matching the deployment emitter (GenerateGenericKustomize). copyTree skips directory entries, so an enabled-but-empty migrations directory produced a context with no migrations/ at all, and the Dockerfile's COPY migrations failed at buildx — a state the legacy in-agent build handled. Provision the migrations directory explicitly so COPY resolves even with no migrations authored yet. Add regression tests for both: a pre-populated output directory must be purged, and an empty migrations source must still yield a migrations directory. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Uh oh!
There was an error while loading. Please reload this page.
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 freeto 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.
Closes#63.
Summary
WithDockerImages— the "agent with its own docker build" triage case. It now emits aDockerBuildPlanwhen the CLI supplies anoutput_directory, so the image becomes a durable, reproducible recipe the CLI builds multi-arch (linux/amd64 + linux/arm64) without needing the agent toolchain.v0.3.4 → v0.3.6for the recipe contract and helpers (BuildDockerBuildPlan,WithBuildPlan).docker buildis unchanged and still runs whenoutput_directoryis empty, so the CLI's response-type negotiation keeps working.The recipe context is the recipe tree itself: the rendered
builder/files (Dockerfile +runtime-access.sql) plus the migrations the image applies at bootstrap. Core'sSingleImageBuildPlan/RecipeBuildPlatformsconvenience helpers named in the issue are not in the released core (v0.3.6 is the latest tag and its shared runners don't yet emit plans), so the migration uses the released primitives directly with the same result.Test plan
go test ./... -skip '^TestCreateToRunDocker$'(matches CI) — greenTestBuildEmitsRecipeToOutputDirectory: Build withoutput_directoryreturns aDockerBuildPlan(single recipe,builder/Dockerfile, context., both platforms), writes a self-contained tree (builder + migrations), and the emitted plan verifies against that tree viaVerifyDockerBuildPlan.TestBuildRecipeOmitsMigrationsWhenDisabled: with migrations disabled the recipe omits the migrations tree and still verifies.docker buildx build --platform linux/amd64 -f builder/Dockerfile .from the emitted output directory.