You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A filtered check selection re-keys every module object per session, so its checks never cache across sessions #15044
What happens.dagger check with a collection filter, such as dag://?check=test&<dimension>=<key> or a --skip on a collection key, wraps each module object in __withArtifactView. The view's state carries Origins, from artifactViewOrigin in core/artifact_view.go. That function hashes the recipe of the filtered collection, and the recipe holds things that differ in every session:
the Workspace argument: currentWorkspace on a host checkout is keyed per call, through its cachePerCall implicit input
the module of each rebuilt call, because calcDigest hashes the module's recipe digest, which differs per load
the arguments of every call beneath it, because origin rebuilds them with Append, which drops any digest the engine set on them and hashes cache-per-call inputs such as a secret's
So Origins differs in every session. The view argument differs with it, the __withArtifactView call gets a new digest, and every receiver below it does too.
Reproduction. A module whose collection is reached from a Workspace-taking function, with a leaf check that takes no Workspace:
Run dagger check <module> 'dag://?check=test&<dimension>=<key>' twice from a host checkout, with a one-line README edit between the runs.
Both runs evaluate every __check_test, with no CACHED span.
Select the same checks through a module setting instead of the filter. The second run then reports every __check_testCACHED.
Cost. On one package of 466 test files, a run under the filter evaluates all 466 checks even when no input of any of them changed: 297 s summed across them. Every filtered selection pays this on every push, whatever changed.
Proposed fix. An origin should normalize only what varies per session and keep what tells two collections apart. A PR follows.
Activity