Skip to content

Serve a client's target once per session - #29

Draft
eunomie wants to merge 1 commit into
codegen-partitionfrom
client-target-loading
Draft

eunomie wants to merge 1 commit into
codegen-partitionfrom
client-target-loading

Conversation

@eunomie

@eunomie eunomie commented Nov 11, 2026

Copy link
Copy Markdown
Member

Stacked on #25. Second part of the unified-clients work (no user-visible change yet). Dagger\\Client\\ModuleTarget and AbstractClient::serve() send serveModule(address, refPin) once per target and per client instance (a failed serve is retried). --client now takes --address and --pin and generates Dagger\\Clients\\<Name>\\Client as a final class of static methods; each one serves its target on the shared Dagger::getClientInstance() before it starts the query, so a core Directory passes into a client call. Client types have no load<Type>FromID loaders in the beta.25 view, so only the entry methods serve.

Checks, on the beta.27 engine and CLI: sdk-codegen-unit-check passed (30 tests); sdk-unit-check passed with a temporary wider filter (185 tests); new client-target-call-check passed: it calls a client of a local module and of a Git module at a pin (the pin is proved by moving main afterwards). generated-entrypoint-call-check fails before its Git half at the assertion fixed by #14, so the extracted Git helpers are proved by the new check instead.

Not proved: generateScope integration, Composer autoload of clients in a module, a target declaring beta.26 or later, a real public Git remote.

A client's Query fields live in a module the engine has not served yet,
so the first query would fail. AbstractClient::serve sends serveModule
once per target and per client instance, and does not record a failed
serve, so the next call retries.

--client now takes --address and --pin, and generates Client as a final
class of static methods. Each one serves its target on the shared
Dagger::getClientInstance() before it starts the query, so a core
Directory passes into a client call.

The e2e check calls a client of a local module and of a pinned Git
module. The Git daemon helper leaves the Git-source check so both use
it. Client types have no load<Type>FromID loaders in the beta.25 view,
so only the entry methods serve.

Signed-off-by: Yves Brissaud <yves@dagger.io>
@eunomie
eunomie force-pushed the client-target-loading branch from eeadd22 to bc27f8f Compare November 11, 2026 14:31
@eunomie
eunomie added this pull request to stack #32 November 11, 2026 14:32
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