Skip to content

fix(builder): correct SingleImageBuildPlan recipe paths (hotfix v0.3.7) - #339

Merged
antoinetoussaint-byte merged 1 commit into
mainfrom
fix/recipe-output-directory-paths
Aug 22, 2026
Merged

fix(builder): correct SingleImageBuildPlan recipe paths (hotfix v0.3.7)#339
antoinetoussaint-byte merged 1 commit into
mainfrom
fix/recipe-output-directory-paths

Conversation

@antoinetoussaint-byte

Copy link
Copy Markdown
Contributor

Why

v0.3.7 shipped the recipe contract from #336, but SingleImageBuildPlan emits recipe paths under a builder/ subdirectory (Dockerfile: "builder/Dockerfile", builder/dockerignore). That does not match the already-implemented CLI consumer, which passes output_directory = <serviceDir>/builder and resolves recipe paths relative to it (recipeDockerfile(outputDir, {Dockerfile: "Dockerfile"}), context . → the service dir).

Result: any CLI-owned recipe build resolves the Dockerfile to <serviceDir>/builder/builder/Dockerfile, which doesn't exist, and hard-fails validateRecipes. No CLI branch has pinned v0.3.7 yet, so nothing is broken in the wild — this corrects it before that happens.

What

  • SingleImageBuildPlan emits Dockerfile / dockerignorerelative to output_directory (no builder/ prefix), matching the CLI contract. The runner already renders the Dockerfile to location/builder/Dockerfile, which isoutput_directory/Dockerfile.
  • Detect the dockerignore with os.Lstat (consistent with the inventory's blanket symlink rejection).
  • Warn instead of silently skipping when recipe emission is requested but a custom Docker context root forces the legacy in-process build.
  • Document why RecipeBuildPlatforms is a fixed multi-arch set and does not read CODEFLY_BUILD_PLATFORM.
  • Fix the unit test that pinned the old layout (it constructed a tree the CLI never produces — a false green).

Test

go test ./agents/services/ ./runners/golang/ ./runners/rust/ green on Go 1.27.

🤖 Generated with Claude Code

…ory contract
The CLI (the recipe consumer) passes output_directory = <serviceDir>/builder and
resolves recipe paths relative to it, with the build context "." mapping to the
service directory. SingleImageBuildPlan emitted "builder/Dockerfile" and
"builder/dockerignore" instead, so every recipe build failed validateRecipes
against the real caller. Emit the Dockerfile and dockerignore relative to
output_directory to match; the unit test that pinned the old layout was a false
green (it constructed a tree the CLI never produces).
Also from the review:
- Detect the dockerignore with Lstat, consistent with the inventory's blanket
symlink rejection, so a symlinked dockerignore never enters the recipe.
- Warn instead of silently skipping when recipe emission was requested but a
custom Docker context root forces the legacy in-process build.
- Document why RecipeBuildPlatforms is a fixed multi-arch set and deliberately
does not read the single-platform CODEFLY_BUILD_PLATFORM override.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@antoinetoussaint-byte
antoinetoussaint-byte merged commit f133f0f into mainAug 22, 2026
1 check failed
@antoinetoussaint-byte
antoinetoussaint-byte deleted the fix/recipe-output-directory-paths branch August 22, 2026 16:28
Sign up for freeto 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.

1 participant

@antoinetoussaint-byte