Skip to content

fix: use GraphQL cache policy enum values in Dang entrypoints - #142

Closed
mboliveira2003 wants to merge 1 commit into
dagger:mainfrom
mboliveira2003:fix/dang-cache-policy-enum-values
Closed

mboliveira2003 wants to merge 1 commit into
dagger:mainfrom
mboliveira2003:fix/dang-cache-policy-enum-values

Conversation

@mboliveira2003

Copy link
Copy Markdown

On Dagger v1.0.0-beta.28, a generated Dang entrypoint for a method using @func({ cache: "session" }) fails to load with field "PerSession" not found in Dagger.FunctionCachePolicy. The never and TTL branches also emit the legacy member names.

Emit the GraphQL enum values PER_SESSION, NEVER, and DEFAULT in the Dang renderer. The regression test generates entrypoints from the existing introspector fixture with each cache policy and checks the emitted API references.

Follow-up to #141.

Validation:

  • From helpers/codegen: go test ./generator/typescript -run '^TestGenerateDangEntrypoint' -count=1 passed with Go 1.25.1.
  • The new regression test fails for all three policies before the renderer fix and passes afterward.
  • A consuming documentation workspace passed verify, catalog/stale, and typescript-sdk/generate/stale twice on separate beta.28 Cloud connections using the corrected generator.

eunomie pushed a commit to eunomie/typescript-sdk that referenced this pull request Nov 24, 2026
A generated Dang entrypoint for a function with @func({ cache: "session" })
fails to load: `field "PerSession" not found in Dagger.FunctionCachePolicy`.
The Dang renderer emitted the TypeScript client's member names; Dang
names enum members by their GraphQL values. Emit PER_SESSION, NEVER and
DEFAULT instead.

Same change as dagger#142, which was closed unmerged.

Signed-off-by: Alex Suraci <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant