fix(kvb-org-operator): list only runnable rows in the bash block

Legacy register rows carry a prose title and no directory. They stay in the table but no longer land in the copy-paste bash block as if they were commands; with no runnable row the block is omitted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kevin Veen-BirkenbachandClaude Opus 5.5 committed 2026-11-04 17:07:24 +01:00
1 parent b4c4cefadd
commit 997a01ccfa
2 files changed
+18 -8

No files matched your search

+11 -2
View File
@@ -194,8 +194,17 @@ class TestOperator(unittest.TestCase):
self.assertEqual(result.returncode, 0, result.stderr)
self.assertEqual(
self._out("list"),
[HEADER, "|---|---|---|---|---|", "| 1 | - | sudo reboot | - | manual |", "", "```bash",
"sudo reboot", "```"],
[HEADER, "|---|---|---|---|---|", "| 1 | - | sudo reboot | - | manual |"],
)
def test_bash_block_skips_legacy_rows_without_directory(self):
result = self._run("set", "operator/legacy", "--title", "Rotate leaked credentials", "--status", "queued",
script=RASCI)
self.assertEqual(result.returncode, 0, result.stderr)
self._add("reboot", self.base, "sudo reboot", "kernel", "manual")
self.assertEqual(
self._out("list")[-4:],
["```bash", f"cd {self.base}", "sudo reboot", "```"],
)
def test_invalid_input_exits_2(self):