Skip to content

feat(core): add client-codegen schema primitives (v1.0.0-0) - #13646

Merged
TomChv merged 1 commit into
dagger:mainfrom
TomChv:feat/add-module-source-to-CurrentModuleAsSDKClient
Jul 16, 2026
Merged

TomChv merged 1 commit into
dagger:mainfrom
TomChv:feat/add-module-source-to-CurrentModuleAsSDKClient

Conversation

@TomChv

@TomChv TomChv commented Jul 15, 2026

Copy link
Copy Markdown
Member

Add two additive, v1.0.0-0-gated engine fields so a .dang SDK module can generate a client from plain data, rather than the engine driving client generation through the SDK runtime:

  • ModuleSource.clientSchemaIntrospectionJSON: the client-facing schema (hides no core types; promotes the module's own types to Query for self-bindings). The deps-load + self-promotion logic is extracted from runClientGenerator into a shared helper reused by both.
  • CurrentModuleAsSDKClient.moduleSource: resolves the bound module from its stored {module, pin} via resolveClientTargetModule, correct for local and remote/pinned refs alike (not a raw ref-string lookup).

These are the phase-1 primitives the companion client-codegen workflow consumes. The old engine-driven client path is intentionally left in place for now; the follow-up cleanup is tracked in hack/designs/client-codegen-engine-cleanup.md.

Add integration coverage in client_generator_test.go and regenerate the generated SDK bindings + GraphQL SDL.

@TomChv
TomChv requested review from a team as code owners July 15, 2026 09:56
@TomChv
TomChv force-pushed the feat/add-module-source-to-CurrentModuleAsSDKClient branch 3 times, most recently from 252c397 to c697fdd Compare July 15, 2026 11:21
@TomChv

TomChv commented Jul 15, 2026

Copy link
Copy Markdown
Member Author

We need the CI engine to use beta.6 in order to make that CI green

@TomChv
TomChv force-pushed the feat/add-module-source-to-CurrentModuleAsSDKClient branch 3 times, most recently from a7e3189 to 0b87b5b Compare July 15, 2026 16:27
@TomChv

TomChv commented Jul 15, 2026

Copy link
Copy Markdown
Member Author

PR rebased and regenerated with beta.6

@TomChv

TomChv commented Jul 15, 2026 •

Copy link
Copy Markdown
Member Author

Waiting for #13575 to be merged before merging that one

EDIT: it's merged :)

@TomChv
TomChv force-pushed the feat/add-module-source-to-CurrentModuleAsSDKClient branch 2 times, most recently from 6a9d041 to a2609c3 Compare July 16, 2026 11:15
Add two additive, v1.0.0-0-gated engine fields so a .dang SDK module can
generate a client from plain data, rather than the engine driving client
generation through the SDK runtime:

- ModuleSource.clientSchemaIntrospectionJSON: the client-facing schema
  (hides no core types; promotes the module's own types to Query for
  self-bindings). The deps-load + self-promotion logic is extracted from
  runClientGenerator into a shared helper reused by both.
- CurrentModuleAsSDKClient.moduleSource: resolves the bound module from
  its stored {module, pin} via resolveClientTargetModule, correct for
  local and remote/pinned refs alike (not a raw ref-string lookup).

These are the phase-1 primitives the companion client-codegen workflow
consumes. The old engine-driven client path is intentionally left in
place for now; the follow-up cleanup is tracked in
hack/designs/client-codegen-engine-cleanup.md.

Add integration coverage in client_generator_test.go and regenerate the
generated SDK bindings + GraphQL SDL.

Signed-off-by: Vasek - Tom C <[email protected]>
@TomChv
TomChv force-pushed the feat/add-module-source-to-CurrentModuleAsSDKClient branch from a2609c3 to a5bb87f Compare July 16, 2026 13:36
@TomChv
TomChv merged commit 944ff62 into dagger:main Jul 16, 2026
87 checks passed
TomChv added a commit to dagger/typescript-sdk that referenced this pull request Jul 20, 2026
Client generation used to run inside dagger/dagger's engine runtime, which
opened a nested engine session and coupled client bindings to engine
internals. Moving it into this SDK module makes generation ordinary codegen in
a plain container: the engine hands over the client-facing schema and the
bound module's metadata as data, with no nested session.

A generated client now binds exactly one module and ships as a self-contained,
scoped npm package. At runtime it serves that single module through
Workspace.moduleSource, so the bindings resolve from any plain client session
rather than only from a module runtime.

Requires the engine client-codegen primitives released in v1.0.0-beta.7
(dagger/dagger#13646 and #13663).

Signed-off-by: Tom Chauveau <[email protected]>
TomChv added a commit to dagger/typescript-sdk that referenced this pull request Jul 21, 2026
Client generation used to run inside dagger/dagger's engine runtime, which
opened a nested engine session and coupled client bindings to engine
internals. Moving it into this SDK module makes generation ordinary codegen in
a plain container: the engine hands over the client-facing schema and the
bound module's metadata as data, with no nested session.

A generated client now binds exactly one module and ships as a self-contained,
scoped npm package. At runtime it serves that single module through
Workspace.moduleSource, so the bindings resolve from any plain client session
rather than only from a module runtime.

Requires the engine client-codegen primitives released in v1.0.0-beta.7
(dagger/dagger#13646 and #13663).

Signed-off-by: Tom Chauveau <[email protected]>
TomChv added a commit to dagger/typescript-sdk that referenced this pull request Jul 21, 2026
Client generation used to run inside dagger/dagger's engine runtime, which
opened a nested engine session and coupled client bindings to engine
internals. Moving it into this SDK module makes generation ordinary codegen in
a plain container: the engine hands over the client-facing schema and the
bound module's metadata as data, with no nested session.

A generated client now binds exactly one module and ships as a self-contained,
scoped npm package. At runtime it serves that single module through
Workspace.moduleSource, so the bindings resolve from any plain client session
rather than only from a module runtime.

Client generation overlays the freshly generated files on the existing client
dir, so user-authored files there (e.g. a hand-written main.ts) survive
regeneration from any cwd. Local bound modules are resolved fresh from the
workspace (the engine's client.moduleSource caches and can miss live edits),
while pinned/immutable git modules keep the engine-resolved source. Module
refs are resolved workspace-root-relative ("/" + ref) so generation works from
any cwd.

Requires the engine client-codegen primitives released in v1.0.0-beta.7
(dagger/dagger#13646 and #13663).

Signed-off-by: Tom Chauveau <[email protected]>
TomChv added a commit to dagger/typescript-sdk that referenced this pull request Jul 21, 2026
Client generation used to run inside dagger/dagger's engine runtime, which
opened a nested engine session and coupled client bindings to engine
internals. Moving it into this SDK module makes generation ordinary codegen in
a plain container: the engine hands over the client-facing schema and the
bound module's metadata as data, with no nested session.

A generated client now binds exactly one module and ships as a self-contained,
scoped npm package. At runtime it serves that single module through
Workspace.moduleSource, so the bindings resolve from any plain client session
rather than only from a module runtime.

Client generation overlays the freshly generated files on the existing client
dir, so user-authored files there (e.g. a hand-written main.ts) survive
regeneration from any cwd. Local bound modules are resolved fresh from the
workspace (a cached module source can miss live edits), while pinned/immutable
git modules keep their canonical ref. Module refs are resolved
workspace-root-relative ("/" + ref) so generation works from any cwd.

Read the SDK's managed modules and clients from the passed workspace
(ws.sdk(name: currentModule.name)) instead of the ambient current workspace.
Module SDKs can no longer read the ambient workspace (dagger/dagger#13659), and
it was never populated during dagger.cloud @check execution -- which is why the
discovery and generate-all checks failed only in CI. The auto-injected
Workspace argument is always loaded, so the four affected checks now pass there
too.

Split the e2e module by concern into per-group files (utils, runtime, module,
client, init, config), each a small `type` exposed from E2e as a sub-object so
`dagger check` discovers its checks under `e-2-e:<group>:<check>`.

Requires the engine client-codegen primitives released in v1.0.0-beta.7
(dagger/dagger#13646 and #13663).

Signed-off-by: Tom Chauveau <[email protected]>
TomChv added a commit to dagger/typescript-sdk that referenced this pull request Jul 21, 2026
Client generation used to run inside dagger/dagger's engine runtime, which
opened a nested engine session and coupled client bindings to engine
internals. Moving it into this SDK module makes generation ordinary codegen in
a plain container: the engine hands over the client-facing schema and the
bound module's metadata as data, with no nested session.

A generated client now binds exactly one module and ships as a self-contained,
scoped npm package. At runtime it serves that single module through
Workspace.moduleSource, so the bindings resolve from any plain client session
rather than only from a module runtime.

Client generation overlays the freshly generated files on the existing client
dir, so user-authored files there (e.g. a hand-written main.ts) survive
regeneration from any cwd. Local bound modules are resolved fresh from the
workspace (a cached module source can miss live edits), while pinned/immutable
git modules keep their canonical ref. Module refs are resolved
workspace-root-relative ("/" + ref) so generation works from any cwd.

Read the SDK's managed modules and clients from the passed workspace
(ws.sdk(name: currentModule.name)) instead of the ambient current workspace.
Module SDKs can no longer read the ambient workspace (dagger/dagger#13659), and
it was never populated during dagger.cloud @check execution -- which is why the
discovery and generate-all checks failed only in CI. The auto-injected
Workspace argument is always loaded, so the four affected checks now pass there
too.

Split the e2e module by concern into per-group files (utils, runtime, module,
client, init, config), each a small `type` exposed from E2e as a sub-object so
`dagger check` discovers its checks under `e-2-e:<group>:<check>`.

Requires the engine client-codegen primitives released in v1.0.0-beta.7
(dagger/dagger#13646 and #13663).

Signed-off-by: Tom Chauveau <[email protected]>
TomChv added a commit to dagger/typescript-sdk that referenced this pull request Jul 29, 2026
Client generation used to run inside dagger/dagger's engine runtime, which
opened a nested engine session and coupled client bindings to engine
internals. Moving it into this SDK module makes generation ordinary codegen in
a plain container: the engine hands over the client-facing schema and the
bound module's metadata as data, with no nested session.

A generated client now binds exactly one module and ships as a self-contained,
scoped npm package. At runtime it serves that single module through
Workspace.moduleSource, so the bindings resolve from any plain client session
rather than only from a module runtime.

Requires the engine client-codegen primitives released in v1.0.0-beta.7
(dagger/dagger#13646 and #13663).

Signed-off-by: Tom Chauveau <[email protected]>
TomChv added a commit to dagger/typescript-sdk that referenced this pull request Jul 29, 2026
Client generation used to run inside dagger/dagger's engine runtime, which
opened a nested engine session and coupled client bindings to engine
internals. Moving it into this SDK module makes generation ordinary codegen in
a plain container: the engine hands over the client-facing schema and the
bound module's metadata as data, with no nested session.

A generated client now binds exactly one module and ships as a self-contained,
scoped npm package. At runtime it serves that single module through
Workspace.moduleSource, so the bindings resolve from any plain client session
rather than only from a module runtime.

Requires the engine client-codegen primitives released in v1.0.0-beta.7
(dagger/dagger#13646 and #13663).

Signed-off-by: Tom Chauveau <[email protected]>
Signed-off-by: Vasek - Tom C <[email protected]>
TomChv added a commit to dagger/typescript-sdk that referenced this pull request Jul 29, 2026
Client generation used to run inside dagger/dagger's engine runtime, which
opened a nested engine session and coupled client bindings to engine
internals. Moving it into this SDK module makes generation ordinary codegen in
a plain container: the engine hands over the client-facing schema and the
bound module's metadata as data, with no nested session.

A generated client now binds exactly one module and ships as a self-contained,
scoped npm package. At runtime it serves that single module through
Workspace.moduleSource, so the bindings resolve from any plain client session
rather than only from a module runtime.

Requires the engine client-codegen primitives released in v1.0.0-beta.7
(dagger/dagger#13646 and #13663).

Signed-off-by: Tom Chauveau <[email protected]>
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.

2 participants