feat(cli): announce the listener a deployment is placed on

This commit is contained in:
Hugo Durand
2026-09-22 15:12:10 -04:00
parent b809832ea3
commit e1156979e3
2 changed files with 34 additions and 2 deletions
+13 -2
View File
@@ -172,6 +172,10 @@ class Listener:
@dataclass(frozen=True, slots=True)
class Unplaced:
@property
def summary(self) -> str:
return ""
def source_config(self) -> dict[str, object]:
return {}
@@ -181,6 +185,13 @@ class OnListener:
listener_id: str
k8s_namespace: str
@property
def summary(self) -> str:
return (
f"Deploying through listener {self.listener_id} "
f"in namespace {self.k8s_namespace}"
)
def source_config(self) -> dict[str, object]:
return {
"listener_id": self.listener_id,
@@ -817,7 +828,6 @@ def _create_deployment(
def _get_deployment_status_url(
updated: object, deployment_id: str, endpoints: ControlPlaneEndpoints
) -> str | None:
"""Compute the LangSmith dashboard URL for a deployment, if possible."""
tenant_id = updated.get("tenant_id") if isinstance(updated, dict) else None
if not tenant_id:
return None
@@ -827,7 +837,6 @@ def _get_deployment_status_url(
def _emit_deployment_status_url(
updated: object, deployment_id: str, endpoints: ControlPlaneEndpoints
) -> str | None:
"""Emit the deployment status URL and return it."""
url = _get_deployment_status_url(updated, deployment_id, endpoints)
if url:
_get_emitter().status_url(url)
@@ -1526,6 +1535,8 @@ class CustomerRegistrySource:
placement = self.placement.resolve(
_available_listeners(ctx.client), required=ctx.endpoints.is_cloud
)
if placement.summary:
_get_emitter().info(placement.summary)
image_uri, step = self._publish(ctx, step)
created, _ = _create_deployment(
ctx.client,