Commit Graph

16 Commits

Author SHA1 Message Date
DavHau
97ea9312ac api/schema: don't crash on eval error 2023-11-10 14:27:03 +07:00
DavHau
2a6e329e40 api/schema: get schema without having a machine
Also done:
- add @pytest.mark.with_core indicating that a test depends on clan-core and cannot be cached
- separate unit tests into two derivations, ones that can be cached and ones that cannot.
- fix frontend typescript code
2023-11-09 15:30:25 +07:00
DavHau
7e99454462 api/machines: better input/output validation
Also move contents tof 'config' to the top-level
2023-11-06 17:56:27 +07:00
Qubasa
00ef406713 Updated to main branch. Removed cluttering asyncio and httpx log messages 2023-10-27 23:36:45 +02:00
Qubasa
3f87ec851f All tests passing babyyy !! 2023-10-27 19:26:03 +02:00
Qubasa
c1b4fa6d55 nix fmt 2023-10-27 19:21:50 +02:00
Qubasa
3581e0c9a8 Fixing a multitude of tests 2023-10-27 19:21:50 +02:00
DavHau
0e5c7d2d13 api/machines: split off config validation into separate endpoint
- This speeds up PUT /machines{name}/config as it doesn't do the expensive check anymore
- instead use PUT /machines/{name}/verify which allows a dry-run evaluation of a config which is passed without writing it to disk
2023-10-25 17:48:37 +01:00
DavHau
bf176ad277 api/machines: allow importing extra modules
- add top-level option `clanImports` to clanCore
- clanImports can be set and checked as any other option
- buildClan resolves the clanImports from the settings.json before calling evalModules to prevent infinite recursions
- new endpoint PUT machines/{name}/schema to allow getting the schema for a specific list of imports
- to retrieve the currently imported modules, cimply do a GET or PU on machines/{name}/config which will return `clanImports` as part of the config

Still missing: get list of available modules
2023-10-25 16:36:30 +01:00
DavHau
9f6e01671f PUT /machines/{name}/config; ensure is idempotent 2023-10-24 18:48:14 +01:00
DavHau
588bde069f PUT api/machines/{name}/config: ensure only valid config is ever written
- add CLAN_MACHINE_SETTINGS_FILE variable to temporarily override the machine settings file
- do a dry-run evaluation first with the new config before persisting it.
2023-10-24 18:40:48 +01:00
DavHau
a539fb6dc6 machines: add endpoint machines/{name}/ verify 2023-10-24 16:31:37 +01:00
Jörg Thalheim
87f0b090ef cli: rename clan_flake to test_flake 2023-09-15 12:36:16 +02:00
Jörg Thalheim
02f421546c rename machine_flake back to clan_flake 2023-09-14 17:06:07 +02:00
Jörg Thalheim
2048ffccb0 drop clan_flake fixture 2023-09-14 16:57:48 +02:00
Jörg Thalheim
451ecbb691 rename test_api_machines test to be consistent with the rest 2023-09-14 13:02:58 +02:00