Add explicit dependency validation to vars, so that proper error
messages can be surfaced to the user.
Instead of:
```
Traceback (most recent call last):
File "/home/lhebendanz/Projects/clan-core/pkgs/clan-cli/clan_lib/async_run/__init__.py", line 154, in run
self.result = AsyncResult(_result=self.function(*self.args, **self.kwargs))
~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/lhebendanz/Projects/clan-core/pkgs/clan-cli/clan_cli/machines/update.py", line 62, in run_update_wit
h_network
run_machine_update(
~~~~~~~~~~~~~~~~~~^
machine=machine,
^^^^^^^^^^^^^^^^
...<2 lines>...
upload_inputs=upload_inputs,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/home/lhebendanz/Projects/clan-core/pkgs/clan-cli/clan_lib/machines/update.py", line 158, in run_machine_u
pdate
run_generators([machine], generators=None, full_closure=False)
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/lhebendanz/Projects/clan-core/pkgs/clan-cli/clan_lib/vars/generate.py", line 156, in run_generators
all_generators = get_generators(machines, full_closure=True)
File "/home/lhebendanz/Projects/clan-core/pkgs/clan-cli/clan_lib/vars/generate.py", line 50, in get_generators
all_generators_list = Generator.get_machine_generators(
all_machines,
flake,
include_previous_values=include_previous_values,
)
File "/home/lhebendanz/Projects/clan-core/pkgs/clan-cli/clan_cli/vars/generator.py", line 246, in get_machine_ge
nerators
if generators_data[dep]["share"]
~~~~~~~~~~~~~~~^^^^^
KeyError: 'bla'
```
We now get:
```
$> Generator 'my_generator' on machine 'my_machine' depends on generator 'non_existing_generator', but 'non_existing_generator' does not exist
```
Closes: #5698
When vars are marked with neededFor="activation" or "partitioning", they
need to be available early in the boot process. However, the populate_dir
methods in both sops and password_store secret backends were only calling
self.get() which only retrieves secret vars from the .../secret path.
This caused public vars (stored at .../value) to fail with "Secret does
not exist" errors when trying to upload them.
The fix uses file.value property instead, which properly delegates to the
correct store (SecretStore or FactStore) based on whether the file is
marked as secret or public.
Fixes affected all neededFor phases in both backends:
- sops: activation and partitioning phases
- password_store: activation and partitioning phases