mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-08-17 21:25:46 +02:00
fix(cli): validate deployment name before build to catch invalid characters
langgraph deploy auto-generates a default deployment name from the working directory, which can contain underscores. Deployment names only allow letters, numbers, and hyphens, so an underscore in the name caused a cryptic 500 error from GCP Artifact Registry deep in the deploy flow. This adds a client-side validation check immediately after the name is resolved (from --name flag, env var, or prompt) so users get a clear, actionable error before any Docker build or network calls happen. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
ad17e8b002
commit
f6ccffc938
@@ -852,6 +852,13 @@ def _deploy(
|
||||
default_name = _normalize_image_name(pathlib.Path.cwd().name)
|
||||
name = click.prompt("Deployment name", default=default_name)
|
||||
|
||||
if name and not re.fullmatch(r"[a-zA-Z][a-zA-Z0-9-]+", name):
|
||||
raise click.UsageError(
|
||||
f"Invalid deployment name '{name}'. "
|
||||
"Names must start with a letter and contain only letters, numbers, and hyphens. "
|
||||
"Tip: replace underscores with hyphens (e.g. 'my-deployment')."
|
||||
)
|
||||
|
||||
secrets = _secrets_from_env(env_vars)
|
||||
|
||||
# Use buildx to cross-compile for amd64 when running on a non-x86_64 host
|
||||
|
||||
Reference in New Issue
Block a user