Commit Graph

6163 Commits

Author SHA1 Message Date
Johannes Kirschbauer
e9ce7376f2 fix(clan_cli/tests): fix some imports after rebase 2025-04-08 20:26:38 +02:00
Johannes Kirschbauer
69c717ae1f Tests: reconfigure pytest test folder after moving it into clan_cli 2025-04-08 20:13:13 +02:00
Johannes Kirschbauer
4da6cf594d Tests: exclude test folder itself from autmatic dataclass checks 2025-04-08 20:12:03 +02:00
a-kenji
fae630842d pkgs/cli: Move the test folder inside the python module
Move the `tests` folder to `clan_cli/tests`.

As we now want part of our tests to live next to the functions that are
tested - tests that are not in the `/tests` module also need access to
the configured test fixtures that are exposed by the `pytest_plugins`
declaration.

The following folder structure doesn't support this model:

```
├── clan_cli
│   ├── api
│   │    └── api_init_test.py
├── tests/
│   ├── conftest.py
│   └── ...
```

Here `api_init_test.py` even when importing the test functions will not
have the fixtures configured.

There is a way to configure python to import the fixtures from another
[`project/module`](https://docs.pytest.org/en/stable/how-to/fixtures.html#using-fixtures-from-other-projects), but this seems to *generally* be discouraged.

So moving the `conftest.py` to the toplevel and the `/tests` folder into
the toplevel seems to be a sensible choice choice.
2025-04-08 20:12:01 +02:00
Michael Hoang
37cc831695 Merge pull request 'flake-parts: ensure flake.darwinConfigurations is mergeable' (#3244) from push-zurymrrrxwur into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/3244
2025-04-08 17:20:16 +00:00
renovate[bot]
91ece9ef21 chore(deps): lock file maintenance 2025-04-08 17:10:45 +00:00
Michael Hoang
69141d02d9 flake-parts: remove unnecessary mkSubmoduleOptions
This is no longer necessary as of https://github.com/NixOS/nixpkgs/pull/156533.
2025-04-08 19:03:29 +02:00
Michael Hoang
99589c1141 flake-parts: ensure flake.darwinConfigurations is mergeable
We didn't run into issues previously for `nixosConfigurations` because
there is already a [flake-parts module] that creates the option inside
`flake`.

[flake-parts module]: https://github.com/hercules-ci/flake-parts/blob/main/modules/nixosConfigurations.nix
2025-04-08 19:03:29 +02:00
renovate[bot]
c7029b408b fix(deps): update tanstack-query monorepo to v5.72.1 2025-04-08 16:50:21 +00:00
renovate[bot]
f2aad30c17 chore(deps): update nixpkgs digest to b0b4b5f 2025-04-08 16:10:09 +00:00
Mic92
012154e257 Merge pull request 'sops: fix compatibility with new format' (#3242) from directory-context into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/3242
2025-04-08 16:05:43 +00:00
Jörg Thalheim
381c4d292c bump disko to fix quoting issue 2025-04-08 17:45:48 +02:00
Jörg Thalheim
be37194b9a sops: fix compatibility with new format
The new format can have null values now.
2025-04-08 17:44:23 +02:00
DavHau
ba69a8a860 inventory tests: generate vars for dummy test 2025-04-08 21:06:23 +07:00
DavHau
7abaee1398 data-mesher: generate vars for test vis update-vars.py 2025-04-08 20:54:11 +07:00
DavHau
607a7fedd4 data-mesher: use inventory test framework for vars 2025-04-08 20:54:11 +07:00
DavHau
26e97c066c inventory tests: add vars support
- Add support for leading vars
- Extend test to test for vars support
- Improve update-vars.py to take test name as argument
2025-04-08 20:54:11 +07:00
renovate[bot]
ffac38e299 chore(deps): update sops-nix digest to 69d5a5a 2025-04-08 12:50:12 +00:00
hsjobeki
6df1b4a085 Merge pull request 'feat(inventory/instances): add extendSettings as argument to perInstance, perMachine' (#3233) from hsjobeki/clan-core:role-settings into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/3233
2025-04-08 12:46:44 +00:00
Johannes Kirschbauer
375b18fd32 feat(inventory/instances): dont set module location to allow underlying error location to bubble up 2025-04-08 14:36:29 +02:00
renovate[bot]
6f922bace7 chore(deps): update data-mesher digest to 302252a 2025-04-08 12:10:12 +00:00
Mic92
413d932238 Merge pull request 'directory-context' (#3234) from directory-context into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/3234
2025-04-08 12:09:36 +00:00
Jörg Thalheim
681d28430b inventory: don't loose string context of directory 2025-04-08 13:50:27 +02:00
Johannes Kirschbauer
5db084e011 feat(inventory/instances): add extendSettings as argument to perInstance, perMachine 2025-04-08 13:15:06 +02:00
Mic92
faf1af94a3 Merge pull request 'user-password: fix variables beeing incorrect' (#3229) from user-password into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/3229
2025-04-08 10:16:15 +00:00
Mic92
0837009d2c Merge pull request 'docs-errata' (#3161) from docs-errata into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/3161
2025-04-08 10:00:53 +00:00
Brian McGee
d1f640b145 fix(docs): add the requirement to export clan.templates in flake outputs to migration guide 2025-04-08 10:44:36 +01:00
Brian McGee
b31cf42d2d fix(docs): tighten up validation for meta.name and improved description 2025-04-08 10:44:35 +01:00
Brian McGee
8f290c08b7 fix(docs): correct flake sample in migration guide
diff --git a/docs/site/manual/migration-guide.md b/docs/site/manual/migration-guide.md
index 551a3ef0..38be9a0e 100644
--- a/docs/site/manual/migration-guide.md
+++ b/docs/site/manual/migration-guide.md
@@ -77,13 +77,18 @@ For the provide flake example, your flake should now look like this:
 ```nix
 {
   inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
+
+  inputs.clan-core = {
+    url = "git+https://git.clan.lol/clan/clan-core";
+    inputs.nixpkgs.follows = "nixpkgs";
+  };

-  outputs = { self, nixpkgs, ... }:
+  outputs = { self, nixpkgs, clan-core, ... }:
   let
     clan = clan-core.lib.buildClan {
         self = self; # this needs to point at the repository root
         specialArgs = {};
-        inventory.meta.name = "NEEDS_TO_BE_UNIQUE"; # TODO: Changeme
+        meta.name = throw "Change me to something unique";

         machines = {
             berlin = {
2025-04-08 10:44:33 +01:00
Jörg Thalheim
6ba2d7fc02 user-password: fix variables beeing incorrect 2025-04-08 09:37:05 +00:00
Jörg Thalheim
b1ddf86115 user-password: fix variables beeing incorrect 2025-04-08 11:36:43 +02:00
Mic92
84a3f709e0 Merge pull request 'user-password: migrate to vars' (#3227) from user-password into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/3227
2025-04-08 08:44:32 +00:00
Jörg Thalheim
99bcd3f797 installation: use networkd everywhere 2025-04-08 10:33:48 +02:00
Jörg Thalheim
f24df0e33b user-password: migrate to vars 2025-04-08 10:16:59 +02:00
DavHau
a8e73f0260 inventory tests: generalize update-vars.py
... and move to pkgs/scripts/
2025-04-08 07:45:30 +00:00
Michael Hoang
817e9ecc86 Merge pull request 'build-clan: support constructing darwinConfigurations' (#3115) from mac into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/3115
2025-04-08 07:44:09 +00:00
Michael Hoang
ce85aebc17 tests: add --show-trace to nix-unit tests 2025-04-08 08:53:29 +02:00
Michael Hoang
83a2de0f47 cli: don't update macOS machines 2025-04-08 08:53:29 +02:00
Michael Hoang
b5a57a72a0 build-clan: support constructing darwinConfigurations 2025-04-08 08:53:29 +02:00
Michael Hoang
c2eaf74df5 lib/jsonschema: fix enum support 2025-04-08 08:53:27 +02:00
Michael Hoang
8bc2112e45 flake: add nix-darwin 2025-04-08 07:39:49 +02:00
renovate[bot]
dd30ae84bd chore(deps): update typescript-eslint monorepo to v8.29.1 2025-04-07 17:20:17 +00:00
DavHau
99f8bcc13c data-mesher: use new test framework 2025-04-07 20:43:19 +07:00
DavHau
11cd91e882 inventory tests: improve framework to set better defaults 2025-04-07 19:58:53 +07:00
DavHau
d7c3039666 add CLAN_NO_COMMIT env var to disable committing
This is required when calling vars generators for generating vars for
tests
2025-04-07 18:59:19 +07:00
renovate[bot]
d57522f9fe fix(deps): update tanstack-query monorepo to v5.72.0 2025-04-07 09:40:15 +00:00
renovate[bot]
37afb21775 chore(deps): update data-mesher digest to aea65b1 2025-04-07 07:20:13 +00:00
renovate[bot]
fe5b3f8d6b chore(deps): update data-mesher digest to 54bbd42 2025-04-07 00:40:13 +00:00
renovate[bot]
76c02d19ab chore(deps): update sops-nix digest to 523f58a 2025-04-06 07:10:20 +00:00
renovate[bot]
7e407f79e0 chore(deps): update data-mesher digest to 3239dc2 2025-04-06 06:50:09 +00:00