Repository navigation
Conversation
Elixir codegen runs without an engine session, so it reads the schema's names as the engine formatted them from the sidecar file `codegen introspect --names-out` writes (`mix dagger.codegen generate --names`, see Dagger.Codegen.Naming): PASCAL:UPPERCASE for modules, SNAKE:UPPERCASE for functions, arguments and variables. The names are only used for a schema with Query.formatIdentifiers; without them, or for a name missing from the file, codegen keeps the legacy Macro conversion, so older schemas generate the same code. Functions and enum value functions whose name changes keep their legacy name as a deprecated alias. Input object struct keys keep the legacy conversion: they are sent to the API as is. elixir-client-dev passes the names from engine-dev's IntrospectionNames. Signed-off-by: Alex Suraci <[email protected]>
GitBundle.prerequisiteSHAs becomes prerequisite_shas/1, keeping prerequisite_sh_as/1 as a deprecated alias. Nothing else changes. Signed-off-by: Alex Suraci <[email protected]>
The runtime runs Elixir codegen on the module's introspection JSON in an exec without an engine session. It now formats the schema's names with Query.formatIdentifiers, passing the schema's __schemaVersion so they are parsed with that version's naming dictionary, and hands them to codegen as the --names sidecar. A schema without Query.formatIdentifiers gets no sidecar and keeps the legacy conversion (internal/names). The runtime moves from engineVersion v0.21.9 to v1.0.0 for the public Query.formatIdentifiers. Its Go bindings are updated to the v1 view: formatIdentifiers with the Casing and AcronymStyle enums, nullable object getters taking a context, and the module's own names (ElixirSDK, withSDK, introspectionJSON). Signed-off-by: Alex Suraci <[email protected]>
A v1 Elixir module's generated client follows the engine's names, with the legacy names as deprecated aliases, and its own snake_case functions and arguments are callable under their engine names. Signed-off-by: Alex Suraci <[email protected]>
This was referenced Oct 14, 2026
Contributor
Author
|
🤖 Closing: the in-repo SDKs are now legacy. This work will be redone as a PR against github.com/dagger/elixir-sdk ( |
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 5e/N of the stack splitting #14501 (identifier casing). Plan: #14501 (comment)
Refs #13668
Stacked on #14673.
What it does
The Elixir client and module codegen now take Elixir names from the engine (
Query.formatIdentifiers), instead of converting schema names withMacro. Elixir codegen runs without an engine session, so it reads the names from a sidecar file next to the introspection JSON.The formats it uses:
Dagger.X)PASCAL:UPPERCASEHTTPClientSNAKE:UPPERCASEprerequisiteSHAs→prerequisite_shas(wasprerequisite_sh_as)The gate is the schema being generated. A schema without
Query.formatIdentifiers(pre-v1 views, older engines) gets no names, so codegen keeps the legacyMacroconversion and generates the same code as before. A name missing from the file also falls back toMacro.What's in it
sdk/elixir/dagger_codegen):Dagger.Codegen.Namingreads the names file thatcodegen introspect --names-outwrites (codegen: name Go identifiers via formatIdentifiers #14673). It's passed withmix dagger.codegen generate --names.Schema.put_names/2keeps the names only for a schema withQuery.formatIdentifiers.Formatter.format_module/1,format_var_name/1andformat_function_name/1look names up there, falling back tolegacy_*(the oldMacroconversion).@doc false@deprecateddelegates. No alias is rendered when the legacy name is taken.QueryBuildersends them to the API as is.Query.formatIdentifiers, and with a name missing from the file.elixir-client-dev: passes engine-dev'sintrospectionNames(formats: ["PASCAL:UPPERCASE", "SNAKE:UPPERCASE"])to codegen.GitBundle.prerequisite_shas/1, withprerequisite_sh_as/1kept as a deprecated alias.sdk/elixir/runtime):Query.formatIdentifiers, passing the schema's__schemaVersionso they're parsed with that version's dictionary. It mounts them as the--namessidecar (internal/names). A schema without the API gets no sidecar.engineVersionmoves from v0.21.9 to v1.0.0, for the publicformatIdentifierswithversion.formatIdentifierswith theCasing/AcronymStyleenums, nullable object getters taking actx, and the module's own names (ElixirSDK,withSDK,introspectionJSON).Breaking changes for Elixir SDK users
Maintainers, please decide whether these are acceptable:
Dagger.GitBundle.prerequisite_sh_as/1→prerequisite_shas/1. The old name still works, but it emits a deprecation warning at compile time, and--warnings-as-errorsturns that into a failure.dagger_sdkclient with engine names. This applies to modules declaringengineVersion≥ v1.0.0-0. Renamed functions and enum value functions keep deprecated aliases, as in (1). Pre-v1 modules are unchanged.DaggerCli→DaggerCLI), its Elixir module becomesDagger.DaggerCLI, andDagger.DaggerCliis gone. Code naming the old module has to be updated.getHTTPURL→ a deprecatedget_httpurlnext toget_http_url). This only adds noise and breaks nothing. Core renames get an old-names table in PR 6.formatIdentifiers(version:). The SDK module now declaresengineVersion: v1.0.0, so this version ofsdk/elixircan't serve as a module runtime on older engines. Per ordering constraint 2 of the plan, it must ship with or after engine module naming (core: name modules with engine/naming from v1.0.0-beta.21 #14669).Not in it
callID,shortSHA,filterURI,FunctionCachePolicyvalues, …) and Elixir's renamed-core-fields table (Formatter.legacy_field_name/2).__formatIdentifiers.Testing
elixir-client/codegen-test,elixir-client/lint,elixir-client/sdk-testandelixir-client/client-library/staleall pass.go test ./internal/names/andgo vet ./...insdk/elixir/runtime.TestElixirpasses (23 tests). The existing modules are all pre-v1, so they cover the legacy path. The newTestElixir/TestNaminguses a v1.0.0 module and checks two things: its regenerated client has bothprerequisite_shas/1and the deprecatedprerequisite_sh_as/1, which needs the runtime's names sidecar; and itshttp_url_for(host_name:)is callable ashttp-url-for --host-name.go-sdk/generate. They build and vet, and the engine regenerates them at load anyway.