Update sdk-sdk to the CLI 1.0 SDK contract#11
Open
shykes wants to merge 3 commits into
Open
Conversation
The engine now owns module bookkeeping (dagger-module.toml, workspace config, dependency and engine-version edits), so an SDK helper module implements only what is language-specific. - Replace init/mod/Mod.dependencies/Mod.engine with initModule, which seeds only the SDK's own files and never writes engine-owned config. - Scaffold skeleton and fixture now expose initModule plus a @generate hook that discovers managed modules via currentModule.asSDK.modules. - Rewrite the contract checks around the new surface; drop the Go-SDK deps alias and the obsolete mod/deps/engine coverage. - mod-test: add list assertion helpers and bump the pinned CLI to 1.0.0-beta.5. Generation is left as a @generate no-op for now: engine-native per-module generation cannot reach the host session from inside a module function, so the mechanism is deferred.
- initModuleDoesNotWriteConfig: also assert the black-box target does not write dagger-module.toml, not just dagger.json. - initModuleHonorsCustomPath: assert seeded files land under the requested --path (via the directory marker) instead of merely being non-empty. A fixture that ignores --path now fails the check; verified by breaking the fixture. - init-template: default `path` to "." for consistency with the fixture and sdk-sdk's own initModule.
Fold single-use helpers/constants into their one call site: - workspaceRootedView -> inlined into target - selfModule / selfFixturePath / noSdkModuleMessage -> inlined into targetModule - defaultInitConfig / defaultInitModuleConfig -> derived inline in the check - fixture seed() -> inlined into initModule Multi-use helpers (target, targetModule, defaultInit) and helpers that encapsulate real logic (cleanModulePath, renderedInitTemplate) are kept, as is the template's seed(), which is a documented author customization point.
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.
Updates sdk-sdk to the new SDK contract from Dagger 1.0.0-beta.5.
The engine now handles module setup (config files, workspace entries, deps, engine version). So an SDK only has to do the language-specific parts.
What changed:
init→initModule: only writes the SDK's own files, notdagger.json.mod,dependencies, andengine— the engine owns those now.@generatehook (finds managed modules viacurrentModule.asSDK.modules).1.0.0-beta.5.Not done yet:
generateis currently a no-op placeholder. Real generation is blocked by an engine limitation (a module can't reach the host session to load other modules), so it's left as a follow-up.Checks pass under beta.5.