Repository navigation
Volatile vars - #13223
Merged
Merged
Volatile vars#13223
Conversation
alexcb
force-pushed
the
volatile-vars
branch
14 times, most recently
from
June 1, 2026 23:07
1ab6714 to
c244bb5
Compare
alexcb
marked this pull request as ready for review
June 1, 2026 23:34
Add a helper for deriving the digest a call would have with a different immediate receiver digest. Volatile exec cache keys use this to normalize receiver history without changing argument or module identity. Signed-off-by: Solomon Hykes <[email protected]>
Allow dynamic-input callers to transform a broad equivalent cache hit into a detached result for the current request. The cache publishes the transformed result under the exact request instead of teaching the exact request identity to the broad shared hit. Signed-off-by: Solomon Hykes <[email protected]>
Cover the cache contract used by volatile-style dynamic inputs: rewrite raw values out of call identity, propagate required session-resource handles, allow sessions with the bound handle to hit cache, and reject unbound sessions. Signed-off-by: Solomon Hykes <[email protected]>
Add withVolatileVariable and withoutVolatileVariable for non-secret env values that apply only to future execs. Volatile values stay out of persistent env introspection and image config, are rejected by Dagger-side expansion, and are ignored for exec cache identity while still being rebased onto cache-hit containers for later execs. Signed-off-by: Solomon Hykes <[email protected]>
Explain when to use volatile variables, how they differ from persistent env and secrets, and why they are an expert-only cache escape hatch. Signed-off-by: Solomon Hykes <[email protected]>
Reformat persistedContainerExecLazy struct tags to satisfy gofmt and replace the inlined container-cloning block in withExec with a call to the existing cloneContainerForSchemaChild helper. Signed-off-by: Solomon Hykes <[email protected]>
Add two cache-level tests: - concurrent sessions with divergent volatile values resolve their own bindings independently after sharing a broad cache hit - nested volatile + non-volatile exec chain: changing only the volatile value reuses the volatile exec cache while a changed non-volatile marker correctly triggers a miss on the child Scope the dynamic-input / CacheHitTransform mechanism in cache_egraph.go to clarify that volatile variables are currently the only consumer. Signed-off-by: Solomon Hykes <[email protected]>
Signed-off-by: Alex Couture-Beil <[email protected]>
Signed-off-by: Alex Couture-Beil <[email protected]>
Signed-off-by: Alex Couture-Beil <[email protected]>
This reverts commit 18208ae. Signed-off-by: Alex Couture-Beil <[email protected]>
The volatile env variable can causes races when the same variable name, e.g. RUN_ID, is used across a shared session. To prevent these test races, we need to run each test with a seperate session. Signed-off-by: Alex Couture-Beil <[email protected]>
Signed-off-by: Alex Couture-Beil <[email protected]>
shykes
approved these changes
Jun 2, 2026
dagger-codex Bot
pushed a commit
that referenced
this pull request
Jun 5, 2026
Conflict resolution details with original conflict hunks and resolved hunks. 1. Deleted module mega-test vs main never-cache regression Related PRs: beta #11812, main #13298. Original conflict: 1.0-beta deleted the old module mega-test after splitting module coverage, while main added the never-cache object-return regression to the deleted file. ```diff diff --git a/core/integration/module_test.go b/core/integration/module_test.go @@ -7531,6 +7531,24 @@ func (m *Test) ObjsWithNothing() ([]*Test, error) { + +func (ModuleSuite) TestNeverCacheModuleObjectReturn(ctx context.Context, t *testctx.T) { + c := connect(ctx, t) + modGen := modInit(t, c, "go", `package main + +type Test struct{} + +// +cache="never" +func (m *Test) Touch() *Test { + return m +} +`) + out, err := modGen.With(daggerCall("touch")).Stdout(ctx) + require.NoError(t, err) + require.Contains(t, out, "Test@") +} ``` Resolution: keep beta's deleted mega-test because the regression is already ported to beta's split runtime behavior test and runtime cache-control fixture from the previous merge. ```diff diff --git a/core/integration/module_runtime_behavior_test.go b/core/integration/module_runtime_behavior_test.go @@ func (ModuleSuite) TestNeverCacheModuleObjectReturn(ctx context.Context, t *testctx.T) { c := connect(ctx, t) modGen := moduleFixture(t, c, "go/runtime-cache-control") out, err := modGen.With(daggerCall("touch")).Stdout(ctx) require.NoError(t, err) require.Contains(t, out, "Test@") } diff --git a/core/integration/testdata/modules/go/runtime-cache-control/main.go b/core/integration/testdata/modules/go/runtime-cache-control/main.go @@ // +cache="never" func (m *Test) Touch() *Test { return m } ``` 2. Shell helper command path Related PRs: beta #11812, main #13239. Original conflict: main's helper calls `dagger shell`, while beta's helper supports root-shell module paths through `daggerShellAt`. ```diff diff --cc core/integration/shell_test.go @@ func daggerShellAt(modPath, script string) dagger.WithContainerFunc { return func(c *dagger.Container) *dagger.Container { ++<<<<<<< HEAD:core/integration/shell_test.go + execArgs := []string{"dagger", "shell"} + if modPath != "" { + execArgs = append(execArgs, "-m", modPath) + } + return c.WithExec(execArgs, dagger.ContainerWithExecOpts{ ++======= + return c.WithExec([]string{"dagger", "shell"}, dagger.ContainerWithExecOpts{ ++>>>>>>> origin/main:core/integration/module_shell_test.go ``` Resolution: combine both concerns: always invoke `dagger shell`, and append beta's `-m <path>` only when the helper receives a module path. `daggerShellNoMod` already remains `dagger shell -M`. ```diff diff --git a/core/integration/shell_test.go b/core/integration/shell_test.go @@ func daggerShellAt(modPath, script string) dagger.WithContainerFunc { return func(c *dagger.Container) *dagger.Container { execArgs := []string{"dagger", "shell"} if modPath != "" { execArgs = append(execArgs, "-m", modPath) } return c.WithExec(execArgs, dagger.ContainerWithExecOpts{ ``` 3. Release dry-run workspace loading Related PRs: beta #13327, main #13285. Original conflict: beta fixed the cache-persistence release dry-run to load the synthetic repo as a workspace; main still loaded it as an extra module. The synthetic repo root uses workspace-only toolchains, so `-m` fails with the workspace migration error. ```diff diff --cc core/integration/engine_persistence_test.go @@ script := `set +e ++<<<<<<< HEAD +/bin/dagger --progress=plain -W "$MODULE_REF" call release publish --tag "$RELEASE_TAG" --commit "$RELEASE_COMMIT" --dry-run=true markdown > /tmp/publish.log 2>&1 ++======= +/bin/dagger --progress=plain -m "$MODULE_REF" call release publish --tag "$RELEASE_TAG" --commit "$RELEASE_COMMIT" --dry-run=true markdown > /tmp/publish.log 2>&1 ++>>>>>>> origin/main ``` Resolution: keep beta's `-W "$MODULE_REF"` workspace load, preserving the previous CI fix and the dry-run assertions. ```diff diff --git a/core/integration/engine_persistence_test.go b/core/integration/engine_persistence_test.go @@ /bin/dagger --progress=plain -W "$MODULE_REF" call release publish --tag "$RELEASE_TAG" --commit "$RELEASE_COMMIT" --dry-run=true markdown > /tmp/publish.log 2>&1 ``` 4. Module workspace config fields Related PRs: beta #13300, main #13329. Original conflict: main added legacy argument customizations to `Module`, while beta renamed and documented workspace settings from `dagger.toml`. ```diff diff --cc core/module.go @@ ++<<<<<<< HEAD + // Workspace setting values from dagger.toml [modules.<name>.settings]. ++======= + // LegacyArgCustomizations are workspace dagger.json argument customizations + // applied through asModule. + LegacyArgCustomizations []*modules.ModuleConfigArgument + + // Config values from workspace config.toml [modules.<name>.config]. ++>>>>>>> origin/main // Typed map: strings, bools, ints, floats as-is from TOML. // When set, constructor args are resolved from this map first. WorkspaceConfig map[string]any ``` Resolution: keep both fields: main's `LegacyArgCustomizations` is still used by merged `modulesource.go`, and beta's `WorkspaceConfig` comment reflects the current 1.0-beta `dagger.toml` settings model. ```diff diff --git a/core/module.go b/core/module.go @@ // LegacyArgCustomizations are workspace dagger.json argument customizations // applied through asModule. LegacyArgCustomizations []*modules.ModuleConfigArgument // Workspace setting values from dagger.toml [modules.<name>.settings]. // Typed map: strings, bools, ints, floats as-is from TOML. // When set, constructor args are resolved from this map first. WorkspaceConfig map[string]any ``` 5. Dang API rename vs beta closure fix Related PRs: beta #13296, main #13318. Original conflict: main upgraded Dang and renamed class APIs to object APIs; beta used the constructor closure to preserve imports in rehydrated method calls. ```diff diff --cc core/sdk/dang_helpers.go @@ parentConstructor := parentModBase.(*dang.ConstructorFunction) ++<<<<<<< HEAD +parentModType := parentConstructor.ClassType +// Use the class file's captured env so rehydrated method calls keep the +// imports that were in scope when the type was declared. +parentClosure := parentConstructor.Closure ++======= +parentModType := parentConstructor.ObjectType ++>>>>>>> origin/main @@ ++<<<<<<< HEAD +bodyEnv := dang.CreateCompositeEnv(parentModEnv, parentClosure) ++======= +bodyEnv := dang.CreateOverlayValueScope(parentModEnv, env) ++>>>>>>> origin/main ``` Resolution: take main's newer Dang API names and dependency, but keep beta's captured `Closure` for conversion and body evaluation. The newer `ConstructorFunction` still exposes `Closure`, so this preserves both the API upgrade and the import-scope fix. ```diff diff --git a/core/sdk/dang_helpers.go b/core/sdk/dang_helpers.go @@ parentConstructor := parentModBase.(*dang.ConstructorFunction) parentModType := parentConstructor.ObjectType // Use the class file's captured env so rehydrated method calls keep the // imports that were in scope when the type was declared. parentClosure := parentConstructor.Closure @@ parentModEnv := dang.NewObject(parentModType) @@ bodyEnv := dang.CreateOverlayValueScope(parentModEnv, parentClosure) bodyEnv.EnterSelf(parentModEnv) _, err = dang.EvaluateFormsWithPhases(ctx, parentConstructor.ObjectBodyForms, bodyEnv) ``` 6. Dang dependency version Related PRs: beta #13306, main #13318. Original conflict: beta had the older Dang pseudo-version; main had the newer version required by the merged object API names. ```diff diff --cc go.mod @@ ++<<<<<<< HEAD + github.com/vito/dang v0.0.0-20260602175442-56ec0c007a23 ++======= + github.com/vito/dang v0.0.0-20260603200027-0175bae9eb8f ++>>>>>>> origin/main ``` Resolution: take main's newer Dang dependency and matching go.sum entries because the source resolution uses the newer object API. ```diff diff --git a/go.mod b/go.mod @@ github.com/vito/dang v0.0.0-20260603200027-0175bae9eb8f ``` 7. Generated ConfigSchema comments Related PRs: beta #13300, main #13035. Original conflict: beta's generated clients document the expanded workspace config filenames; main's generated clients kept the old file list. Both sides already agreed on the shifted source line. ```diff diff --cc modules/dev/internal/dagger/engine-dev.gen.go @@ // Generate the json schema for a dagger config file ++<<<<<<< HEAD +// Currently supported: "dagger.json", "dagger-module.toml", "dagger.toml", "engine.json" ++======= +// Currently supported: "dagger.json", "engine.json" ++>>>>>>> origin/main func (r *EngineDev) ConfigSchema(filename string) *File { // engine-dev (../../../../toolchains/engine-dev/main.go:362:1) ``` Resolution: keep beta's expanded filename list in every generated engine-dev/dagger-engine client because `toolchains/engine-dev/main.go` supports the workspace config files. ```diff diff --git a/modules/dev/internal/dagger/engine-dev.gen.go b/modules/dev/internal/dagger/engine-dev.gen.go @@ // Generate the json schema for a dagger config file // Currently supported: "dagger.json", "dagger-module.toml", "dagger.toml", "engine.json" func (r *EngineDev) ConfigSchema(filename string) *File { // engine-dev (../../../../toolchains/engine-dev/main.go:362:1) ``` 8. Current docs restructure vs main docs updates Related PRs: beta #11812, main #13320 and #13223. Original conflict: beta's current docs have been restructured and versioned for 1.0-beta, while main still modified or imported content from the older current-docs layout. The modify/delete conflicts were all old current-docs pages such as cookbook pages, old module pages, old quickstarts, old type pages, and old best-practice pages. ```diff diff --git a/docs/current_docs/cookbook/containers.mdx b/docs/current_docs/cookbook/containers.mdx deleted in HEAD, modified in origin/main ``` Resolution: keep beta's current-docs restructure and deletions. Non-conflicting main additions such as versioned docs and static reference assets stay in the merge, but old pre-restructure `current_docs` pages are not reintroduced. ```diff diff --git a/docs/current_docs/cookbook/containers.mdx b/docs/current_docs/cookbook/containers.mdx deleted file mode 100644 ``` 9. Existing 1.0-beta docs pages vs main old imports/links Related PRs: beta #13338, main #13320 and #13223. Original conflict: for pages that still exist on both sides, main tried to import old cookbook partials or link to old `dagger.json`/core-concepts pages, while beta uses current 1.0-beta aliases and workspace-era wording. ```diff diff --cc docs/current_docs/extending/types/container.mdx @@ ++<<<<<<< HEAD:docs/current_docs/extending/types/container.mdx +import ContainerType from "@daggerTypes/_container.mdx"; ++======= +import ContainerType from "../../partials/types/_container.mdx"; +import BuildImageFromDockerfile from '../../partials/cookbook/builds/_image-from-dockerfile.mdx'; ++>>>>>>> origin/main:docs/current_docs/getting-started/types/container.mdx ``` Resolution: keep beta's existing 1.0-beta docs files for those content conflicts, including `@daggerTypes` aliases, workspace/checks links, and `dagger-module.toml` wording. ```diff diff --git a/docs/current_docs/extending/types/container.mdx b/docs/current_docs/extending/types/container.mdx @@ import ContainerType from "@daggerTypes/_container.mdx"; ``` Signed-off-by: Solomon Hykes <[email protected]>
tiborvass
added a commit
that referenced
this pull request
Jun 5, 2026
…ash in fd0021b This merge commit restores the history link between 1.0-beta branch and main. It was lost with merge commit fd0021b which squashed the branch e45e7e4 Git tree on #13327 before squash-merging into 1.0-beta: ``` * e45e7e4 Run dagger generate * a01677a Merge main into 1.0-beta |\ | * 1588421 chore: update daggerverse from 0.21.0 to 0.21.4 (#13328) | * 20b2554 Simplify function call return handling (#13319) | * 316ca15 Fix snapshot owner lease attach/remove race (#13321) | * 6cfdcb4 fix(layercopy): follow source symlinks when copying directory contents (#13326) | * 16e85ca Container exists expand option (#13310) | * 54f9811 chore: post-release during v0.21.4 (#13316) | * de85595 ci: bump default engine version to v0.21.3 (#13315) | * 81bb907 chore: prep for v0.21.4 (#13314) | * 0fd148e Show root usage when dagger has no args | * 219b696 Volatile vars (#13223) | * fae340c fix(layercopy): materialize resolved parent dirs when writing through… (#13308) | * b720144 bump dang (#13306) | * 41a7910 fix(engine): lease parent layer content for tarball export (#13307) | * b2d43ba fix(core): attach never-cached module function results (#13298) | * 6a7b3a7 fix incorrect artifact caching issue when releasing (#13285) | * 2452472 fix(core/dotenv): accept `export`-prefixed lines in .env files (#13293) | * 24b06e7 fix: allow empty setSecret name (#13304) | * f7ea195 fix: handle 1Password secrets with spaces (#13297) * | 74e1a66 another pass on docs (#13325) ... |/ * 8cc840f fix(sdk/typescript): resolve referenced values in decorator arguments (#13292) ``` Ran `git merge -s ours 1588421` on 1.0-beta to get this desired git tree: ``` * ??gitsha?? [1.0-beta] restore merge history with main@15884210ff lost due to squash in fd0021b |\ | * 1588421 chore: update daggerverse from 0.21.0 to 0.21.4 (#13328) | ... * | 94ebacb (origin/1.0-beta) update sdk docs, type-system docs, and interfaces (#13338) * | 64eba3f (tag: v1.0.0-beta.3) [1.0-beta] feat: support synthetic workspaces (#13217) * | fd0021b Merge main into 1.0-beta (#13327) * | c6dd435 fix(cli): refine cloud check replay ```
tiborvass
added a commit
that referenced
this pull request
Jun 6, 2026
…ash in fd0021b This merge commit restores the history link between 1.0-beta branch and main. It was lost with merge commit fd0021b which squashed the branch e45e7e4 Git tree on #13327 before squash-merging into 1.0-beta: ``` * e45e7e4 Run dagger generate * a01677a Merge main into 1.0-beta |\ | * 1588421 chore: update daggerverse from 0.21.0 to 0.21.4 (#13328) | * 20b2554 Simplify function call return handling (#13319) | * 316ca15 Fix snapshot owner lease attach/remove race (#13321) | * 6cfdcb4 fix(layercopy): follow source symlinks when copying directory contents (#13326) | * 16e85ca Container exists expand option (#13310) | * 54f9811 chore: post-release during v0.21.4 (#13316) | * de85595 ci: bump default engine version to v0.21.3 (#13315) | * 81bb907 chore: prep for v0.21.4 (#13314) | * 0fd148e Show root usage when dagger has no args | * 219b696 Volatile vars (#13223) | * fae340c fix(layercopy): materialize resolved parent dirs when writing through… (#13308) | * b720144 bump dang (#13306) | * 41a7910 fix(engine): lease parent layer content for tarball export (#13307) | * b2d43ba fix(core): attach never-cached module function results (#13298) | * 6a7b3a7 fix incorrect artifact caching issue when releasing (#13285) | * 2452472 fix(core/dotenv): accept `export`-prefixed lines in .env files (#13293) | * 24b06e7 fix: allow empty setSecret name (#13304) | * f7ea195 fix: handle 1Password secrets with spaces (#13297) * | 74e1a66 another pass on docs (#13325) ... |/ * 8cc840f fix(sdk/typescript): resolve referenced values in decorator arguments (#13292) ``` Ran `git merge -s ours 1588421` on 1.0-beta to get this desired git tree: ``` * ??gitsha?? [1.0-beta] restore merge history with main@15884210ff lost due to squash in fd0021b |\ | * 1588421 chore: update daggerverse from 0.21.0 to 0.21.4 (#13328) | ... * | 94ebacb update sdk docs, type-system docs, and interfaces (#13338) * | 64eba3f [1.0-beta] feat: support synthetic workspaces (#13217) * | fd0021b Merge main into 1.0-beta (#13327) * | c6dd435 fix(cli): refine cloud check replay * | 74e1a66 another pass on docs (#13325) ```
dagger-codex Bot
pushed a commit
that referenced
this pull request
Jun 6, 2026
Conflict resolution details with original conflict hunks and resolved hunks. 1. Module workspace config fields Related PRs: beta #13300, main #13329. Original conflict: main added legacy argument customizations to `Module`, while beta renamed and documented workspace settings from `dagger.toml`. ```diff diff --cc core/module.go @@ LegacyDefaultPath bool + // LegacyArgCustomizations are workspace dagger.json argument customizations + // applied through asModule. + LegacyArgCustomizations []*modules.ModuleConfigArgument + - // Config values from workspace config.toml [modules.<name>.config]. + // Workspace setting values from dagger.toml [modules.<name>.settings]. // Typed map: strings, bools, ints, floats as-is from TOML. // When set, constructor args are resolved from this map first. WorkspaceConfig map[string]any ``` Resolution: keep both fields: main's `LegacyArgCustomizations` is still used by merged `modulesource.go`, and beta's `WorkspaceConfig` comment reflects the current 1.0-beta `dagger.toml` settings model. ```diff diff --git a/core/module.go b/core/module.go @@ LegacyDefaultPath bool // LegacyArgCustomizations are workspace dagger.json argument customizations // applied through asModule. LegacyArgCustomizations []*modules.ModuleConfigArgument // Workspace setting values from dagger.toml [modules.<name>.settings]. // Typed map: strings, bools, ints, floats as-is from TOML. // When set, constructor args are resolved from this map first. WorkspaceConfig map[string]any ``` 2. Dang API rename vs beta closure fix Related PRs: beta #13296, main #13318. Original conflict: main upgraded Dang and renamed class APIs to object APIs; beta used the constructor closure to preserve imports in rehydrated method calls. ```diff diff --cc core/sdk/dang_helpers.go @@ parentConstructor := parentModBase.(*dang.ConstructorFunction) +<<<<<<< HEAD + parentModType := parentConstructor.ClassType + // Use the class file's captured env so rehydrated method calls keep the + // imports that were in scope when the type was declared. + parentClosure := parentConstructor.Closure +======= + parentModType := parentConstructor.ObjectType +>>>>>>> origin/main @@ +<<<<<<< HEAD + bodyEnv := dang.CreateCompositeEnv(parentModEnv, parentClosure) +======= + bodyEnv := dang.CreateOverlayValueScope(parentModEnv, env) +>>>>>>> origin/main bodyEnv.EnterSelf(parentModEnv) - _, err = dang.EvaluateFormsWithPhases(ctx, parentConstructor.ClassBodyForms, bodyEnv) + _, err = dang.EvaluateFormsWithPhases(ctx, parentConstructor.ObjectBodyForms, bodyEnv) ``` Resolution: take main's newer Dang API names, but keep beta's captured `Closure` for conversion and body evaluation. ```diff diff --git a/core/sdk/dang_helpers.go b/core/sdk/dang_helpers.go @@ parentConstructor := parentModBase.(*dang.ConstructorFunction) parentModType := parentConstructor.ObjectType // Use the class file's captured env so rehydrated method calls keep the // imports that were in scope when the type was declared. parentClosure := parentConstructor.Closure @@ bodyEnv := dang.CreateOverlayValueScope(parentModEnv, parentClosure) bodyEnv.EnterSelf(parentModEnv) _, err = dang.EvaluateFormsWithPhases(ctx, parentConstructor.ObjectBodyForms, bodyEnv) ``` 3. Current docs restructure vs main docs updates Related PRs: beta #11812, main #13320 and #13223. Original conflict: beta's current docs have been restructured and versioned for 1.0-beta, while main still modified or imported content from the older current-docs layout. The modify/delete conflicts were all old current-docs pages such as cookbook pages, old module pages, old quickstarts, old type pages, and old best-practice pages. ```diff diff --git a/docs/current_docs/cookbook/containers.mdx b/docs/current_docs/cookbook/containers.mdx deleted in HEAD, modified in origin/main ``` Resolution: keep beta's current-docs restructure and deletions. Non-conflicting main additions such as versioned docs and static reference assets stay in the merge, but old pre-restructure `current_docs` pages are not reintroduced. ```diff diff --git a/docs/current_docs/cookbook/containers.mdx b/docs/current_docs/cookbook/containers.mdx deleted file mode 100644 ``` 4. Existing 1.0-beta docs pages vs main old imports/links Related PRs: beta #13338, main #13320 and #13223. Original conflict: for pages that still exist on both sides, main tried to import old cookbook partials or link to old `dagger.json`/core-concepts pages, while beta uses current 1.0-beta aliases and workspace-era wording. ```diff diff --cc docs/current_docs/extending/types/container.mdx @@ +<<<<<<< HEAD:docs/current_docs/extending/types/container.mdx +import ContainerType from "@daggerTypes/_container.mdx"; +======= +import ContainerType from "../../partials/types/_container.mdx"; +import BuildImageFromDockerfile from '../../partials/cookbook/builds/_image-from-dockerfile.mdx'; +>>>>>>> origin/main:docs/current_docs/getting-started/types/container.mdx ``` Resolution: keep beta's existing 1.0-beta docs files for those content conflicts, including `@daggerTypes` aliases, workspace/checks links, and `dagger-module.toml` wording. ```diff diff --git a/docs/current_docs/extending/types/container.mdx b/docs/current_docs/extending/types/container.mdx @@ import ContainerType from "@daggerTypes/_container.mdx"; ``` Signed-off-by: Solomon Hykes <[email protected]>
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.
rebased version of #12903
tl;dr — New
Container.withVolatileVariablelets you pass non-secret env vars (commit SHA, branch ref, CI run ID) into execs without invalidating cache and without the log redaction you get from thewithSecretVariableworkaround.Fixes #12902
Today the only way to pass changing metadata into execs without busting cache is
withSecretVariablewith a fixedcacheKey— but these values aren't secrets, so you get unwanted redaction.withVolatileVariablefixes this: it sets a non-secret env var visible towithExecbut excluded from cache identity. If an exec reruns for another reason, it sees the latest volatile values.Volatile variables are not persisted into OCI image config, not returned by
envVariable/envVariables, and not available toexpand: true. This is an expert-only escape hatch — if the value actually affects the exec result, Dagger will silently serve stale cache.Example
Schema
Full diff
Internals
The dagql cache layer gains support for "dynamic inputs" — call arguments whose raw values are rewritten out of cache identity but whose session-bound handles are still propagated and validated on cache hits.