Repository navigation
core: key module calls on their declared clients - #14489
Conversation
Signed-off-by: Yves Brissaud <[email protected]>
A hook can then add engine-computed identity that call displays omit. Signed-off-by: Yves Brissaud <[email protected]>
|
This lint failure failure is weird since you don't update these codes, and it passes on main.
|
A module serves its clients at run time, after the cache lookup, so a changed target left the caller's cached result stale. A target that cannot resolve must not stop the module's other calls caching, and a workspace restored from the cache must keep its clients. Signed-off-by: Yves Brissaud <[email protected]>
Signed-off-by: Yves Brissaud <[email protected]>
39f0b93 to
8b0cae5
Compare
Problem
A caller can serve a local client's module and cache a function result computed from it. Today, if only the client's target module changes, the caller's cached result can stay stale: the served module never enters the caller's cache key, so the cache lookup hits even though the inputs really changed.
Fix
Before a module function's cache lookup, the call gains one implicit input: a digest of the local clients the caller's
dagger.tomldeclares for that module's scope, plus those clients' own declared clients, recursively.dagger calloutput or in Dagger Cloud's trace.Test
core/integration/module_serve_test.goaddsTestServeModuleDeclaredClientCachewith four subtests:dagger calldisplay.Trade-offs (reviewed and accepted)
dagger.tomlare tracked; an undeclaredserveModuleaddress is not.Known side effect
Replaying a recorded call by ID now recomputes this digest from the caller's current clients rather than reusing the recorded value. This matches how other engine-computed implicit inputs already behave.