Merge pull request 'clan_cli flake caching: fix caching of store files' (#3458) from select-store-caching into main

Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/3458
This commit is contained in:
Mic92
2025-05-01 13:12:05 +00:00

View File

@@ -344,9 +344,6 @@ class FlakeCacheEntry:
def is_cached(self, selectors: list[Selector]) -> bool:
selector: Selector
if selectors == []:
return self.fetched_all
selector = selectors[0]
# for store paths we have to check if they still exist, otherwise they have to be rebuild and are thus not cached
if isinstance(self.value, str) and self.value.startswith("/nix/store/"):
@@ -356,6 +353,10 @@ class FlakeCacheEntry:
if isinstance(self.value, str | float | int | None):
return True
if selectors == []:
return self.fetched_all
selector = selectors[0]
# we just fetch all subkeys, so we need to check of we inserted all keys at this level before
if selector.type == SelectorType.ALL:
assert isinstance(self.value, dict)