Skip to content

Commit a9712ef

Browse files
committed
fix(push): 10 min timeout for cf push --remote API call
Large openframe GDS uploads via the platform take several minutes. The default 15 s httpx timeout caused the CLI to abort while the backend and lambda were still legitimately processing the request. Override to 600 s and warn the user that the call may take several minutes. Made-with: Cursor
1 parent a22e813 commit a9712ef

2 files changed

Lines changed: 14 additions & 4 deletions

File tree

chipfoundry_cli/main.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1505,10 +1505,12 @@ def _push_remote(project_root: Optional[str], project_name: Optional[str], dry_r
15051505
return
15061506

15071507
console.print(f"Asking platform to fetch [cyan]{head_sha[:7]}[/cyan] from {github_repo_url}…")
1508+
console.print("[dim](large files may take several minutes — please keep this terminal open)[/dim]")
15081509
try:
15091510
resp = _api_post(
15101511
f"/projects/{platform_id}/remote-push",
15111512
{"commit_sha": head_sha, "project_name": final_project_name},
1513+
timeout=600.0,
15121514
)
15131515
except SystemExit:
15141516
raise click.Abort()
@@ -4209,11 +4211,19 @@ def _api_get(path: str):
42094211
client.close()
42104212

42114213

4212-
def _api_post(path: str, json_data: dict):
4213-
"""Authenticated POST to the platform API. Returns parsed JSON or raises SystemExit."""
4214+
def _api_post(path: str, json_data: dict, timeout: Optional[float] = None):
4215+
"""Authenticated POST to the platform API. Returns parsed JSON or raises SystemExit.
4216+
4217+
`timeout` (seconds) overrides the client default for this request only.
4218+
Use a large value for long-running endpoints such as remote-push, which
4219+
waits for the platform to fetch files from GitHub and stage them on EFS.
4220+
"""
42144221
client, _ = _api_client()
42154222
try:
4216-
resp = client.post(path, json=json_data)
4223+
kwargs = {"json": json_data}
4224+
if timeout is not None:
4225+
kwargs["timeout"] = timeout
4226+
resp = client.post(path, **kwargs)
42174227
if resp.status_code == 401:
42184228
console.print("[red]✗ API key is invalid or expired.[/red] Run [bold]cf login[/bold] to re-authenticate.")
42194229
raise SystemExit(1)

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.15"
3+
version = "2.3.16"
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)