Repository navigation
feat(polyfill): support dagger-module.toml in workspace module generation - #7
Merged
Merged
Conversation
…tion The workspace-module-generate helper only recognized legacy dagger.json when building the source view for a workspace module, so generating an SDK module configured with dagger-module.toml (the current cli-1.0 format) failed with "module source dagger.json not found". Detect dagger-module.toml first, falling back to dagger.json. The module directory is already loaded via "**", so for dagger-module.toml modules the helper only needs to confirm the module exists; the engine resolves its includes and dependencies when the source is loaded. Signed-off-by: Yves Brissaud <[email protected]>
This was referenced Jun 19, 2026
mod-test runs black-box checks. It creates a container, downloads a Dagger CLI into that container, and then uses that downloaded CLI to call small fixture modules. Before this change, the downloaded CLI version was latest. Today latest means the stable v0.21 CLI. These fixtures are meant to cover the CLI 1.0 workspace/module behavior, so running them with v0.21 tests the wrong product shape. Pin the downloaded CLI to the published 1.0.0-beta.3 artifact. This only changes the CLI binary used inside these fixture tests. It does not change the sdk-sdk module engine version or the production helper code. The fixture modules live below their fixture directories, but the downloaded CLI starts from /work. Some fixture calls take a Workspace! argument, and that workspace is resolved from the current working directory before the -m fixture module is loaded. For those calls, /work must have a module config. Build the test view so the fixture module config also appears at /work/dagger.json. That makes /work a valid workspace root while keeping the fixture config as the single source of truth. The test still selects the fixture module with -m; the temporary view only gives the inner CLI a valid starting workspace. Signed-off-by: Guillaume de Rouville <[email protected]>
workspace-module-generate is built from Go source when the module runs. The checked-in binary is build output, not source, and makes the PR harder to review. Remove it. Signed-off-by: Guillaume de Rouville <[email protected]>
tiborvass
approved these changes
Jun 19, 2026
eunomie
added a commit
that referenced
this pull request
Jun 25, 2026
#7 added dagger-module.toml support to workspace-module-generate but, for toml modules, returned an empty source config on the assumption that the engine resolves includes and dependencies when the source is loaded. That holds for a module's own files (loaded via "**"), but not for local directory dependencies: their directories live outside the module and must be added to the loaded context explicitly, or the engine fails with "dir module source does not contain a dagger config file" during dagger generate. Parse the dagger-module.toml dependencies (and include) so moduleSourceInclude recurses into local dir dependencies and pulls their directories into the loaded context. Signed-off-by: Yves Brissaud <[email protected]>
eunomie
added a commit
that referenced
this pull request
Jun 26, 2026
#7 added dagger-module.toml support to workspace-module-generate but, for toml modules, returned an empty source config on the assumption that the engine resolves includes and dependencies when the source is loaded. That holds for a module's own files (loaded via "**"), but not for local directory dependencies: their directories live outside the module and must be added to the loaded context explicitly, or the engine fails with "dir module source does not contain a dagger config file" during dagger generate. Parse the dagger-module.toml dependencies (and include) so moduleSourceInclude recurses into local dir dependencies and pulls their directories into the loaded context. Signed-off-by: Yves Brissaud <[email protected]>
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.
Problem
On
design/cli-1.0,generate-allfor any SDK (go/python/typescript) silently fails to regenerate workspace-managed modules. After discovery is fixed (see below), generation still fails withmodule source dagger.json not found, because theworkspace-module-generatepolyfill helper only recognizes the legacydagger.jsonconfig when building a workspace module's source view — but cli-1.0 modules usedagger-module.toml.Change
workspaceModuleSourceIncludenow detectsdagger-module.tomlfirst, falling back todagger.json. The module directory is already loaded via**, so fordagger-module.tomlmodules the helper only needs to confirm the module exists; the engine resolves the module's includes/dependencies when it loads the source.go build+ helper tests pass. Verified end-to-end against a dev engine (deleting a Go SDK module'sinternal/thendagger generate go-sdk:generate-allrestores it).Context
Part of fixing the cli-1.0 empty-changeset bug. Companion changes:
CurrentModule.asSDK— feat(core): add CurrentModule.asSDK for SDK-owned module discovery dagger#13522generateAlldiscovers managed modules viacurrentModule.asSDK.Depends on the engine
asSDKAPI (#13522) being available in the engine these SDKs run against.