Skip to content

Commit 4e54a33

Browse files
committed
fix(push): surface GDS-detection errors cleanly instead of a Python traceback
_push_critical_paths calls _detect_wrapper_gds which raises the precheck exception class RemotePrecheckGitError. _push_remote only caught RemotePushGitError, so the precheck exception escaped as an unhandled traceback. Rewrap it under RemotePushGitError with a push-oriented hint (including a note about git lfs pull for LFS repos) and add a defensive catch-all at the call site as a backstop. Made-with: Cursor
1 parent 7a52b14 commit 4e54a33

3 files changed

Lines changed: 16 additions & 2 deletions

File tree

chipfoundry_cli/main.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1468,6 +1468,9 @@ def _push_remote(project_root: Optional[str], project_name: Optional[str], dry_r
14681468
except RemotePushGitError as e:
14691469
console.print(f"[red]Remote push not ready:[/red] {e}")
14701470
raise click.Abort()
1471+
except Exception as e: # defensive: never leak a raw traceback here
1472+
console.print(f"[red]Remote push could not verify the repo:[/red] {type(e).__name__}: {e}")
1473+
raise click.Abort()
14711474

14721475
console.print(
14731476
f"[green]✓ Local checkout ready[/green] (HEAD [cyan]{head_sha[:7]}[/cyan] is on [cyan]{remote_ref}[/cyan])"

chipfoundry_cli/remote_precheck_git.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,18 @@ def _head_on_any_remote_ref(repo: Path, head_sha: str) -> Optional[str]:
251251

252252
def _push_critical_paths(repo: Path, project_json: Path) -> Set[str]:
253253
"""Paths that must be clean at HEAD for a remote push to match local state."""
254-
kind_gds, gds_rel = _detect_wrapper_gds(repo)
254+
try:
255+
kind_gds, gds_rel = _detect_wrapper_gds(repo)
256+
except RemotePrecheckGitError as e:
257+
# Re-raise under the push error class so the CLI surfaces one consistent
258+
# message and can catch a single exception type.
259+
raise RemotePushGitError(
260+
f"{e} "
261+
"Check that the wrapper GDS is committed and located under the "
262+
"expected path (e.g. gds/user_project_wrapper.gds, "
263+
"gds/openframe_project_wrapper.gds, etc.). If you use Git LFS, "
264+
"run `git lfs pull` so the actual file (not the pointer) is present."
265+
) from e
255266
out: Set[str] = {gds_rel}
256267

257268
cf_type = _load_cf_project_type(project_json)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "chipfoundry-cli"
3-
version = "2.3.17"
3+
version = "2.3.18"
44
description = "CLI tool to automate ChipFoundry project submission to SFTP server"
55
authors = ["ChipFoundry <marwan.abbas@chipfoundry.io>"]
66
readme = "README.md"

0 commit comments

Comments
 (0)