From 03fe06285be425c161a0f1820bde59306b90e14e Mon Sep 17 00:00:00 2001 From: DavHau Date: Tue, 24 Jun 2025 15:13:27 +0700 Subject: [PATCH 1/3] inventory interface: add description for module.name --- lib/inventory/build-inventory/interface.nix | 6 ++++++ pkgs/clan-cli/clan_lib/nix_models/clan.py | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/inventory/build-inventory/interface.nix b/lib/inventory/build-inventory/interface.nix index b3978f861..ed3b4f488 100644 --- a/lib/inventory/build-inventory/interface.nix +++ b/lib/inventory/build-inventory/interface.nix @@ -393,6 +393,12 @@ in options.name = lib.mkOption { type = types.str; default = name; + defaultText = ""; + description = '' + Attribute of the clan service module imported from the chosen input. + + Defaults to the name of the instance. + ''; }; }; default = { }; diff --git a/pkgs/clan-cli/clan_lib/nix_models/clan.py b/pkgs/clan-cli/clan_lib/nix_models/clan.py index 8fdbef8a4..ab0cde71f 100644 --- a/pkgs/clan-cli/clan_lib/nix_models/clan.py +++ b/pkgs/clan-cli/clan_lib/nix_models/clan.py @@ -15,12 +15,12 @@ class Unknown: pass -InventoryInstanceModuleInputType = str InventoryInstanceModuleNameType = str +InventoryInstanceModuleInputType = str class InventoryInstanceModule(TypedDict): + name: str input: NotRequired[InventoryInstanceModuleInputType] - name: NotRequired[InventoryInstanceModuleNameType] From f81c2254e167b6cdb8fd1bdc3516015e39236518 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Tue, 24 Jun 2025 10:10:27 +0000 Subject: [PATCH 2/3] Update dependency tailwindcss to v4 --- pkgs/clan-app/ui-2d/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/clan-app/ui-2d/package.json b/pkgs/clan-app/ui-2d/package.json index c1fe54e38..44354c7c8 100644 --- a/pkgs/clan-app/ui-2d/package.json +++ b/pkgs/clan-app/ui-2d/package.json @@ -44,7 +44,7 @@ "prettier": "^3.2.5", "solid-devtools": "^0.34.0", "storybook": "^9.0.8", - "tailwindcss": "^3.4.3", + "tailwindcss": "^4.0.0", "typescript": "^5.4.5", "typescript-eslint": "^8.32.1", "vite": "^6.3.5", From d4a4f61f74a3c71404189b6c73e2b43560bb4827 Mon Sep 17 00:00:00 2001 From: a-kenji Date: Tue, 24 Jun 2025 11:09:21 +0200 Subject: [PATCH 3/3] pkgs/agit: Add all commits since main to edit comment This is a first step for adding all the commits to the `agit c` and prefilling it. --- pkgs/agit/agit.py | 58 ++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 50 insertions(+), 8 deletions(-) diff --git a/pkgs/agit/agit.py b/pkgs/agit/agit.py index 8557730ea..39f31e71d 100644 --- a/pkgs/agit/agit.py +++ b/pkgs/agit/agit.py @@ -204,9 +204,51 @@ def get_latest_commit_info() -> tuple[str, str]: return title, body +def get_commits_since_main() -> list[tuple[str, str]]: + """Get all commits since main as (title, body) tuples.""" + exit_code, commit_log, error = run_git_command( + [ + "git", + "log", + "main..HEAD", + "--no-merges", + "--pretty=format:%s|%b|---END---", + ] + ) + + if exit_code != 0: + print(f"Error getting commits since main: {error}") + return [] + + if not commit_log: + return [] + + commits = [] + commit_messages = commit_log.split("---END---") + + for commit_msg in commit_messages: + commit_msg = commit_msg.strip() + if not commit_msg: + continue + + parts = commit_msg.split("|") + if len(parts) < 2: + continue + + title = parts[0].strip() + body = parts[1].strip() if len(parts) > 1 else "" + + if not title: + continue + + commits.append((title, body)) + + return commits + + def open_editor_for_pr() -> tuple[str, str]: """Open editor to get PR title and description. First line is title, rest is description.""" - commit_title, commit_body = get_latest_commit_info() + commits_since_main = get_commits_since_main() with tempfile.NamedTemporaryFile( mode="w+", suffix="COMMIT_EDITMSG", delete=False @@ -217,14 +259,14 @@ def open_editor_for_pr() -> tuple[str, str]: temp_file.write("# The first line will be used as the PR title.\n") temp_file.write("# Everything else will be used as the PR description.\n") temp_file.write("#\n") - temp_file.write("# Current commit information:\n") + temp_file.write("# All commits since main:\n") temp_file.write("#\n") - if commit_title: - temp_file.write(f"# {commit_title}\n") - temp_file.write("#\n") - if commit_body: - for line in commit_body.split("\n"): - temp_file.write(f"# {line}\n") + for i, (title, body) in enumerate(commits_since_main, 1): + temp_file.write(f"# Commit {i}:\n") + temp_file.write(f"# {title}\n") + if body: + for line in body.split("\n"): + temp_file.write(f"# {line}\n") temp_file.write("#\n") temp_file.flush() temp_file_path = temp_file.name