From 703648876663b05b4dc86351bb66642ed3fb9c13 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Thu, 12 Nov 2026 16:28:10 +0000 Subject: [PATCH] fix(orchestrator): name kvb-git-gc for worktree-held branches The pkgmgr wrappers replay renamed kvb-git-branch-gc: branch cleanup outside worktrees is now kvb-git-branch-cleanup, and removing merged branches with their worktrees is kvb-git-gc. The hub's held-by-worktree hint, the cleanup dialog and its test now name kvb-git-gc. Co-Authored-By: Claude Opus 5.5 --- orchestrator/kvb_orchestrator/tree.py | 2 +- orchestrator/templates/page-cleanup.js | 2 +- tests/test_hub_cleanup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/orchestrator/kvb_orchestrator/tree.py b/orchestrator/kvb_orchestrator/tree.py index 14ad298..fb12b17 100644 --- a/orchestrator/kvb_orchestrator/tree.py +++ b/orchestrator/kvb_orchestrator/tree.py @@ -18,7 +18,7 @@ FLOW_SOURCE = re.compile(r"[a-z][a-z0-9-]{0,31}") INVALID = "invalid" # renaming it silently stops the tree timer: kvb-orchestrator-tree.service tests this file's age TREE_HEARTBEAT = "tree-heartbeat" -GC_SKILL = "kvb-git-branch-gc" +GC_SKILL = "kvb-git-gc" GC_COMPOSE_DOWN = ("docker", "compose", "-p", "{project}", "down", "-v", "--remove-orphans") diff --git a/orchestrator/templates/page-cleanup.js b/orchestrator/templates/page-cleanup.js index 7d162e3..81bec6a 100644 --- a/orchestrator/templates/page-cleanup.js +++ b/orchestrator/templates/page-cleanup.js @@ -29,7 +29,7 @@ } }); openSheet(items.length > 1 ? `Delete ${items.length} merged branches` : `Delete ${items[0].branch}`, [ - h("p", {class: "muted"}, "Dry run of pkgmgr branch cleanup for exactly these entries: it deletes the local branch and never touches a worktree, Compose stack or volume. No remote branch: the host refuses an entry whose plan deletes one. A branch held by a worktree is not deleted here: branch gc (kvb-git-branch-gc, pkgmgr gc) removes it, and its docker compose down -v deletes the stack's volumes. The host checks your signature and refuses every entry whose state has changed since."), + h("p", {class: "muted"}, "Dry run of pkgmgr branch cleanup for exactly these entries: it deletes the local branch and never touches a worktree, Compose stack or volume. No remote branch: the host refuses an entry whose plan deletes one. A branch held by a worktree is not deleted here: branch gc (kvb-git-gc, pkgmgr gc) removes it, and its docker compose down -v deletes the stack's volumes. The host checks your signature and refuses every entry whose state has changed since."), h("ul", {class: "mini", "aria-label": "Dry run"}, rows), outcome, h("div", {class: "actions"}, h("span", {class: "spacer"}), btn("Cancel", "btn ghost", closeSheet), confirm), diff --git a/tests/test_hub_cleanup.py b/tests/test_hub_cleanup.py index 1309ca5..634e2ca 100644 --- a/tests/test_hub_cleanup.py +++ b/tests/test_hub_cleanup.py @@ -117,7 +117,7 @@ class TestHubCleanup(HubCase): def test_a_branch_held_by_a_worktree_offers_no_delete_and_names_branch_gc(self): item = self.ready(True, True) done = self.branches()["feature/done"] - held = f"held by worktree {item['worktree']}: pkgmgr branch cleanup skips it, use branch gc (kvb-git-branch-gc, pkgmgr gc)" + held = f"held by worktree {item['worktree']}: pkgmgr branch cleanup skips it, use branch gc (kvb-git-gc, pkgmgr gc)" self.assertEqual((done["cleanup"], done["held"], done["plan"][1]), (None, held, held)) status, body = self.sign([item]) self.assertEqual((status, body.decode()), (400, f"feature/done in {item['repository']} is no merged-clean branch without skip reason at that tip in the tree file\n"))