fix(workspace): preserve module source backing - #14042
Merged
Merged
Conversation
Keep Workspace.moduleSource tied to its originating Workspace for local and Git-backed sources instead of converting every workspace to a directory. Route config, context, dependency, and file reads through the Workspace so overlays and host ownership survive. Teach directory-backed module sources to author dependency lists without collapsing distinct clients, and make SDK client resolution use the canonical Workspace.moduleSource path. Closes dagger#14040 Signed-off-by: Alex Suraci <alex@dagger.io>
Route module source stat, reads, and context loading through ModuleSourceFS. Share config parsing, SDK loading, dependency resolution, and defaults across local, Git, Directory, and Workspace-backed sources. This removes workspace-specific loading plumbing and keeps backing-source differences at the filesystem boundary. Signed-off-by: Alex Suraci <alex@dagger.io>
SDK client module references are normalized to workspace-root coordinates before loading. Anchor them when calling Workspace.moduleSource so a non-root workspace cwd is not applied a second time. Signed-off-by: Alex Suraci <alex@dagger.io>
Resolve contextual GitRepository and GitRef arguments from a Git workspace's retained source ref instead of its .git-free filesystem tree. Pin the derived repository to the workspace ref while preserving its credentials and services. Signed-off-by: Alex Suraci <alex@dagger.io>
shykes
approved these changes
Sep 4, 2026
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.
Summary
LOCAL_SOURCEandGIT_SOURCEbacking when loading a module withWorkspace.moduleSource, while genuine directory workspaces remainDIR_SOURCE.envreads through the originating workspace so staged changes and the workspace owner's host route surviveModuleSourceFSboundary and shared configured-source initializer for local, Git, Directory, and Workspace-backed sourcesWorkspace.moduleSourcepath and support dependency authoring for directory-backed module sources without collapsing distinct sourcesTest plan
go test ./core ./core/schemadagger api call engine-dev test --pkg ./core/integration --run='TestWorkspaceAPI/(TestModuleSourceResolvesWorkspacePaths|TestModuleSourcePreservesWorkspaceBacking|TestGitWorkspaceModuleSourcePreservesKind)'dagger api call engine-dev test --pkg ./core/integration --run='Test(ModuleLoading|WorkspaceCompat|Agents|ContextualWorkspace|Generators)/(TestModuleSourceResolution|TestOuterEnvFile|TestModuleWithDash|TestOverlayModuleSource(IsResolvedThroughOverlay|Edit)|TestContextualWorkspaceModuleSourceLocalDeps|TestCurrentModuleAsSDKClientModuleSourceField)'dagger api call engine-dev test --pkg ./core/integration --run='TestGenerators/(TestAPIClientInitDottedModulePath|TestInitFromSubdirectoryCwd|TestInitFromSubdirectoryWorkspace)'Closes #14040