DavHau
ef2a2bdb67
vars: improve tests for --regenerate
...
Ensures that all generators values actually change after running with --regenerate
2025-08-20 11:59:18 +07:00
DavHau
7b61a668e9
vars: refactor: use Machine objects instead of base_dir strings
...
Replace base_dir string parameters with Machine objects throughout the vars
module for better type safety and consistency.
2025-08-20 11:59:18 +07:00
lassulus
448c22c280
clan-cli: use automatic networking for vars upload and machines update
...
This uses the networking module to find the best_host, as we already do
with ssh and install. So if we don't supply a --target-host and a
networking module is configured, the remote should be autodetected.
Since vars upload doesn't have a --target-host argument, we always try
to use get_best_remote
2025-08-19 23:40:57 +02:00
Mic92
26b31e24a3
Merge pull request 'Make most vm tests pure.' ( #4796 ) from no-impure into main
...
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/4796
2025-08-19 16:10:08 +00:00
Jörg Thalheim
899dba5a08
tests/vms: add chroot-realpath (needed on aarch64)
2025-08-19 15:53:46 +00:00
Brian McGee
d2b94ced5a
feat(api): define list machine options as data class
2025-08-19 16:51:30 +01:00
Jörg Thalheim
cdf9fa1753
move vm configuration into a stand-alone module and include it in our test vms
...
This hasn't reduced the extra deps we have to pass to our nixos build
unfortunally, but maybe at least it can safe us a few in the future.
2025-08-19 15:45:57 +00:00
Brian McGee
9aebf02f05
feat(ui): display machine install state and install button
2025-08-19 15:09:34 +01:00
Jörg Thalheim
ffb7b91da7
drop impure checks from ci
2025-08-19 15:28:25 +02:00
Jörg Thalheim
2d264a8e5e
mark vm tests as pure
2025-08-19 15:28:25 +02:00
Jörg Thalheim
699c56c721
qemu: enable usb tablet option only on x86_64-linux
...
at least on aarch64-linux this locks up the hypervisor
2025-08-19 15:16:56 +02:00
Jörg Thalheim
2ce5388a75
qemu: fix machine types for various platforms
2025-08-19 15:16:56 +02:00
Jörg Thalheim
5b1a9d6848
vms: also prebuild for aarch64
2025-08-19 14:49:52 +02:00
Jörg Thalheim
1850abdd0d
clan-cli/vms/run: generate secret before inspect_vm
...
inspect_vm does some caching, which lead to secrets not beeing found.
2025-08-19 14:49:52 +02:00
Jörg Thalheim
ed503f64da
vms/run: move python import to the top.
2025-08-19 14:49:52 +02:00
Jörg Thalheim
4074a184b2
make vm test pure
2025-08-19 14:47:12 +02:00
Jörg Thalheim
6fe2b06f09
qemu: fix nix chroot store support
2025-08-19 14:47:12 +02:00
Jörg Thalheim
8fe7cb1b3d
virtiofsd: fix nix chroot store support
2025-08-19 14:47:12 +02:00
DavHau
815c6c9438
vars: move generation functions to clan_lib
2025-08-19 18:05:53 +07:00
DavHau
9ce563aa08
vars: log var updates under specific machine
...
This makes it easier in the logs to identify which machine a var update belongs to
2025-08-19 11:03:36 +00:00
DavHau
ab274ce932
vars: refactor - remove generate_vars() in favor of run_generators()
...
The motivation is to have one shared entry point for the CLI as well as API/GUI
2025-08-19 16:26:53 +07:00
DavHau
aadc8a1d63
vars: refactor - remove _generate_vars_for_machine function
...
This became unnecessary by now
2025-08-19 07:41:31 +00:00
DavHau
aaca8f4763
vars: refactor - move generator specific code to Generator class
...
Several functions in generate.py were specific to generator instances. Let's move them into the Generator class
2025-08-19 07:41:31 +00:00
DavHau
ee87f20471
vars: refactor - remove create_machine_vars_interactive in favor of run_generators
...
The motivation is to create one powerful entrypoint shared by the GUI as well as the CLI in order to not having to maintain too much separate code paths.
As a next step, generate_vars can probably also be removed.
2025-08-19 13:26:38 +07:00
Johannes Kirschbauer
f82d18d649
API: rename util file to 'type_to_jsonschema'
2025-08-18 19:30:43 +02:00
Johannes Kirschbauer
287a303484
API/schema: make type conversion more strict in terms of undefined fields
2025-08-18 19:29:54 +02:00
Johannes Kirschbauer
1213608f30
API: init support for narrowing union types
...
This allows to relax constraints on functions using overloaded interfaces
I.e. for unifying logic this allows passing 'callable | dict'
Conretely useful for prompt values that are asked on demand in the cli, vs upfront in the ui
2025-08-18 19:28:47 +02:00
hsjobeki
e109361e81
Merge pull request 'clanModules: remove unused code' ( #4785 ) from clean-dead-code into main
...
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/4785
2025-08-16 11:03:16 +00:00
Johannes Kirschbauer
03968d8fbc
api/inventory: remove leaked schemas
2025-08-16 12:56:30 +02:00
Johannes Kirschbauer
2f27b3941e
lib/inventory: limit access to defined keys
2025-08-16 12:56:30 +02:00
Johannes Kirschbauer
9fe457ebd5
lib/clanModules: update nix_models
2025-08-16 11:59:16 +02:00
Johannes Kirschbauer
4a51aa9316
clanModules: remove unused test code
2025-08-16 11:58:55 +02:00
Mic92
ed78e49c47
Merge pull request 'vms/inspect: mark test as pure' ( #4781 ) from no-impure into main
...
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/4781
2025-08-15 11:54:46 +00:00
Jörg Thalheim
3ef0a7919d
vms/inspect: mark test as pure
2025-08-15 13:31:27 +02:00
Jörg Thalheim
36812d5f95
test_vars_deployment: simplify test to just start one vm
2025-08-15 13:30:30 +02:00
Mic92
f5bcdb4ba0
Merge pull request 'flakes/inspect: mark test as pure' ( #4779 ) from no-impure into main
...
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/4779
2025-08-15 11:28:22 +00:00
Jörg Thalheim
b69ad0eca5
backups/list: mark as pure
2025-08-15 13:10:41 +02:00
Jörg Thalheim
b221c29694
flakes/inspect: mark test as pure
2025-08-15 13:08:30 +02:00
Mic92
ec3d224e1d
Merge pull request 'tests_secrets_generate: mark as pure' ( #4766 ) from no-impure into main
...
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/4766
2025-08-15 11:06:47 +00:00
Jörg Thalheim
c4d9b39a17
tests_secrets_generate: mark as pure
2025-08-15 12:51:20 +02:00
Luis Hebendanz
cc41185f98
Merge pull request 'flake.py: Error messages are now always ClanSelectErrors. Improved error messages' ( #4773 ) from Qubasa/clan-core:improve_select_error into main
...
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/4773
2025-08-15 06:50:46 +00:00
Qubasa
606aae7212
flake.py: Error messages are now always ClanSelectErrors. Improved error messages
...
flake.py: Fix unbound variable
flake.py: Fix test_create.py test
2025-08-15 13:46:12 +07:00
Jörg Thalheim
716b74bc02
test_machines_cli: remove more tests from the impure set
2025-08-14 17:14:35 +02:00
Mic92
3586b4f48c
Merge pull request 'clan-cli/machines/list: mark test as pure' ( #4761 ) from no-impure-machines into main
...
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/4761
2025-08-14 14:59:10 +00:00
Jörg Thalheim
9cdc6a27b6
test_copy_from_nixstore_symlink: drop test.
...
seems a bit overkill to have a test for two lines of python code...
2025-08-14 16:53:39 +02:00
Jörg Thalheim
96014c02c5
clan-cli/templates: mark tests as pure
2025-08-14 16:35:25 +02:00
Jörg Thalheim
810a2c67f9
clan-cli/machines/list: mark test as pure
2025-08-14 16:33:21 +02:00
Jörg Thalheim
fbb28afb2f
clan-cli/flash: make tests runnable in sandbox
2025-08-14 16:23:22 +02:00
hsjobeki
a6ef38dadd
Merge pull request 'vars: move generator class and bound methods into seperate module' ( #4734 ) from generator-class into main
...
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/4734
2025-08-14 14:17:14 +00:00
Jörg Thalheim
21e6a01cf3
machines/list: make tests pure
2025-08-14 15:54:00 +02:00