Jörg Thalheim
c20c0d4ea8
enable python tests without core on macOS
2025-03-25 18:29:49 +01:00
Jörg Thalheim
7a46c8b8de
skip sshd-based tests on macOS for now
2025-03-25 18:29:49 +01:00
Mic92
af15a0eb97
Merge pull request 'don't add nixpkgs to nix registry to not conflict with nixpkgs' ( #3096 ) from nixpkgs-conflict into main
...
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/3096
2025-03-22 16:16:27 +00:00
lassulus
b925d1c608
Merge pull request 'clan-cli: cleanup broken deployment cache' ( #3066 ) from fix_caching into main
...
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/3066
2025-03-21 15:49:22 +00:00
Jörg Thalheim
60302dd1d2
tests/sshd: add a 5 second timeout for sshd to start
2025-03-21 12:41:36 +01:00
Qubasa
dfd550f9be
clan-cli: cleanup broken deployment cache
2025-03-20 00:17:36 -07:00
Michael Hoang
62d9a325a2
checks: use pkgs.nixVersions.latest until pkgs.nix is 2.26+
2025-03-20 15:52:13 +09:00
Jörg Thalheim
c5e30a40b4
pytests: use /tmp on macos to avoid unix socket issues
2025-03-19 18:35:38 +01:00
Jörg Thalheim
ddb5bba48a
disabe pytests on macOS for now
2025-03-19 17:33:27 +01:00
Jörg Thalheim
9a00459861
tests/fixtures_flakes: remove unused remote flag
2025-03-19 16:55:30 +01:00
Jörg Thalheim
43035b85a5
always resolve symlinks for TemporaryDirectory
...
On macOS mktemp returns a temporary directory in a symlink.
Nix has a bug where it won't accept path:// located in a symlink.
This avoid this issue by always resolving symlinks as returned by
TemporaryDirectory.
2025-03-19 16:47:18 +01:00
Jörg Thalheim
490e54b278
make sshd test work on macOS
2025-03-19 15:55:20 +01:00
Louis Opter
daeeb2ee43
clan-cli: add DavHau's explanation about the with_core pytest marker
...
See: https://git.clan.lol/clan/clan-core/pulls/2994#issuecomment-22542
2025-03-19 10:53:38 +00:00
Louis Opter
546ed03a90
clan-cli: tests: call SopsSetup.init while setting up fixtures
...
We do this by introducing `flake_with_sops` fixture, that calls the
init method ahead of the test. We did not want to do this in the `flake`
fixture since not all tests using the `flake` fixture need to have sops
setup.
2025-03-19 10:53:38 +00:00
Louis Opter
b52ec05497
clan-cli: don't try to delete a dir that doesn't exist in the pass vars backend
...
Do not crash in `delete_store`, if the machine has no vars, or the store
has been deleted already.
2025-03-19 10:53:38 +00:00
Louis Opter
4120a89115
clan-cli: do not crash if a machine being deleted is missing from the inventory
...
We implement that by actually raising `KeyError` in `inventory.delete_by_path`
(as advertised in the docstring), since it makes more sense to catch a
`KeyError` than a generic `ClanError`.
2025-03-19 10:53:38 +00:00
Louis Opter
cd248b69db
clan-cli: machines delete: delete the machine's vars and secrets
...
When a machine is deleted with `clan machines delete`, remove its
vars and legacy secrets, and update any secrets that reference the
machine's key.
This command is a superset of `clan secrets machine delete`, and I am
wondering if we could remove the `clan secrets machine` subcommand,
unless there is an use case for having a machine defined without its
key, and any secrets/vars?
Note:
- This deletes the `ListSecretsOptions` dataclass, as it did not seem to
bring any value, especially since `list_secrets` was receiving its
individual members instead of the whole dataclass. We can always bring
it back if complexity grows to demand it.
2025-03-19 10:53:38 +00:00
Louis Opter
f7bec766bc
clan-cli: add delete and delete_store to StoreBase
...
- `delete` lets you delete a specific var under a specific generator;
- `delete_store` deletes an entire store.
The `delete` method could be useful to "garbage-collect" unused vars as
a machine's configuration changes.
The `delete_store` method can be used to delete all the vars for a
machine when the machine is deleted. The current behavior is to leave
everything behind.
Important point:
- `delete_store` needs to be idempotent because public and
"private"/"secret" vars for a machine can share the same physical
store (directory), and deleting either type of store (public or
private) will delete both.
2025-03-19 10:53:38 +00:00
Louis Opter
77b53a366e
clan-cli: add an integration test for clan machines delete
...
This tests the changes made to that command to clean-up vars and secrets
when a machine is deleted.
2025-03-19 10:53:38 +00:00
Louis Opter
37869839cf
clan-cli: tests/age_keys.py add notes, move function to check sops recipients
...
This supports the new integration test for `clan machines delete`.
2025-03-19 10:53:38 +00:00
Jörg Thalheim
b84230ff90
deduplicate CLAN_CORE/CLAN_CORE_PATH environment variables
2025-03-19 10:30:52 +00:00
Qubasa
63a0e5f35d
clan-cli: Fix templates not downloading template, Make templates use Flake cache, Fix flake cache exception on conditional attribute, add more tests
2025-03-19 10:30:52 +00:00
Jörg Thalheim
527154070c
use pathlib.iterdir() everywhere
2025-03-18 15:34:06 +01:00
Jörg Thalheim
d9c3cc8c68
cli: increase timeout for pytest
2025-03-18 14:04:43 +01:00
Jörg Thalheim
f24d27c895
try to reproduce CI error with newer nix version
2025-03-11 12:23:59 +00:00
Jörg Thalheim
10c89fe9f9
fix only the first generator of each machine beeing re-encrypted
2025-03-11 12:09:00 +01:00
Jörg Thalheim
903831acaf
don't log cache miss by default
...
This is expected and happens regular, so there is no value in logging
this.
2025-03-11 12:03:55 +01:00
Jörg Thalheim
86e8b26409
add test for parsing ssh options
2025-03-11 11:27:04 +01:00
DavHau
af66b63286
clan-cli/tests: limit jobs to 16
...
This reduces overload on the CI, as it already runs multiple test instances in parallel (with-core, without-core, etc), and otherwise would spawn 96 workers for each of those.
2025-03-10 13:20:18 +00:00
Michael Hoang
d79d1811d6
install: let nixos-anywhere determine where to build automatically
...
This fixes installing machines that don't have `system` defined i.e.
when running `clan machines install` with `--update-hardware-config`.
2025-03-10 12:30:03 +09:00
DavHau
db2e2e974c
vars+facts: use bwrap only if supported
2025-03-09 13:52:15 +07:00
Qubasa
5c4fc7b852
clan-cli: Make Lix compatible again
2025-03-07 14:06:35 +01:00
Qubasa
4c138c6377
clan-cli: Revert generating facts in clan facts list, for consistency
2025-03-03 01:40:40 +01:00
Qubasa
0602b9d01c
clan-cli: Fix wrong clan vars generate regression added by 4ff5acfe29
2025-03-02 19:53:17 +01:00
Qubasa
75dc906183
clan-cli: Fix get_all_facts forgetting to generate facts before getting them
2025-03-02 15:07:57 +01:00
Michael Hoang
f0e5b14846
vars/sops: fix clan vars fix missing machine name in error message
2025-03-02 08:22:23 +07:00
Qubasa
a0aaa5fc69
clan-cli: Remove can_build_locally and replace with nixos-anywhere --build-on auto
2025-03-01 17:52:41 +01:00
Qubasa
eb9b4bdb6b
clan-cli: Make host upload function support uploading single files too
2025-03-01 17:10:42 +01:00
lassulus
df61afe0d2
clan-cli: try to fix CI bug again
2025-02-28 04:58:42 +00:00
lassulus
669a28c4e5
clan-cli: set ssh port for nix copy
2025-02-28 04:58:42 +00:00
lassulus
0104c41921
clan-cli: another try to fix the CI bug
2025-02-27 08:24:28 +01:00
lassulus
e3ce93a6ff
clan-cli: check if paths exist in cache check
2025-02-27 02:53:41 +01:00
Qubasa
ba2865e940
clan-cli: Fix flake.py missing cache eviction if there is a garbage collected path
2025-02-27 01:01:50 +01:00
r17x
e9ffd923d5
fix(clan-cli): fix cross system
2025-02-26 14:27:00 +07:00
Pablo Ovelleiro Corral
8aab746bd0
Apply suggestion
2025-02-25 08:51:51 +01:00
Pablo Ovelleiro Corral
d9e0741329
Fix exists() check for age files
2025-02-25 08:51:51 +01:00
Louis Opter
51a7a86817
clan-cli: add unit tests for test_parse_deployment_address
...
Follow-up to #2899 , more thorough than #2909 .
2025-02-25 05:31:49 +00:00
Qubasa
d7c4a5d59d
clan-cli: Remove allow_uknown_placeholders flag. With upcoming nixos-anywhere patch this is not needed anymore.
2025-02-23 21:50:21 +01:00
Qubasa
ad3786ad76
clan-cli: Add an optional reference to an AsyncFuture to track origin of task.
2025-02-23 21:44:00 +01:00
lassulus
300aaa48e7
clan-cli: use new flake caching for machines
2025-02-23 15:58:03 +01:00