A remote cache entry is stored under a key made from the task's command, arguments, env, and input/output globs. The contents of the input files aren't part of the key. They're checked after the entry is fetched.
So all input states of a task share one entry. When main and PR branches run the same task with different sources, each upload replaces the previous one, and a fetch hits only if the latest upload came from the same inputs. The more branches share a remote cache, the fewer hits each gets.
The secondary key doesn't help: it only identifies the task, and a fallback through it is used only to explain the miss.
Adding a digest of the input files to the key only covers tasks with explicit input globs. By default, inputs are detected while the task runs, so they aren't known at lookup time. Covering them needs a lookup that can return several candidate entries for one key.
Expected: entries for different input states coexist, so a run can hit an entry uploaded from another branch.
Affects the server API design (#713) and remote cache uploads (#755).
A remote cache entry is stored under a key made from the task's command, arguments, env, and input/output globs. The contents of the input files aren't part of the key. They're checked after the entry is fetched.
So all input states of a task share one entry. When main and PR branches run the same task with different sources, each upload replaces the previous one, and a fetch hits only if the latest upload came from the same inputs. The more branches share a remote cache, the fewer hits each gets.
The secondary key doesn't help: it only identifies the task, and a fallback through it is used only to explain the miss.
Adding a digest of the input files to the key only covers tasks with explicit input globs. By default, inputs are detected while the task runs, so they aren't known at lookup time. Covering them needs a lookup that can return several candidate entries for one key.
Expected: entries for different input states coexist, so a run can hit an entry uploaded from another branch.
Affects the server API design (#713) and remote cache uploads (#755).