Skip to content

python-sdk: report only what generation produced - #18

Draft
eunomie wants to merge 1 commit into
dagger:mainfrom
eunomie:python-sdk-generate-context-changeset
Draft

python-sdk: report only what generation produced#18
eunomie wants to merge 1 commit into
dagger:mainfrom
eunomie:python-sdk-generate-context-changeset

Conversation

@eunomie

@eunomie eunomie commented Aug 21, 2026

Copy link
Copy Markdown
Member

Follow-up to #14, which merged before this landed.

Generation used moduleSource(...).generate(ws).changes(ws). On
v1.0.0-beta.10, Workspace.changes(from:) reads a file that exists only on the
sparse host base as newly added, so that idiom described the workspace base as
well as the generated context: every generate and generateAll claimed to add
the module's own dagger.json, which the engine owns and had not touched. The
engine's own generatedContextChangeset does not contain it.

Take the generated context straight from the engine and re-root it at the
caller's cwd by hand, raising rather than silently dropping a path that falls
outside the cwd. generatedContextChangeset does not resolve the local
dependency closure the way generate(ws) did, so generation stages it
explicitly again, and generateAll merges each module's changeset instead of
threading one workspace through all of them.

e-2-e:generate-skips-engine-config-check pins the behaviour; it fails on the
previous idiom with "generate reported the engine-owned dagger.json as added".

Root cause is workspaceChangesBetween in core/schema/workspace.go, where the
from side carries no overlay. The engine fix is in flight; revert to the native
idiom once it lands.

dagger check: 37/37.

Workspace.changes(from:) reads a file that exists only on the sparse host base
as newly added, so generate(ws).changes(ws) described the workspace base as well
as the generated context: every generate claimed to add the module's own
dagger.json, which the engine owns and had not touched. Traced to
workspaceChangesBetween in core/schema/workspace.go, where the `from` side
carries no overlay; the engine fix is in flight.

Take the generated context straight from the engine, which computes it
correctly, and re-root it at the caller's cwd by hand. Generation stages its own
local dependency closure again, since generatedContextChangeset does not resolve
it the way generate(ws) did, and generateAll merges each module's changeset
rather than threading one workspace through all of them.

Re-rooting cannot express a path outside the cwd, so a changeset holding one
raises instead of silently dropping it and leaving that module ungenerated.

Revert to the native idiom once the engine reports a sparse base correctly.

Signed-off-by: Yves Brissaud <yves@dagger.io>
Sign up for free to 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