fix(cli): scope deploy preflight to push paths and skip flow telemetry on early exit

This commit is contained in:
Greyson Lalonde
2026-05-05 04:50:59 +08:00
parent 0edf2bcc75
commit 97b7cede2c
3 changed files with 13 additions and 7 deletions

View File

@@ -12,14 +12,14 @@ def create_flow(name: str) -> None:
click.secho(f"Creating flow {folder_name}...", fg="green", bold=True)
telemetry = Telemetry()
telemetry.flow_creation_span(class_name)
project_root = Path(folder_name)
if project_root.exists():
click.secho(f"Error: Folder {folder_name} already exists.", fg="red")
return
telemetry = Telemetry()
telemetry.flow_creation_span(class_name)
# Create directory structure
(project_root / "src" / folder_name).mkdir(parents=True)
(project_root / "src" / folder_name / "crews").mkdir(parents=True)

View File

@@ -47,7 +47,6 @@ class DeployCommand(BaseCommand, PlusAPIMixin):
BaseCommand.__init__(self)
PlusAPIMixin.__init__(self, telemetry=self._telemetry)
self.project_name = get_project_name(require=True)
self._validate_project_structure()
def _validate_project_structure(self) -> None:
"""Validate that the local project has the files required for deployment."""
@@ -127,6 +126,7 @@ class DeployCommand(BaseCommand, PlusAPIMixin):
uuid (Optional[str]): The UUID of the crew to deploy.
skip_validate (bool): Skip pre-deploy validation checks.
"""
self._validate_project_structure()
if not _run_predeploy_validation(skip_validate):
return
self._telemetry.start_deployment_span(uuid)
@@ -150,6 +150,7 @@ class DeployCommand(BaseCommand, PlusAPIMixin):
confirm (bool): Whether to skip the interactive confirmation prompt.
skip_validate (bool): Skip pre-deploy validation checks.
"""
self._validate_project_structure()
if not _run_predeploy_validation(skip_validate):
return
self._telemetry.create_crew_deployment_span()