Repository navigation
Conversation
This was referenced Oct 14, 2026
vito
force-pushed
the
naming/3-dagql-aliases
branch
from
October 14, 2026 23:28
0e52531 to
0b3be7b
Compare
Types, fields, arguments, input object fields, struct-tag fields and enum
values can declare Aliases: old spellings that queries may still use after a
rename, optionally limited to some views. They exist only in the schema
queries are validated against (SchemaWithAliasesForView, also what gqlgen's
handler validates with). Schema and SchemaForView, and so introspection,
codegen and the schema JSON, never show them: SDK generators would collide
on them (legacyJson and legacyJSON both become LegacyJSON in a Go opts
struct).
Field, argument and type aliases are rewritten to the canonical name when
the query is parsed, so an aliased query makes the canonical calls: same IDs,
same cache entries. Type aliases match in fragment type conditions,
including node(id:) { ... on OldName }. Enum value and input object field
aliases are input only: the enum's or input object's decoder resolves them,
so literals, variables and plain strings all decode to the canonical value.
EnumValues.RenameView gives a value a new name in some views, for renaming
a core enum's values on v1 views while older views keep the old names.
Each use adds a dagger.io/dag.alias event to the current span. Aliases
colliding with a real name, or claimed by two names, are ignored, and they
count toward the schema digest. Nothing registers an alias yet.
Refs #13668
Signed-off-by: Alex Suraci <[email protected]>
NameAliases builds the dagql.Aliases for an old spelling of a renamed core type, field, argument or enum value, accepted only on the views with the new naming rules (v1.0.0 and later). ModuleNameAliases is the same for a module's declarations, accepted on every view: a module's names follow its own engine version, not its caller's view. Every transition alias goes through one of them, so ending the transition is deleting them and their callers. Nothing calls them yet. Refs #13668 Signed-off-by: Alex Suraci <[email protected]>
The in-engine Dang runtime typechecks its callers against its dependencies' schema JSON, so a Dang caller using an old name (like go-sdk's .generate(legacyJson: ...)) would fail to typecheck even though the engine accepts the alias. __schemaJSONFile gets an internal includeAliases argument that adds the field, argument and enum value aliases, deprecated, and SchemaIntrospectionJSONFileForDang asks for it. Type aliases stay out: a copy of a type would be a different type to Dang. Other SDKs keep the alias-free JSON, since their generators would collide on the aliases. Refs #13668 Signed-off-by: Alex Suraci <[email protected]>
vito
force-pushed
the
naming/3-dagql-aliases
branch
from
October 15, 2026 20:39
0b3be7b to
dae8ed4
Compare
Contributor
Author
|
🤖 Closing as superseded. The naming transition is now gated purely on schema views keyed on the declared engine version (cut at v1.0.0-beta.20, with prerelease-granular views for v1.0.0 betas), and entrypoint modules will declare their version via |
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.
Part 3/N of the stack splitting #14501 (identifier casing). Plan: #14501 (comment)
Refs #13668
Stacked on #14667.
Why aliases
The naming change renames names the engine already serves, and their users can't all update at the same moment as the engine. Without aliases, every rename breaks those users on engine upgrade. Aliases accept the old spellings for a transition window. Ending the window (after 1.0, Phase 5 of the #14501 Migration Plan) means deleting
core.NameAliases,core.ModuleNameAliasesand their callers.The transitions they cover:
v1.0.0-beta.*andv1.0.0-0module gets the new rules:legacyJson→legacyJSON, anddaggerCli→daggerCLIfor a module nameddagger-cli. Without aliases these callers break:.generate(..., legacyJson: …));dagger-module.tomlmodules build from code the external SDKs generated);engineVersionand run at the engine's own version, so an engine upgrade renames them without any change of their own (getUrl→getURL,TinyHttpClient→TinyHTTPClient).callId→callID,shortSha→shortSHA, theFunctionCachePolicyvalues and a few others. That would break clients and bindings generated against the beta v1 schema.ARM_64→ARM64,GIT_HUB→GITHUB), given as literals, variables, CLI flags or JSON. These aliases are input only.Why this design:
engineVersionand served older prereleases at views marked+legacy-naming. It couldn't work: external SDK modules that declarev1.0.0(go-sdk, sdk-helpers) would have been renamed at release anyway. The marked views also fragmented the cache, and they had to hideformatIdentifiersand rewrite__schemaVersion.legacyJson/legacyJSONboth becomeLegacyJSONin Go, andshortSha/shortSHAboth becomeshort_shain Python. The external repos' forked generators can't be fixed at the same time as the engine. For enums, visible duplicates would also add noise to the schema and to every SDK.What's in it
Hidden transition aliases in dagql (
dagql/aliases.go): old spellings that queries can still use after a rename, optionally limited to some views. They cover:Field.WithAliases,Argument.WithAliases,ClassOpts.Aliases,Interface.WithAliases. Type aliases match in fragment type conditions, includingnode(id:) { ... on OldName }.FieldAliased.InputFieldAliased.EnumValues.WithAliases/EnumValueAliased. These are input only: responses always use the canonical name.EnumValues.RenameViewgives a value a new name in some views, while older views keep the old one, which can stay accepted as an alias.Only validation sees them. Queries are validated against
SchemaWithAliasesForView, which is also what gqlgen's handler validates with. In it, each alias is a@deprecatedcopy of its canonical definition.SchemaandSchemaForViewnever show aliases, so introspection, codegen and the schema JSON don't either: SDK generators would collide on them (legacyJsonandlegacyJSONboth becomeLegacyJSONin a Go opts struct).No cache split. Field, argument and type aliases are rewritten to the canonical name when the query is parsed. Enum value and input field aliases are resolved by the type's decoder, so literals, variables and CLI/JSON strings all decode to the canonical value. Either way, an aliased query makes the canonical calls, with the same IDs and cache keys. Giving something under both names is an error.
Telemetry: each use of an alias adds a
dagger.io/dag.aliasevent to the current span (engine/telemetryattrs).Conflicts: an alias that collides with a real name, or that two names claim, is ignored with a warning. Aliases count toward the schema digest.
Core helpers:
core.NameAliasesbuilds aliases accepted only on v1 views, for core renames.core.ModuleNameAliasesbuilds aliases accepted on every view, for module renames: a module's names follow its own engine version, not its caller's.Every transition alias goes through one of them, so ending the transition means deleting them and their callers.
Dang: the in-engine Dang runtime typechecks callers against its dependencies' schema JSON, so a caller that uses an old name has to typecheck too.
__schemaJSONFilegets an internalincludeAliasesargument that adds the field, argument and enum value aliases as deprecated entries.SchemaIntrospectionJSONFileForDangasks for it, and all Dang call sites use that. Type aliases stay out, because to Dang a copy of a type would be a different type. Other SDKs keep the alias-free JSON.No behaviour change
Nothing registers an alias yet, apart from tests, and the public schema doesn't change (
includeAliasesis internal). Engine module naming (PR 4) and the core renames (PR 6) are the first users.Release ordering
This should ship in the same engine release as #14667. Nothing may rename a name the engine serves until these aliases ship in that release or an earlier one: the aliases are what keep beta-era bindings working.
Known gaps
__typenamealways returns the canonical name, since the server can't know which spelling a client expects. Old Go bindings'Concrete()fails for a renamed implementation until the bindings are regenerated.Testing
go build,go vet;go test ./dagql/... ./core/ ./core/schema/ ./core/sdk/...aliases_test.go: fields, arguments, types, fragments,node(id:), collisions, views, digest, span eventsenum_aliases_test.go: literals, variables, decoders, collisionsenum_rename_test.go:RenameViewinput_aliases_test.go: input object and struct-tag fieldscore/schema/aliases_test.go: the plain and Dang schema JSON, and aliased queries through coreTestModule/(TestBuiltinDangDependencyModules|TestBuiltinDangModuleEntrypoint|TestDangModuleEntrypointEnumRoundtrip)golangci-lint/lint-allanddocs/references/stale(the schema is unchanged)