python-sdk: report only what generation produced - #18
Draft
eunomie wants to merge 1 commit into
Draft
Conversation
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>
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.
Follow-up to #14, which merged before this landed.
Generation used
moduleSource(...).generate(ws).changes(ws). Onv1.0.0-beta.10,Workspace.changes(from:)reads a file that exists only on thesparse host base as newly added, so that idiom described the workspace base as
well as the generated context: every
generateandgenerateAllclaimed to addthe module's own
dagger.json, which the engine owns and had not touched. Theengine's own
generatedContextChangesetdoes 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.
generatedContextChangesetdoes not resolve the localdependency closure the way
generate(ws)did, so generation stages itexplicitly again, and
generateAllmerges each module's changeset instead ofthreading one workspace through all of them.
e-2-e:generate-skips-engine-config-checkpins the behaviour; it fails on theprevious idiom with "generate reported the engine-owned dagger.json as added".
Root cause is
workspaceChangesBetweenincore/schema/workspace.go, where thefromside carries no overlay. The engine fix is in flight; revert to the nativeidiom once it lands.
dagger check: 37/37.