Merge pull request 'modules/inventory: use filtered serialization of inventory instead' (#5634) from modules-1 into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5634
This commit is contained in:
6
devFlake/flake.lock
generated
6
devFlake/flake.lock
generated
@@ -3,10 +3,10 @@
|
||||
"clan-core-for-checks": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1760361585,
|
||||
"narHash": "sha256-v4PnSmt1hXW4dSgVWxcd1ZeEBlhO7NksNRC5cX7L5iw=",
|
||||
"lastModified": 1761204206,
|
||||
"narHash": "sha256-A4KDudGblln1yh8c95OVow2NRlHtbGZXr/pgNenyrNc=",
|
||||
"ref": "main",
|
||||
"rev": "7e7e58eb64ef61beb0a938a6622ec0122382131b",
|
||||
"rev": "aabbe0dfac47b7cfbe2210bcb27fb7ecce93350f",
|
||||
"shallow": true,
|
||||
"type": "git",
|
||||
"url": "https://git.clan.lol/clan/clan-core"
|
||||
|
||||
@@ -241,9 +241,9 @@ def test_caching_works(flake: ClanFlake) -> None:
|
||||
wraps=my_flake.get_from_nix,
|
||||
) as tracked_build:
|
||||
assert tracked_build.call_count == 0
|
||||
my_flake.select("clanInternals.inventoryClass.inventory.meta")
|
||||
my_flake.select("clanInternals.inventoryClass.inventorySerialization.meta")
|
||||
assert tracked_build.call_count == 1
|
||||
my_flake.select("clanInternals.inventoryClass.inventory.meta")
|
||||
my_flake.select("clanInternals.inventoryClass.inventorySerialization.meta")
|
||||
assert tracked_build.call_count == 1
|
||||
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ let
|
||||
};
|
||||
in
|
||||
{
|
||||
clanInternals.inventoryClass.inventory = eval.config;
|
||||
clanInternals.inventoryClass.inventorySerialization = eval.config;
|
||||
clanInternals.inventoryClass.introspection = clanLib.introspection.getPrios {
|
||||
options = eval.options;
|
||||
};
|
||||
|
||||
@@ -25,7 +25,7 @@ let
|
||||
};
|
||||
in
|
||||
{
|
||||
clanInternals.inventoryClass.inventory = eval.config;
|
||||
clanInternals.inventoryClass.inventorySerialization = eval.config;
|
||||
clanInternals.inventoryClass.introspection = clanLib.introspection.getPrios {
|
||||
options = eval.options;
|
||||
};
|
||||
|
||||
@@ -25,7 +25,7 @@ let
|
||||
};
|
||||
in
|
||||
{
|
||||
clanInternals.inventoryClass.inventory = eval.config;
|
||||
clanInternals.inventoryClass.inventorySerialization = eval.config;
|
||||
clanInternals.inventoryClass.introspection = clanLib.introspection.getPrios {
|
||||
options = eval.options;
|
||||
};
|
||||
|
||||
@@ -138,7 +138,7 @@ class InventoryStore:
|
||||
@classmethod
|
||||
def default_selectors(cls) -> list[str]:
|
||||
return [
|
||||
f"clanInternals.inventoryClass.inventory.{key}"
|
||||
f"clanInternals.inventoryClass.inventorySerialization.{key}"
|
||||
for key in cls.default_keys()
|
||||
]
|
||||
|
||||
@@ -146,7 +146,7 @@ class InventoryStore:
|
||||
"""Loads the evaluated inventory.
|
||||
After all merge operations with eventual nix code in buildClan.
|
||||
|
||||
Evaluates clanInternals.inventoryClass.inventory with nix. Which is performant.
|
||||
Evaluates clanInternals.inventoryClass.inventorySerialization with nix. Which is performant.
|
||||
|
||||
- Contains all clan metadata
|
||||
- Contains all machines
|
||||
@@ -164,7 +164,9 @@ class InventoryStore:
|
||||
|
||||
def get_readonly_raw(self, keys: set[str]) -> Inventory:
|
||||
attrs = "{" + ",".join(sorted(keys)) + "}"
|
||||
return self._flake.select(f"clanInternals.inventoryClass.inventory.{attrs}")
|
||||
return self._flake.select(
|
||||
f"clanInternals.inventoryClass.inventorySerialization.{attrs}"
|
||||
)
|
||||
|
||||
def _get_persisted(self) -> InventorySnapshot:
|
||||
"""Load the inventory FILE from the flake directory
|
||||
|
||||
Reference in New Issue
Block a user