From d45a6deba217feb8ddb724c3523057352ba06718 Mon Sep 17 00:00:00 2001 From: hari-dhanushkodi Date: Thu, 5 Mar 2026 17:58:40 -0500 Subject: [PATCH] update comments --- libs/cli/langgraph_cli/cli.py | 9 +++++++++ libs/cli/langgraph_cli/progress.py | 2 ++ 2 files changed, 11 insertions(+) diff --git a/libs/cli/langgraph_cli/cli.py b/libs/cli/langgraph_cli/cli.py index 5e616772f..b1a4a8823 100644 --- a/libs/cli/langgraph_cli/cli.py +++ b/libs/cli/langgraph_cli/cli.py @@ -943,6 +943,11 @@ def deploy( def _normalize_image_name(value: str | None) -> str: + """Sanitize a deployment/directory name into a valid Docker repository name. + + Docker repository names must be lowercase and may only contain + [a-z0-9._-]. Invalid characters are replaced with hyphens. + """ if not value: return "app" slug = re.sub(r"[^a-z0-9._-]+", "-", value.lower()).strip("-.") @@ -950,6 +955,10 @@ def _normalize_image_name(value: str | None) -> str: def _normalize_image_tag(value: str) -> str: + """Validate and return a Docker image tag. + + Tags may only contain [A-Za-z0-9_.-]. Defaults to "latest" when empty. + """ if not value: value = "latest" if not re.fullmatch(r"[A-Za-z0-9_.-]+", value): diff --git a/libs/cli/langgraph_cli/progress.py b/libs/cli/langgraph_cli/progress.py index 5eb104fd8..4f34523fc 100644 --- a/libs/cli/langgraph_cli/progress.py +++ b/libs/cli/langgraph_cli/progress.py @@ -16,6 +16,7 @@ class Progress: self.message = message self._base_message = message self._show_elapsed = elapsed + # use this to make sure we don't kill thread when we set msg to "" self._stop = threading.Event() self.spinner_generator = self.spinning_cursor() @@ -52,6 +53,7 @@ class Progress: sys.stdout.write(next(self.spinner_generator) + " " + message) sys.stdout.flush() time.sleep(self.delay) + # clear the spinner and message sys.stdout.write( "\b" * (len(message) + 2) + " " * (len(message) + 2)