Skip to content

fix(workspace): preserve module source backing - #14042

Merged
shykes merged 4 commits into
dagger:mainfrom
vito:fix/workspace-module-source
Sep 4, 2026
Merged

fix(workspace): preserve module source backing#14042
shykes merged 4 commits into
dagger:mainfrom
vito:fix/workspace-module-source

Conversation

@vito

@vito vito commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • preserve LOCAL_SOURCE and GIT_SOURCE backing when loading a module with Workspace.moduleSource, while genuine directory workspaces remain DIR_SOURCE
  • route module config, filtered context, local dependencies, files, and .env reads through the originating workspace so staged changes and the workspace owner's host route survive
  • introduce a common ModuleSourceFS boundary and shared configured-source initializer for local, Git, Directory, and Workspace-backed sources
  • resolve SDK client targets through the canonical Workspace.moduleSource path and support dependency authoring for directory-backed module sources without collapsing distinct sources

Test plan

  • go test ./core ./core/schema
  • dagger 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

vito added 4 commits September 3, 2026 19:25
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
shykes merged commit 44f87a3 into dagger:main Sep 4, 2026
89 checks passed
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.

Workspace.moduleSource should preserve workspace backing instead of materializing DIR_SOURCE

2 participants