Uh oh!
There was an error while loading. Please reload this page.
fix: render runtime-access.sql into the service-dir build context (#70) - #71
Merged
antoinetoussaint-byte merged 1 commit intoAug 23, 2026
Conversation
antoinetoussaint-byteforce-pushed
the
issue-70-0-0-126-generated-dockerfile-copys-runtime-access
branch
from
August 23, 2026 23:43
2cc8483 to
f7430cdCompareThe CLI resolves the recipe's "." context to the service directory but resolves the Dockerfile against the recipe output directory, so `codefly build service` builds with the service dir as context. buildRecipe rendered runtime-access.sql only into the recipe tree, so nothing sat at the service-dir root the Dockerfile COPYs it from and the build failed with `COPY runtime-access.sql ... "/runtime-access.sql": not found`. Render it into the service dir too, beside the already-committed migrations/, so the COPY resolves — mirroring how migrations/ lives in both the service dir and the recipe tree. Correct the buildRecipe doc comment, which still claimed "the context is the recipe tree itself" — the exact wrong model behind this regression and #68. Because the build now writes a generated runtime-access.sql into the consumer's service directory on every run, scaffold a .gitignore in the factory so it is not left as untracked noise beside the committed migrations/. Embed the factory tree with `all:` so the .gitignore dotfile is carried in (plain go:embed skips dotfiles and would drop it silently). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
antoinetoussaint-byteforce-pushed
the
issue-70-0-0-126-generated-dockerfile-copys-runtime-access
branch
from
August 23, 2026 23:51
f7430cd to
3f57c0fCompareUh 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#70.
Summary
codefly build servicebuilds with the service directory as the docker context: the CLI (cli@v0.1.139) resolves the recipe'sContext: "."to the service dir while resolving the Dockerfile against the recipe output dir. The bootstrap Dockerfile COPYsruntime-access.sqlroot-relative, butbuildReciperendered it only into the recipe tree — nothing landed at the service-dir root, so the build failed withCOPY runtime-access.sql … "/runtime-access.sql": not found.runtime-access.sqlinto the service dir too, beside the already-committedmigrations/, so the COPY the CLI runs resolves — mirroring howmigrations/already lives in both the service dir and the recipe tree. The recipe tree keeps its own copy so the emitted artifact stays a self-contained buildable context.Test plan
go test ./ -run 'TestBuild|Bootstrap|RuntimeAccess'— passes;TestBuildEmitsRecipeToOutputDirectorynow assertsruntime-access.sqlat the service-dir context root as well as in the recipe tree.go build ./andgo vet ./— clean.codefly agent build --native-only --skip-audit, thencodefly build service --local-agentson a postgres service withspec.runtime-read-write-roles— expectCOPY runtime-access.sql … DONEand the image to export.