Repository navigation
fix(container): preserve cache identity through registry auth - #13901
Merged
Merged
Conversation
Return the attached container result from session-local registry auth mutations, and conservatively gate image content identity on an untouched scratch container. Signed-off-by: Erik Sipsma <[email protected]>
Signed-off-by: Erik Sipsma <[email protected]>
matipan
approved these changes
Aug 14, 2026
This was referenced Aug 31, 2026
social4hyq
pushed a commit
to social4hyq/homebrew-core
that referenced
this pull request
Sep 20, 2026
dagger 0.21.9 Created-by: HarmonybrewBot Commit-by: HarmonybrewBot Merged-by: HarmonybrewBot Description: Created by `brew bump` --- Created with `brew bump-formula-pr`.<details> <summary>release notes</summary> <pre>## v0.21.9 - 2026-08-25 ### Added - Added SSHFS-backed volumes, allowing remote filesystems to be mounted into containers without copying their contents into Dagger's content store by @sipsma in dagger/dagger#13462 ### Fixed - `Container.withDirectory` and `Directory.withDirectory` no longer restore by @sipsma in dagger/dagger#13848 \ deleted nested files after execs remove and recreate an ancestor directory. - Engine client enumeration no longer blocks behind another session's by @sipsma in dagger/dagger#13542 \ initialization or teardown, preventing Cloud keeper heartbeats from stalling and live engines from being suspended. - Session teardown now runs in the background after the main client disconnects, by @sipsma in dagger/dagger#13681 \ preventing shutdown responses from timing out while the engine releases session-owned cache results. - The engine now bounds retained DAGQL cache metadata independently of disk by @sipsma in dagger/dagger#13846 \ usage by pruning cold persisted results when the structural estimate exceeds its configured limit. This may mitigate metadata growth at scale while preserving active and engine-lifetime cache roots. - Registry protocol probes no longer appear as scary errors in progress output by @vito in dagger/dagger#13410 \ when image pulls or publishes succeed, while genuine registry failures remain visible. - Registry authentication no longer invalidates downstream container cache reuse across sessions when applied before or after `Container.from` by @sipsma in dagger/dagger#13901 ### What to do next? - Read the [documentation](https://docs.dagger.io) - Join our [Discord server](https://discord.gg/dagger-io) - Follow us on [Twitter](https://twitter.com/dagger_io) </pre> <p>View the full release notes at <a href="https://github.com/dagger/dagger/releases/tag/v0.21.9">https://github.com/dagger/dagger/releases/tag/v0.21.9</a>.</p> </details> <hr> See merge request: Harmonybrew/homebrew-core!17786
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.
Summary
ObjectResultfromwithRegistryAuthandwithoutRegistryAuth, since they mutate ambient session auth rather than the containerContainer.fromto publish stable image content identity only for an untouched scratch containerFrom, plus constructor/clone defaults and modified-containerMultiFrompreservationProblem
Adding registry credentials to an otherwise unchanged container caused image pulls and downstream executions to miss cache across Dagger sessions. This was especially visible for the common sequence
container -> withRegistryAuth -> from(image) -> downstream operations, even when the configured credentials were unrelated to the pulled image.The root cause was that the auth mutation was scoped correctly with
dagql.PerSessionInput, butdagql.Funcwrapped the unchanged Go container pointer in a new result whose identity included that session-local input. Session-local auth side effects were therefore coupled to semantic container result identity.Approach
withRegistryAuthandwithoutRegistryAuthare nowNodeFuncs that still execute against the current session's auth provider, but return the already-attached parent result. The e-graph can therefore treat the returned container as exactly the unchanged semantic value it is, allowing downstream cache reuse across sessions.Container.fromno longer identifies the safe path by inspecting the parent field name. A newly constructed scratch container carries a private safety bit, while schema child cloning defaults it to false. This keeps stable image content identity available for untouched containers while conservatively preserving call identity for genuinely modified containers whose state survivesFrom.This takes a different approach from the now-closed #13899: it retains normal per-session caching and restores result equivalence instead of marking registry-auth operations
DoNotCache.Validation
go test ./core ./core/schema -count=1dagger api call engine-dev test --pkg ./core/integration --run='^TestContainer/(TestMultiFrom|TestWithRegistryAuth.*)$'— 8 passedgit diff --checkdagger generate -y—dagger-go-sdk:generatepassed; the overall run was blocked in the unrelated Elixir generator because the BEAM runtime aborted withOS monotonic time stepped backwards(exit 134); no generated changes were produceddagger check '*:lint'— Helm, Java, Markdown, and Python passed;elixir-client:linthit the same BEAM host-clock abortCloses #13898.