Commit Graph

99 Commits

Author SHA1 Message Date
Qubasa
c7ec9a9715 clan-cli: Add support for ForwardRef type in type_to_jsonschema and tests 2025-10-22 14:45:04 +02:00
Qubasa
23008d1f73 openapi: Add a test for TypeAliasing 2025-10-14 12:06:04 +02:00
Qubasa
f1747079c8 clan_cli: Add typeAlias support for api.py 2025-10-14 11:30:48 +02:00
DavHau
37a49a14f4 vars: fix re-generate behavior for dependencies of shared vars (#5001)
fixes https://git.clan.lol/clan/clan-core/issues/3791

This fixes multiple issues we had when re-generating shared vars.

Problem 1: shared vars are re-generated for each individual machine instead of just once (see #3791)

Problem 2: When a shared var was re-generated for one machine, dependent vars on other machines did not get re-generated, leading to broken state

Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5001
2025-09-02 14:54:24 +00:00
Jörg Thalheim
4cb17d42e1 PLR2004: fix 2025-08-26 16:21:15 +02:00
Jörg Thalheim
d5b09f18ed RET504: fix 2025-08-26 15:55:23 +02:00
Jörg Thalheim
d4bdaec586 SIM102: fix 2025-08-26 15:22:25 +02:00
Jörg Thalheim
b2a54f5b0d PLC0415: fix 2025-08-26 14:46:42 +02:00
Jörg Thalheim
63697ac4b1 various fixes 2025-08-26 13:07:22 +02:00
Jörg Thalheim
8f8426de52 PGH003: fix 2025-08-26 11:36:38 +02:00
DavHau
2f1dc3a33d API: fix serialization of union types
Due to this bug in serde.py, the run_generators API id not work for the frontend
2025-08-26 15:16:55 +07:00
Jörg Thalheim
917407c475 D210: fix 2025-08-25 14:56:48 +02:00
Jörg Thalheim
ef5ab0c2f4 D404: fix 2025-08-25 14:56:48 +02:00
Mic92
05665b1c7e Merge pull request 'ruff-3-arg-fixes' (#4934) from ruff-3-arg-fixes into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/4934
2025-08-25 12:54:04 +00:00
Jörg Thalheim
04457b1272 ARG001: fix 2025-08-25 14:46:12 +02:00
Jörg Thalheim
ab50b433ee type_to_jsonschema: throw correct Error 2025-08-25 14:11:25 +02:00
Jörg Thalheim
6a2dfb8176 S101: fix 2025-08-25 14:11:25 +02:00
Jörg Thalheim
dc5485d9f1 ruff: replace asserts outside of tests with Exceptions 2025-08-25 13:06:04 +02:00
Jörg Thalheim
ea2d6aab65 ruff: apply automatic fixes 2025-08-25 11:34:41 +02: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
Johannes Kirschbauer
bb6fab1168 api: init notification queue 2025-08-11 15:24:41 +02:00
a-kenji
e5bea3d49a pkgs/clan/lib(directory): Add API function to query the configured directory
Similar to the implementation in #4526
Co-authored-by: Mayeu <m@mayeu.me>
2025-08-09 15:39:43 +02:00
a-kenji
a1874c940e pkgs/cli/lib: Fix api test 2025-08-09 12:48:13 +02:00
a-kenji
62c4f735ed pkgs/clan/lib: Move get_clan_directories to dirs 2025-07-30 15:07:05 +02:00
Kenji Berthold
1791743444 Merge pull request 'pkgs/clan/lib: Add clan api to get the relative clan directory' (#4534) from kenji/ke-add-computed-directory-function into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/4534
Reviewed-by: hsjobeki <hsjobeki@gmail.com>
2025-07-30 12:30:30 +00:00
a-kenji
c7ad875e7e pkgs/clan/lib: Add clan api to get the relative clan directory
This is a Continuation of: #4519
2025-07-30 14:22:23 +02:00
a-kenji
e167137672 pkgs/cli/lib: Remove obsolete clan creation function 2025-07-30 12:41:42 +02:00
a-kenji
31438d6781 pkgs/clan/lib: Fix directory functionality
Fix the directory functionality of clan (clan.directory).
The python API interface was not able to distinguish if the directory
was set to anything other than `self.src`.
Breaking every command that relied on the clan directory, for example:
- `clan machines update`
- `clan machines update-hardware-config`
See more in #2906

This is the first step in fixing all those commands.
Individual command support and implementation will be implemented in
follow ups.
2025-07-29 17:51:12 +02:00
Qubasa
94662b722d clan-lib: Remove injected "op_key" argument from all functions and do it over the threadcontext instead. Remove double threading in http server 2025-07-24 14:25:20 +07:00
Johannes Kirschbauer
ceb0221daf lib/disks: move from api to templates 2025-07-13 13:57:02 +02:00
Johannes Kirschbauer
943dde4bbf lib/modules: move from api to services module 2025-07-13 13:57:02 +02:00
Johannes Kirschbauer
5f19e76cd0 api/modules: remove redundant localModules 2025-07-13 11:52:19 +02:00
Johannes Kirschbauer
9ece8c6d10 Templates/cli: improve ux and docs 2025-07-12 17:21:23 +02:00
Johannes Kirschbauer
78b1931271 lib/disks: add parameter to disable hardware checking 2025-07-11 18:53:54 +02:00
Johannes Kirschbauer
480fdfaf8a API: rename {open_file, open_clan_folder} into {get_system_file, get_clan_folder} 2025-07-10 18:42:03 +02:00
Johannes Kirschbauer
7f3292ceb0 Docs: improve api docs of {open_file, open_clan_folder} 2025-07-10 18:40:48 +02:00
Qubasa
695141b2ae clan-app: Make http server non blocking, add tests for the http server and for cancelling tasks 2025-07-10 17:21:18 +07:00
Qubasa
dbb3e889e1 clan-lib: Fix @API.register_abstract not throwing correct error when called directly without implementation
clan-app: Fix mypy lint

clan-lib: Mark test as with_core
2025-07-10 15:09:51 +07:00
Qubasa
b1c3acb008 clan-app: Implement open_clan_folder api request 2025-07-10 14:19:19 +07:00
Johannes Kirschbauer
474a0a3f9d api: rename {list_system_services_mdns, list_system_storage_devices} 2025-07-09 16:51:42 +02:00
Johannes Kirschbauer
186ce03e6d api: rename run_blocking_task into run_task_blocking 2025-07-09 09:43:56 +02:00
Johannes Kirschbauer
3e295869cc api/disk_schema: make getter consistent 2025-07-08 16:31:51 +02:00
Qubasa
0c54a0f6de clan-app: Fix delete tasks
clan-app: Fix delete tasks
2025-07-08 18:11:59 +07:00
Qubasa
60263bac8a clan-cli: Add verb 'cancel' to openapi 2025-07-08 17:43:14 +07:00
Qubasa
d8251dce2b clan-app: Generalize architecture for API requests 2025-07-08 17:32:59 +07:00
Qubasa
389e726521 clan-app: Add plug and play middleware interface 2025-07-08 17:32:59 +07:00
Qubasa
152ac2c07e clan-cli: Fix Ruff linting errors
clan-cli: Ruff fixes

ignore noqa lint

fix more ruff issues
2025-07-08 17:25:02 +07:00
Qubasa
f854c39292 clan-cli: Fix regression in ruff linter, where linter rules got overriden by local pyproject.toml
clan-app: Fix ruff regression where linter rules got overriden by local pyproject.toml
2025-07-08 17:23:32 +07:00