Skip to content

WIP: move fixture SDK registration into its own workspace - #17

Draft
TomChv wants to merge 1 commit into
mainfrom
e2e-workspace
Draft

WIP: move fixture SDK registration into its own workspace#17
TomChv wants to merge 1 commit into
mainfrom
e2e-workspace

Conversation

@TomChv

@TomChv TomChv commented Aug 7, 2026

Copy link
Copy Markdown
Member

Not for merge — pushed for discussion. Rebased onto de65475.

Ports dagger/java-sdk#13. The repository's dagger.toml registered this SDK against the eight e2e fixture modules and the fixture client, so the real workspace advertised test fixtures as managed modules. That registration moves into a test-only .dagger/modules/e2e/fixtures/dagger.toml, reached through a new Fixtures.workspace helper.

The nesting works because a workspace root is the git root and dagger.toml is only the nearest config found walking up from the cwd — so a nested config selects configuration without moving the root. That is why source = "../../../.." is relative to the config file while the as-sdk paths stay repo-root-relative.

Where it gets stuck

dagger --x-release=v1.0.0-beta.9 check43/48, with two failure signatures that are the two horns of the same problem. Codegen needs the session's client-backed workspace; the fixtures config can only be selected by a synthetic one. There is no way to get both.

Approach Config selected Client-backed Result
asWorkspace(cwd:) fixtures ✅ restore workspace client context: workspace has no client ID
withWorkdir(path) repo root ❌ current module is not installed as an SDK in this workspace
  • asWorkspace(cwd:) re-runs config detection (DetectInRoot), but the workspace carries no client ID, so ModuleSource.generateLocalDependencies — used by mod.dang:97, added in generate: stage local dependency closure before codegen #12 — fails in withWorkspaceClientContext (core/schema/modulesource.go:3120). This is the 3 generate:* failures.
  • Workspace.withWorkdir keeps the client but only clones and sets Cwd (core/schema/workspace.go:1471); it never re-detects, so ConfigFile stays the repo's dagger.toml. That is the client:generate-all-client-check failure, and codegen would then resolve "typescript" to the builtin SDK rather than this one — passing for the wrong reason.

generate:skip-generate-check is a third, unrelated and fixable failure: Mod.hasMarker passes a bare relative rootPath to ws.findUp, which resolves from the cwd, so markers go undetected anywhere but the root. Left alone here since the rest is blocked.

Also worth noting: the 3 client:* checks that still pass now do so through the builtin TypeScript SDK, so they are no longer testing this repo.

Why java-sdk does not hit this

Not a language difference — the two SDKs generate differently. java-sdk's Mod.generate (mod.dang:201) reads only introspectionSchemaJSON off the module source and builds every generated file in its own Maven container, returning a native changeset. That works fine on a synthetic workspace. This SDK delegates to the engine's codegen plus dependency-closure staging, which re-enters the workspace as its owning client. If java-sdk ever adopts dependency staging, its generateCwdCheck breaks the same way.

What would unblock it

An engine change, either:

  1. Workspace.withWorkdir re-running config detection so a client-backed workspace can move cwd and pick up a nested dagger.toml; or
  2. generateLocalDependencies working on a synthetic workspace.

Ports dagger/java-sdk#13: the repository's dagger.toml registered this SDK
against the e2e fixture modules and the fixture client, so the real workspace
advertised test fixtures as managed. That registration moves to a test-only
dagger.toml under the fixtures directory, reached through Fixtures.workspace.

Incomplete — pushed for discussion, not for merge.

discovery:* passes. generate:* and client:* cannot work as written, because
codegen needs the session's client-backed workspace and the fixtures config can
only be selected by a synthetic one:

  - asWorkspace(cwd:) re-runs config detection, so the nested dagger.toml is
    selected, but the workspace carries no client ID and
    ModuleSource.generateLocalDependencies (mod.dang:97, added in #12) fails in
    withWorkspaceClientContext.
  - Workspace.withWorkdir keeps the client but only clones and sets Cwd, so
    ConfigFile stays the repository's dagger.toml and currentModule.asSDK(ws)
    reports the SDK is not installed. Codegen then resolves "typescript" to the
    builtin SDK rather than this one, which passes for the wrong reason.

java-sdk does not hit this: its Mod.generate reads only introspectionSchemaJSON
and builds the generated files in its own container, so a synthetic workspace is
enough. Unblocking here needs an engine change — withWorkdir re-detecting
config, or generateLocalDependencies working on a synthetic workspace.

Signed-off-by: Tom Chauveau <tom@dagger.io>
@TomChv TomChv changed the title test(e2e): move fixture SDK registration into its own workspace WIP: move fixture SDK registration into its own workspace Aug 7, 2026
@TomChv
TomChv marked this pull request as draft August 7, 2026 16:21
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