From 336e528f90ea17cd18295aeb4a1c8a230e7f7c0b Mon Sep 17 00:00:00 2001 From: Yves Brissaud Date: Fri, 19 Jun 2026 18:09:27 +0200 Subject: [PATCH 1/3] feat: discover managed modules via CurrentModule.asSDK generateAll discovered modules by scanning the workspace for legacy dagger.json files with sdk.source "python". cli-1.0 workspace modules use dagger-module.toml and are tracked in [[modules..as-sdk.modules]], so that scan finds nothing and generate-all returns an empty changeset. Discover managed modules from the engine's source of truth instead, via currentModule.asSDK.modules. Signed-off-by: Yves Brissaud --- python-sdk.dang | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python-sdk.dang b/python-sdk.dang index 2c53cc2..38dd7c6 100644 --- a/python-sdk.dang +++ b/python-sdk.dang @@ -211,7 +211,9 @@ type PythonSdk { pub generateAll(ws: Workspace!): Changeset! @generate { let pws = polyfill.workspace(ws) - modules(ws) + currentModule.asSDK.modules + .{path} + .map { m => Mod(path: m.path, ws: ws, skipGenerateFilename: skipGenerateFilename) } .filter { mod => mod.skipGenerate == false } .reduce(pws.fork) { fork, mod => fork.merge(pws.moduleSource(mod.path).generate) From 71699bb759ceaf1818c93e491205bed70fb6a702 Mon Sep 17 00:00:00 2001 From: Guillaume de Rouville Date: Fri, 19 Jun 2026 17:19:57 -0700 Subject: [PATCH 2/3] chore: run SDK module on CLI 1.0 schema Problem: generateAll now reads currentModule.asSDK.modules. That field is part of the CLI 1.0 schema view, so this SDK module has to load with a v1 engine contract. Leaving the module on the v0.21 schema makes the new discovery path fail before the generator logic can run. Change: - set engineVersion to v1.0.0-0 - pin polyfill to the sdk-sdk commit that handles dagger-module.toml - update Dang field projections to the v1 syntax This does not change what generated Python modules contain. It makes the SDK helper module load against the schema it now uses. Signed-off-by: Guillaume de Rouville --- dagger.json | 6 +++--- python-sdk.dang | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dagger.json b/dagger.json index 0cae831..6abd9fb 100644 --- a/dagger.json +++ b/dagger.json @@ -1,14 +1,14 @@ { "name": "python-sdk", - "engineVersion": "v0.21.3", + "engineVersion": "v1.0.0-0", "sdk": { "source": "dang" }, "dependencies": [ { "name": "polyfill", - "source": "https://github.com/dagger/sdk-sdk/polyfill@main", - "pin": "d1532df4f7d322a7bdab02487accde9d21bbb464" + "source": "github.com/dagger/sdk-sdk/polyfill@main", + "pin": "90ecbe40419359f01cef02a495e0d568648c92fb" } ] } diff --git a/python-sdk.dang b/python-sdk.dang index 38dd7c6..f5dc7a5 100644 --- a/python-sdk.dang +++ b/python-sdk.dang @@ -28,7 +28,7 @@ type PythonSdk { multiline: true, dotall: true, ) - .{filePath} + .{{filePath}} .map { configPath => mod( ws, @@ -86,7 +86,7 @@ type PythonSdk { dotall: true, limit: 1, ) - .{id} + .{{id}} .length == 0 ) { raise "Dagger module does not use the Python SDK: " + path @@ -212,7 +212,7 @@ type PythonSdk { let pws = polyfill.workspace(ws) currentModule.asSDK.modules - .{path} + .{{path}} .map { m => Mod(path: m.path, ws: ws, skipGenerateFilename: skipGenerateFilename) } .filter { mod => mod.skipGenerate == false } .reduce(pws.fork) { fork, mod => From cf82ee7e82a1f9e6c076ad66216a33e59c64ede0 Mon Sep 17 00:00:00 2001 From: Guillaume de Rouville Date: Fri, 19 Jun 2026 17:20:07 -0700 Subject: [PATCH 3/3] test(e2e): install local SDK as an SDK Problem: The e2e workspace only loaded the e2e module. That was enough while generateAll scanned dagger.json files, but it no longer matches the CLI 1.0 contract. generateAll now reads currentModule.asSDK.modules, which only exists when the SDK module is installed in the workspace with an as-sdk entry. Change: Install the local Python SDK module in dagger.toml and list the fixture modules it manages. That makes the e2e workspace look like the user-facing flow after `dagger sdk install python`: the SDK owns a set of modules recorded under [[modules.python-sdk.as-sdk.modules]]. The SDK root also exposes @generate functions. Unqualified `dagger check` treats those generators as checks and would fail because python-sdk:generate-all produces fixture changes. Add check.skip = ["*"] on the SDK root entry so the repo's default check runs the e2e checks without treating the SDK helper's own generators as repo checks. The e2e module still calls generateAll directly, so coverage for the new discovery path remains. Signed-off-by: Guillaume de Rouville --- dagger.toml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/dagger.toml b/dagger.toml index eac285e..724adf6 100644 --- a/dagger.toml +++ b/dagger.toml @@ -8,3 +8,22 @@ [modules.e2e] source = ".dagger/modules/e2e" + +[modules.python-sdk] +source = "." +check.skip = ["*"] + +[modules.python-sdk.as-sdk] +name = "python" + +[[modules.python-sdk.as-sdk.modules]] +path = ".dagger/modules/e2e/fixtures/generate/app" + +[[modules.python-sdk.as-sdk.modules]] +path = ".dagger/modules/e2e/fixtures/lookup/app" + +[[modules.python-sdk.as-sdk.modules]] +path = ".dagger/modules/e2e/fixtures/deps/app" + +[[modules.python-sdk.as-sdk.modules]] +path = ".dagger/modules/e2e/fixtures/skip/app"