Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions chipfoundry_cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1450,7 +1450,7 @@ def push(project_root, sftp_host, sftp_username, sftp_key, project_id, project_n
with open(project_json_path, "r") as f:
pj = _json.load(f)
try:
_api_put(f"/projects/{platform_id}", {"cli_project_json": pj, "cli_sync_source": "push"})
_api_put(f"/projects/{platform_id}", {"cli_project_json": _slim_project_json(pj), "cli_sync_source": "push"})
console.print("[green]✓ Platform project synced[/green]")
except SystemExit:
console.print("[yellow]⚠ SFTP upload succeeded but platform sync failed[/yellow]")
Expand Down Expand Up @@ -1595,7 +1595,7 @@ def pull(project_name, output_dir, sftp_host, sftp_username, sftp_key):
import json as _json
with open(local_pj, "r") as f:
pj = _json.load(f)
_api_put(f"/projects/{platform_id}", {"cli_project_json": pj, "cli_sync_source": "pull"})
_api_put(f"/projects/{platform_id}", {"cli_project_json": _slim_project_json(pj), "cli_sync_source": "pull"})
console.print("[green]✓ Platform project synced[/green]")
except SystemExit:
console.print("[yellow]⚠ SFTP download succeeded but platform sync failed[/yellow]")
Expand Down Expand Up @@ -3753,6 +3753,20 @@ def _api_put(path: str, json_data: dict):
client.close()


_SYNC_KEEP_KEYS = {"project", "tapeout"}


def _slim_project_json(pj: dict) -> dict:
"""Return a lightweight copy of project.json for API sync.

The full file can exceed the 8 KB AWS WAF body-inspection limit when it
contains DRC results, report summaries, etc. The backend only needs the
``project`` and ``tapeout`` top-level sections; everything else is
stripped to keep the payload small.
"""
return {k: v for k, v in pj.items() if k in _SYNC_KEEP_KEYS}


def _load_project_platform_id(project_root: str):
"""Read platform_project_id from .cf/project.json, return None if absent."""
pj = Path(project_root) / '.cf' / 'project.json'
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "chipfoundry-cli"
version = "2.1.0"
version = "2.1.1"
description = "CLI tool to automate ChipFoundry project submission to SFTP server"
authors = ["ChipFoundry <marwan.abbas@chipfoundry.io>"]
readme = "README.md"
Expand Down
Loading