Repository navigation
module-codegen: remove self-call bindings - #92
Merged
Merged
Conversation
vito
force-pushed
the
remove-self-calls
branch
from
November 4, 2026 16:46
5436366 to
b94fcc6
Compare
vito
force-pushed
the
remove-self-calls
branch
from
November 5, 2026 22:43
b94fcc6 to
9fa8ad1
Compare
vito
marked this pull request as ready for review
November 6, 2026 17:54
vito
force-pushed
the
remove-self-calls
branch
from
November 6, 2026 17:56
9fa8ad1 to
8fc94de
Compare
eunomie
force-pushed
the
remove-self-calls
branch
2 times, most recently
from
November 16, 2026 17:29
7ee689f to
416ff2b
Compare
Self-calls are now `dagger module client add .`: a module's own client is generated from the schema the engine serves for it, like any dependency client. The module generator no longer predicts that schema: drop module self-introspection (introspect_emit, introspect_collection and the emitter API), the port of core.Schema.Merge, and the second client pass over the merged schema. The embedded bootstrap render stays: unified bindings are rendered against the module's sources, which need the complete core surface and a tidy go.sum to list cleanly. A previously generated <module>.gen.go is removed as a stale binding on the next generation. Signed-off-by: Alex Suraci <[email protected]> Signed-off-by: Yves Brissaud <[email protected]>
A collection without a stored keys field or a one-argument get function was refused while generating the self-call schema. With that gone, generation succeeded and the module failed only when the engine loaded it. Refuse it again where the entrypoint declares the collection, with the same messages. Signed-off-by: Alex Suraci <[email protected]> Signed-off-by: Yves Brissaud <[email protected]>
Without self-calls, embedded bindings are the bootstrap itself; rendering them again only removed stale bindings, which the bootstrap now does. The design doc no longer lists <module>.gen.go and says self-calls need unified bindings, since embedded bindings refuse clients. Signed-off-by: Alex Suraci <[email protected]> Signed-off-by: Yves Brissaud <[email protected]>
eunomie
force-pushed
the
remove-self-calls
branch
from
November 19, 2026 18:04
416ff2b to
f8e0ff0
Compare
eunomie
approved these changes
Nov 20, 2026
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.
Self-calls are now
dagger module client add .(per @eunomie): a module's own client is generated from the schema the engine serves for it, like any dependency client. The module generator no longer needs to predict that schema, so this removes the self-call machinery frommodule-codegen.What's deleted
helpers/module-codegen/gogenerator/schema_merge.go: the port ofcore.Schema.Mergethat merged the module's predicted types into the dependency schema.generate.go: the module self-introspection, the merge, and the second client pass over the merged schema. The client is rendered from the schema the engine served, and the package is loaded once.templates/introspect_emit.goandtemplates/introspect_collection.go, with their tests: the emitter that predicted the module's own types, enum members and namespaced names with strcase.ModuleIntrospectionEmitter/NewModuleIntrospectionEmitterintemplates/functions.go.roundtrip_test.go, andTestGenerateUnifiedModuleProjectsOwnChecks(fix(go): type checks as Check in unified bindings #83), which only checked the self-call binding. Check projection for clients stays covered byTestUnifiedClientProjectsChecks.design/manifest-v2-prototype.md.The embedded bootstrap render stays, with a corrected comment: unified bindings are rendered against the module's sources, which need the complete core surface and a tidy
go.sumto list cleanly. Embedded bindings are now that bootstrap, rendered once.The collection check (a stored keys field and a one-argument get function) lived only in the deleted emitter. It moves to where the entrypoint declares the collection, with the same messages, so an incomplete collection is still refused at generation rather than at load.
Who is affected
Users of unreleased
mainwithdangEntrypoint = truewhose module calls itself through its generated bindings (the<OwnModule>field on the client root, e.g.dag.Hello()) or uses its own types frominternal/dagger. The next generation removes the generatedinternal/dagger/<module>.gen.goas a stale binding, and such code stops compiling. The fix isdagger module client add .withunifiedClients = true.Released v1.1.1 has no
module-codegenand is unaffected.Known gap (follow-up)
generateScope: clients are rendered before the module's entrypoint exists.unifiedClients = false) refuse clients, so they cannot add themselves.Testing
go vet ./...andgo test ./...incmd/dagger-go-sdk-codegenandhelpers/module-codegen.entrypoint/generate-check,entrypoint/module-init-check,sources/collection-check,target/default-check,target/dependency-check,entrypoint/global-client-compatibility-check. The unified calls checks run only throughengine-e2eon a development engine and were not run.