Repository navigation
Conversation
APIViewVersion now keeps a declared prerelease from PrereleaseViewsVersion (v1.0.0-beta.21) on, so a view gate can separate v1.0.0 betas. Dev builds still drop their prerelease and share the release's view. Every earlier v1.0.0 prerelease, from v1.0.0-0 to v1.0.0-beta.20, shares the v1.0.0-beta.20 view: it sorts above every gate set while views were base-granular, so those callers keep exactly the API they had. Add IdentifierCasingVersion, the cut for the identifier casing changes, and APIVersionAtLeast, the same gate for a declared version outside a call. Refs dagger#13668 Signed-off-by: Alex Suraci <[email protected]>
Prove that a field gated at engine.IdentifierCasingVersion is visible to beta.21+, dev builds and v1.0.0, and hidden from beta.20 and earlier, including v1.0.0-0, while gates set before views kept prereleases keep applying to every v1.0.0 prerelease. Pin that view-scoped calls are cached per view and unscoped ones are not, and that every pre-cut v1.0.0 prerelease gets one core schema. Update the version-gating doc and the comments that said views drop prereleases. Signed-off-by: Alex Suraci <[email protected]>
While the engine is a v1.0.0 prerelease or dev build, a module declaring exactly v1.0.0 gets the shared pre-cut view (v1.0.0-beta.20) instead of the release's. Every sdk-helpers tag and go-sdk declare v1.0.0 and are locked by SDKs and users; on a beta.21 engine they would otherwise see the renamed API and break with no way to re-pin a locked tag. The clamp moves that break to v1.0.0 GA. ModuleAPIViewVersion maps module engineVersions to views (module client sessions, default schema builders) and backs APIVersionAtLeast. Client versions keep APIViewVersion. Proposal pending maintainer sign-off; this commit drops cleanly. Signed-off-by: Alex Suraci <[email protected]>
Say which mapping applies to modules (ModuleAPIViewVersion) and clients (APIViewVersion), that fixtures testing API past the cut must declare a prerelease from the cut on, and that a client's view follows the CLI that starts its session, not the SDK release it was generated with. Signed-off-by: Alex Suraci <[email protected]>
Stores written before prerelease-granular views recorded "v1.0.0" as the view of every v1.0.0 prerelease caller. That view is now the release's, past every prerelease gate, so a GA or dev-build caller would hit pre-cut results, and IDs naming fields gated before the cut would stop loading once such gates exist. Bump the persistence schema so they are wiped on import. Signed-off-by: Alex Suraci <[email protected]>
Pins github.com/vito/dang/v2 to the head of vito/dang#208, stacked on #206 and #185. Together they add the `dang` and `[imports.Dagger] dagger` keys of dang.toml, dang.ContextWithVersion and DaggerSource.VersionString, which keeps a declared prerelease (v1.0.0-beta.19 stays as is rather than becoming v1.0.0, past the naming cut). BurntSushi/toml becomes a direct dependency: the engine decodes an entrypoint's dang.toml into Dang's own ProjectConfig. This is a pseudo-version of an unmerged branch; re-bump it to a Dang release before merging. Signed-off-by: Alex Suraci <[email protected]>
A manifest v2 module had no engine version: it was served at the running engine's own version and always parsed as the latest Dang, with the minimum and maximum version checks skipped. Core API view changes, Dang language changes and the naming cut would all reach existing entrypoints silently. The engine now reads the dang.toml governing the entrypoint, with Dang's own types: the nearest one walking up from the entrypoint directory to the module directory (never above it, so the result does not depend on how the module was loaded), or the named directory's own for a module reference or address. - `[imports.Dagger] dagger = "vX.Y.Z"` is the module's engine version: its API view (through engine.ModuleAPIViewVersion, like a dagger.json engineVersion), naming rules, default caching and dependency schema. It gets the same minimum and maximum checks as an engineVersion, at load and in loadModuleSourceConfig. The sources member, which runs before the module exists, is served at that view too, as types and call are. - `dang = "X.Y"` is the Dang version the entrypoint is parsed as, set with dang.ContextWithVersion (and when scanning for a sources member). With no Dagger version declared, the engine version is v1.0.0-beta.20, the last release before the naming cut and the shared pre-cut view, which existing entrypoints were written against; with no Dang version, Dang's DefaultVersion (2.1). Both are pinned so an entrypoint that declares nothing keeps its meaning across engine releases. Both versions key SourceImplementationDigest, so results such as the persisted _moduleTypesDefinition built under one version never answer for another, even when the dang.toml lies outside the module context. Signed-off-by: Alex Suraci <[email protected]>
Covers the default (v1.0.0-beta.20 with no dang.toml, no Dagger import or `dagger = true`), a version or prerelease declared in or above the entrypoint directory and in a module reference, a dang.toml above the module directory ignored however the module is loaded, the declared API view gating Workspace.resolve and serving sources, a too-new version refused with "module requires dagger ...", the declared Dang version, and a versionless entrypoint that spells the pre-cut FunctionCachePolicy values. Signed-off-by: Alex Suraci <[email protected]>
The manifest v2 spec gains a Versions section: the dang.toml keys, which dang.toml the engine reads, the defaults and why they are pinned. The identifier casing design records that entrypoints pin their naming through it. Signed-off-by: Alex Suraci <[email protected]>
vito
added a commit
to dagger/typescript-sdk
that referenced
this pull request
Oct 22, 2026
dagger/dagger#14812 serves an entrypoint module at the Dagger version its dang.toml declares ([imports.Dagger] dagger), and at v1.0.0-beta.20 when it declares none. Write entrypoint/dang.toml beside main.dang with dang = "2.1" and that version: the running engine's (minus build metadata) for a module being initialized, v1.0.0-beta.20 for one that already had an entrypoint, so regenerating never moves it onto the beta.21 naming. An existing dang.toml is kept as it is. It is written with the manifest, before the module's schema is read, so the bindings and the entrypoint are generated for the version the engine will serve. Engines before beta.21 get no file. The Dang entrypoint's FunctionCachePolicy spellings stay Default/PerSession/Never, valid on every view per dagger/dagger#14681. Signed-off-by: Alex Suraci <[email protected]>
vito
added a commit
to dagger/python-sdk
that referenced
this pull request
Oct 22, 2026
The engine reads `[imports.Dagger] dagger` from a dang.toml beside an entrypoint (dagger/dagger#14812) and serves it at v1.0.0-beta.20 without one. The entrypoint generated into a module now ships one, and the scope is generated in that version's view, so bindings and calls agree. A new module declares the engine it is created on, without build metadata, and so gets the engine's naming from beta.21. A module that already had an entrypoint but no dang.toml gets beta.20, what the engine already serves it, so regenerating never moves it silently. An existing dang.toml is kept. FunctionCachePolicy keeps its old spellings: they stay valid in every view. Signed-off-by: Alex Suraci <[email protected]>
vito
added a commit
to dagger/go-sdk
that referenced
this pull request
Oct 22, 2026
Generated Dang entrypoints now come with a dang.toml beside them, declaring dang = "2.1" and [imports.Dagger] dagger = "<version>". Engines with dagger/dagger#14812 serve an entrypoint module the API, and name it by the rules, of that version; without one they serve v1.0.0-beta.20, the last version before the naming cut. Older engines copy only the .dang files and ignore it. The version follows the module, like a runtime module's engineVersion: - a dang.toml that declares one is kept, and the bindings are generated for it (one without a version is refused rather than rewritten); - an existing entrypoint without dang.toml gets v1.0.0-beta.20, what engines serve it today, so generating again never renames its API; - a new module, or one migrating from the Go runtime, gets the running engine's version (sdk-helpers' normalizeEngineVersion). The file is not generated code: it is the module's declaration to change. FunctionCachePolicy keeps its Default/PerSession/Never spelling: those stay valid at every view (dagger/dagger#14681), so the entrypoint needs no version-dependent spelling. Signed-off-by: Alex Suraci <[email protected]>
vito
added a commit
to dagger/go-sdk
that referenced
this pull request
Oct 22, 2026
Look for the module's dang.toml from the entrypoint directory up to the module directory, as the engine does (dagger/dagger#14812), both to pick the version to generate for and before writing one. A dang.toml without a Dagger version, or with dagger = true, is what engines serve at v1.0.0-beta.20, so it generates for that instead of being refused. Signed-off-by: Alex Suraci <[email protected]>
vito
added a commit
to dagger/java-sdk
that referenced
this pull request
Oct 22, 2026
dagger/dagger#14812 serves an entrypoint module at the Dagger and Dang versions of the dang.toml next to its entrypoint, and at v1.0.0-beta.20 without one. Generation now writes one: dang = "2.1" and [imports.Dagger] dagger = the running engine's version for a new module. An existing module is never moved: an entrypoint without a dang.toml gets v1.0.0-beta.20, a module migrated from the runtime its engineVersion (at least v1.0.0-beta.20), and a dang.toml the module has is kept as it is. The staged manifest the module's schema is read through declares the same version, so the Java code is generated against the API, and the naming rules, the engine serves the entrypoint at. The generated main.dang keeps FunctionCachePolicy.Never/PerSession/ Default, which every view accepts. Signed-off-by: Alex Suraci <[email protected]>
vito
force-pushed
the
naming/view-prerelease-gate
branch
from
October 27, 2026 20:05
2873e64 to
94fdbda
Compare
vito
force-pushed
the
naming/view-prerelease-gate
branch
from
October 28, 2026 16:11
e65f47e to
b4aa8d8
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.
Why
A manifest v2 module (a
dagger-module.tomlwith an[entrypoint]table) declares no engine version. Until now the engine served it at its own version (engine.Version), parsed its Dang at the latest Dang, and skipped the minimum/maximum version checks. Every core API view change, every Dang language change and the upcoming naming cut would reach existing entrypoints silently, on engine upgrade.Dang can now declare both versions in
dang.toml(vito/dang#185, #206, #208), and generated entrypoints will ship one:This PR makes the engine read it.
What
dang.tomlfrom the entrypoint directory up to the module directory; for a module reference or address, the named directory's own. Adang.tomlabove the module directory never counts: a local or Git module context doesn't hold it while a directory source may, so honoring it would make the version depend on how the module was loaded. It's decoded into Dang's ownProjectConfig, so keys parse and validate exactly as Dang reads them.[imports.Dagger] daggerbecomesModuleSource.EngineVersion: API view (throughengine.ModuleAPIViewVersion, exactly like adagger.jsonengineVersion), naming, default function caching, dependency/core schema view. The min/max checks are re-enabled for entrypoints with the same rules asengineVersion("module requires dagger vX, but you have vY"). Thesourcesmember, which runs before the module exists, is now served at that view too (it was type-checked at it but ran at the engine's own view).dangpicks the Dang language version viadang.ContextWithVersion(also when scanning for asourcesmember).SourceImplementationDigest, so the persisted_moduleTypesDefinition(and anything else keyed on the implementation digest) built under one version never answers for another, even when thedang.tomlis outside the module context (remote entrypoints).future/module-manifest-v2/spec.mdgains a Versions section;hack/designs/identifier-casing.mdrecords the outcome for entrypoint naming.Defaults
dang.tomlv1.0.0-beta.202.1dagger = truev1.0.0-beta.20dangkey2.1(Dang'sDefaultVersion)v1.0.0-beta.20is the last release before the naming cut atv1.0.0-beta.21. Versionless entrypoints in the wild were written against beta.16–beta.20 engines: the v1 API, Dang 2.1, the pre-cut naming. With #14810's prerelease-granular views it lands exactly on the shared pre-cut view. The default is pinned: following the running engine is what this PR removes.The Dang default is
DefaultVersion(2.1) even without adang.toml, rather than Dang'sCurrentVersion, for the same reason.Dependencies and merge order
engine.ModuleAPIViewVersion,IdentifierCasingVersion). Without it, beta.20 and beta.21 share thev1.0.0view and the default protects nothing. This PR targets that branch.github.com/vito/dang/v2 v2.1.5-0.20261022140822-177d598346d8, the head of Keep the prerelease of the declared Dagger version vito/dang#208 (keeps Dagger prereleases inDaggerSource.VersionString()), stacked on Move CLI spec to a better location #206 and repro #Component panic #185. It must be re-bumped to a Dang release before merge. It also brings repro #Component panic #185's version-gated parser to the regular Dang SDK; behavior there is unchanged for modules without adangkey (they stay 2.1).templates/v2.go), python-sdk (entrypoint/main.dang), typescript-sdk (entrypoint_dang.go) and java-sdk (DangEntrypointRenderer.java) hard-codeFunctionCachePolicy.Never/PerSession/Default, which core: rename non-canonical core names from beta.21 #14681 renames from beta.21. Only this PR's beta.20 default keeps those versionless entrypoints on the old names.TestDangModuleEntrypointVersionlessCachePoliciescovers it; it only proves something once stacked with the renames.Behavior changes
engineVersionmeans the v1 view". That stays true: beta.20 is a v1 view, so execs still nest and theDAGGER_SESSION_*handling there is unaffected. What changes is that those modules now get the pre-cut v1 view instead of whatever the running engine serves, so they won't pick up beta.21+ API (renames included) until their generateddang.tomldeclares a version.ModuleSource.engineVersionfetch it and fail if it's unreachable.Tests
core/sdk/dang/v2/version_test.go(resolution and defaults, prerelease kept,dagger = true/false, conflicting imports, too new/too old, Dang version honored by the parser and thesourcesscan, default view is pre-cut),core/schema/module_implementation_scoped_test.go(versions key the digest only for entrypoints),core/schema/modulesource_test.go(re-enabled checks).core/integration/module_entrypoint_version_test.go): default with nodang.toml; declared in/above the entrypoint dir; prerelease; ignored above the module dir for workspace and directory sources; module-reference entrypoint; declared older view rejectsWorkspace.resolve;sourcesruns at the declared view; too-new version refused; Dang 2.0 syntax honored only when declared; versionless entrypoint with pre-cutFunctionCachePolicyvalues.go build ./...,go vet,go test ./core/ ./core/schema/... ./core/sdk/... ./core/modules/..., golangci-lint and markdown-lint pass; the entrypoint integration tests (TestModule/(TestBuiltinDangModuleEntrypoint|TestDangModuleEntrypoint|TestModuleEntrypoint|TestModuleAtLocalRepoRoot)) pass against a dev engine.Open questions
.gitboundary, so a repo-leveldang.tomlthat Dang tooling (LSP,dangCLI) would apply to the entrypoint is ignored by the engine. Generated entrypoints keep theirs in the entrypoint directory, so this only matters for hand-written layouts.dagger.jsonengineVersion, the max check compares base versions, so a beta.21 engine acceptsdagger = "v1.0.0-beta.22"and serves its own latest API under that view. Refusing later prereleases would be a change for both, not just entrypoints.dagger = "v0.19.0", older than entrypoints themselves; such an entrypoint gets the v0.19 view, where some of theModuleEntrypointcontract's API may not exist. Should there be a minimum entrypoint version?withEngineVersionstill overrides an entrypoint module's version (as for any module), anddang = "..."has no API equivalent.ensureModuleSelfTypes) still use the current Dang grammar; an entrypoint declaring an older Dang only loses self-type pre-registration for files that don't parse at 2.1.core.IdentifierNamingVersionis stillv1.0.0-0, so the identifier API (Query.formatIdentifiers) is visible at the beta.20 view. Undeclared entrypoints get legacy naming only once the naming work gates onengine.IdentifierCasingVersion(core: name modules with engine/naming from v1.0.0-beta.21 #14669 / core: rename non-canonical core names from beta.21 #14681).