Skip to content

Update sdk-sdk to the CLI 1.0 SDK contract#11

Open
shykes wants to merge 3 commits into
mainfrom
update-sdk-contract-cli-1.0
Open

Update sdk-sdk to the CLI 1.0 SDK contract#11
shykes wants to merge 3 commits into
mainfrom
update-sdk-contract-cli-1.0

Conversation

@shykes

@shykes shykes commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

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:

  • initinitModule: only writes the SDK's own files, not dagger.json.
  • Removed mod, dependencies, and engine — the engine owns those now.
  • Added a @generate hook (finds managed modules via currentModule.asSDK.modules).
  • Rewrote the contract checks for the new API.
  • Bumped the test CLI to 1.0.0-beta.5.

Not done yet: generate is 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.

shykes added 2 commits July 7, 2026 19:43
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.
@shykes shykes marked this pull request as ready for review July 7, 2026 21:31
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.
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.

1 participant