Repository navigation
feat: discover managed modules via CurrentModule.asSDK - #5
Merged
Merged
Conversation
generateAll discovered modules by scanning the workspace for legacy dagger.json files with sdk.source "typescript". cli-1.0 workspace modules use dagger-module.toml and are tracked in [[modules.<sdk>.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 <[email protected]>
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.20 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 TypeScript modules contain. It makes the SDK helper module load against the schema it now uses. Signed-off-by: Guillaume de Rouville <[email protected]>
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 TypeScript 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 typescript`: the SDK owns a set of modules recorded under [[modules.typescript-sdk.as-sdk.modules]]. The SDK root also exposes @generate functions. Unqualified `dagger check` treats those generators as checks and would fail because typescript-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 <[email protected]>
tiborvass
approved these changes
Jun 20, 2026
tiborvass
left a comment
Contributor
There was a problem hiding this comment.
@grouville updated the PR description, explained the chicken n egg problem in Dependency Cycle, it was tested locally, we're going ahead and merging it.
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.
Why
On the CLI 1.0 branch,
dagger generatecould return an empty changeset for modules managed by the TypeScript SDK.The bug was in module discovery.
generateAllstill found modules by scanning the workspace for legacydagger.jsonfiles whosesdk.sourcewastypescript. CLI 1.0 modules usedagger-module.toml, and the workspace records SDK ownership under[[modules.<sdk>.as-sdk.modules]], so the old scan can miss the modules the SDK is supposed to generate.What Changed
Use
currentModule.asSDK.modulesas the source of truth for managed TypeScript modules, then feed those paths into the existingMod(...).generateflow.This means the SDK generates the modules explicitly assigned to it by the workspace, instead of guessing by walking config files.
This PR also updates the e2e workspace so the local TypeScript SDK is installed as an SDK during tests. That matters because
currentModule.asSDK.modulesonly exists when the workspace has anas-sdkregistration, which is the same shape users get fromdagger sdk install typescript.Dependency Cycle
There is a small chicken-and-egg here.
This PR needs the new engine API from
dagger/dagger#13522becausecurrentModule.asSDK.modulesis not available in the released beta yet. At the same time, the Dagger engine resolves the built-in TypeScript SDK fromgithub.com/dagger/typescript-sdk, so the beta 4 engine should pick up this SDK change when it ships.So CI may need the beta 4 engine before it can prove this PR by itself. I validated it locally against the current beta-4-ish dev engine built from the Dagger branch.
Shared dependency:
dagger/sdk-sdk#7, fordagger-module.tomlsupport in the shared polyfill helperEngine dependency:
dagger/dagger#13522, forCurrentModule.asSDKValidation
Focused TypeScript SDK e2e checks against the local dev engine:
target-runtime-check: https://dagger.cloud/dagger/traces/37a634b69fec40e5e05a6f166749bce0modules-check: https://dagger.cloud/dagger/traces/99cc7d10742a0ecbc2eab2a0b681a573generate-check: https://dagger.cloud/dagger/traces/8b0057bf964815597e55ec95db8b4291generate-all-check: https://dagger.cloud/dagger/traces/e480cc270f58a9936f7ffa07327fe3f5Full TypeScript SDK
dagger checkagainst the local dev engine: