fix: label becomes the full slug; re-prompt on collision
lint / lint (push) Failing after 1m44s
test / unit (pull_request) Successful in 33s
test / integration (pull_request) Successful in 17s

When a label is given it is now used verbatim as the slug (no random
suffix), so two launches with the same label collide by design.  The
CLI re-prompts via the TUI name modal with a disclaimer when the
candidate slug is already in use among running bottles.
This commit is contained in:
2026-06-22 19:26:39 +00:00
parent e463670649
commit 54760964cf
5 changed files with 112 additions and 16 deletions
+7 -5
View File
@@ -128,17 +128,19 @@ class TestMintSlug(unittest.TestCase):
identity=identity,
)
def test_no_label_uses_agent_name_as_prefix(self) -> None:
def test_no_label_uses_agent_name_with_random_suffix(self) -> None:
slug = mint_slug(self._spec(label=""))
self.assertTrue(slug.startswith("demo-"), slug)
# random suffix present — slug is longer than just "demo"
self.assertGreater(len(slug), len("demo-"))
def test_label_used_as_slug_prefix(self) -> None:
def test_label_becomes_exact_slug(self) -> None:
slug = mint_slug(self._spec(label="my-run"))
self.assertTrue(slug.startswith("my-run-"), slug)
self.assertEqual("my-run", slug)
def test_label_with_spaces_slugified(self) -> None:
def test_label_with_spaces_slugified_no_suffix(self) -> None:
slug = mint_slug(self._spec(label="My Feature Run"))
self.assertTrue(slug.startswith("my-feature-run-"), slug)
self.assertEqual("my-feature-run", slug)
def test_identity_takes_precedence_over_label(self) -> None:
slug = mint_slug(self._spec(label="my-run", identity="fixed-id"))