Repository navigation
core/sdk: gate runtime codegen on config format - #13598
Merged
eunomie merged 4 commits intoJul 13, 2026
Merged
Conversation
eunomie
force-pushed
the
core-sdk-config-format-runtime-codegen-gate
branch
2 times, most recently
from
July 9, 2026 14:49
8e59c79 to
3da044e
Compare
eunomie
force-pushed
the
core-sdk-config-format-runtime-codegen-gate
branch
4 times, most recently
from
July 10, 2026 13:55
de0de08 to
fafef56
Compare
eunomie
marked this pull request as ready for review
July 10, 2026 14:45
TomChv
approved these changes
Jul 10, 2026
Move the runtime-codegen gate out of the Go SDK so the module-SDK
adapters can apply the same semantics, and reduce it to a single rule:
- dagger.json (legacy): the runtime gets the schema introspection and
may regenerate the module's bindings on the fly — today's behavior,
for every SDK, unconditionally.
- dagger-module.toml: no runtime codegen. The module commits its
generated files (dagger generate) and the runtime builds from them
as-is.
The codegen.automaticGitignore opt-out and the engine-version gate are
not read anymore: the config format is the only input.
Signed-off-by: Yves Brissaud <[email protected]>
…odegen Apply the config-format rule to module SDKs: for dagger-module.toml modules, the engine skips building the deps introspection JSON and omits the introspectionJson argument from the moduleRuntime call — no codegen possible at runtime, the SDK builds from the module's committed generated files. The rule is SDK-agnostic. An SDK adopts it by declaring its moduleRuntime introspectionJson argument optional — capability detection on the loaded SDK module's own schema, like moduleRuntime/codegen detection, no hardcoded SDK list. SDKs with a required argument keep today's call, byte-identical, until they adopt the contract. Legacy dagger.json modules never qualify, so existing modules are unaffected. Since toml modules must keep their generated files in the module context (local context loading is gitignore-filtered), codegen stops writing VCS-generated paths into .gitignore for them; non-generated ignores (.venv, __pycache__) still apply. Leaving the schema-file ID out of the moduleRuntime call also decouples the runtime container cache from deps-schema changes. Signed-off-by: Yves Brissaud <[email protected]>
dagger-module.toml modules never run codegen at runtime, so a freshly scaffolded module (or one whose generated files were never committed) fails to load with the missing-generated-files error. Bare `dagger generate` used to die on that load — a dead-end, since running the SDK generator is exactly what materializes those files. Workspace.generators now loads modules best-effort: a module that fails to load is skipped with a console warning instead of failing the run, its recorded error kept for other operations. Checks and services keep the strict behavior. [rebased onto main: the core.Server test fakes added on main since this was authored (core/schema/test_server_test.go, core/telemetry_test.go) updated for the new EnsureWorkspaceModules signature] Signed-off-by: Yves Brissaud <[email protected]>
The runtime-codegen suite asserted the flag-based mechanism the previous commits removed: TestMissingGeneratedFiles keeps its assertion (the missing-files error now comes from the config format, not the opt-out flag, so the stale codegen.automaticGitignore field goes away) and TestVersionSkewFallsBackToCodegen is replaced by TestLegacyConfigKeepsRuntimeCodegen — the version-skew fallback no longer exists, what must hold instead is that legacy dagger.json modules keep regenerating unconditionally, including with a stale codegen.automaticGitignore=false opt-out from the flag-based era. Existing suites that build toml Go modules from fixtures or in-test configs (typedef source maps, include/exclude, call-by-name git roots, client generation) now materialize the generated files first: nothing regenerates them at load time anymore. The migration hints test regenerates the fixture's committed generated files with the current engine before migrating: the migrated module is dagger-module.toml and builds from them as-is, and the version-skew fallback that used to regenerate the stale fixture files at load is gone. The generators narrowing test asserted that generate across all modules fails on the broken one; generator enumeration is now best-effort, so it asserts the skip warning instead — the broken module is still loaded, its failure just no longer fails the run. Signed-off-by: Yves Brissaud <[email protected]>
eunomie
force-pushed
the
core-sdk-config-format-runtime-codegen-gate
branch
from
July 13, 2026 13:37
fafef56 to
eaca72d
Compare
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.
Extracts the generic engine-side runtime-codegen gate from the draft Python SDK stack (#13593) so it can be reviewed and land on its own. The first two commits are byte-identical to that stack (original messages and sign-offs preserved); a third engine commit makes bare
dagger generateload workspace modules best-effort; the fourth is the test fallout.What
One rule decides whether a module's runtime may regenerate its bindings, keyed on config format:
dagger.json(legacy): the runtime gets the schema introspection and may regenerate the module's bindings on the fly — today's behavior, for every SDK, unconditionally.dagger-module.toml: no runtime codegen. The module commits its generated files (dagger generate) and the runtime builds from them as-is.For a
dagger-module.tomlmodule the engine additionally omits the introspection JSON from themoduleRuntimecall — but only when the SDK opts in by declaring itsmoduleRuntimeintrospectionJsonargument optional. That's capability detection on the loaded SDK's own schema (like the existingmoduleRuntime/codegendetection), no hardcoded SDK list. An SDK whose argument is still required keeps today's call byte-identical until it adopts the contract.Why
This replaces the
codegen.automaticGitignoreopt-out + engine-version gate that #13381 shipped for the Go SDK with a single config-format input, so every module SDK gets the same semantics without per-SDK special-casing. Omitting the schema-file ID from the call also decouples the runtime container cache from deps-schema changes.Notes
dagger generatefails on a freshdagger-module.tomlmodule (it can't load the not-yet-generated module). It lets generation skip + warn on a per-module load failure so the module's files can still be materialized (TestWorkspaceModuleGenerate).TestVersionSkewFallsBackToCodegenasserted the removed mechanism and is replaced byTestLegacyConfigKeepsRuntimeCodegen; suites that call TOML Go fixtures — plus the client-generator and migration-hints paths — now materialize their generated files first, since nothing regenerates them at load time anymore.core/sdk+core/schemaunit tests green (incl.TestBaseSchemaAllowlist); integration green on a dev engine —TestRuntimeCodegen,TestWorkspaceModuleGenerate,TestWorkspaceMigrateOutcomes, the client-generator suite,TestModule/TestTypedefSourceMaps,TestModuleConfig/TestIncludeExclude,TestCall/TestGitMod.