Skip to content

Commit ef22247

Browse files
authored
Merge pull request #24 from chipfoundry/feature/submit-without-repush
feat: add standalone cf submit command
2 parents 688fb21 + 2096a64 commit ef22247

3 files changed

Lines changed: 50 additions & 2 deletions

File tree

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ cf push [OPTIONS]
572572
**Options:**
573573
- `--project-root`: Specify project directory
574574
- `--force-overwrite`: Overwrite existing files on SFTP (SFTP mode only)
575-
- `--submit`: Submit the project for review after upload
575+
- `--submit`: Submit the project for review after upload (shortcut for `cf push` + `cf submit`)
576576
- `--dry-run`: Preview what would be uploaded
577577
- `--sftp-username`: Override configured username (SFTP mode only)
578578
- `--sftp-key`: Override configured key path (SFTP mode only)
@@ -633,6 +633,15 @@ What happens:
633633
4. Staged S3 objects are deleted on success; any leftovers are expired by the bucket lifecycle after 7 days.
634634
5. `--submit` submits for review on success.
635635

636+
### Submit a Project for Review (No Re-upload)
637+
638+
```bash
639+
cf submit [--project-root PATH]
640+
```
641+
642+
Use this when your latest `cf push` already uploaded the files you want reviewed.
643+
`cf submit` moves the platform project into review without requiring another upload.
644+
636645
> [!TIP]
637646
> Try modes in this order: `cf push``cf push --remote``cf push --https`.
638647
> The SFTP mode is fastest when unrestricted, `--remote` is the best HTTPS

chipfoundry_cli/main.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2860,6 +2860,45 @@ def view_tapeout_report(project_name, report_path):
28602860
console.print(f"[red]Failed to open tapeout report in browser: {e}[/red]")
28612861
raise click.Abort()
28622862

2863+
@main.command("submit")
2864+
@click.option(
2865+
"--project-root",
2866+
required=False,
2867+
type=click.Path(exists=True, file_okay=False),
2868+
help="Path to the local ChipFoundry project directory (defaults to current directory if .cf/project.json exists).",
2869+
)
2870+
def submit(project_root):
2871+
"""Submit a project for admin review without uploading files again."""
2872+
cwd_root, _ = get_project_json_from_cwd()
2873+
if not project_root and cwd_root:
2874+
project_root = cwd_root
2875+
if not project_root:
2876+
console.print(
2877+
"[red]No project root specified and no .cf/project.json found in current directory.[/red]"
2878+
)
2879+
console.print("Provide --project-root or run from a linked project.")
2880+
raise click.Abort()
2881+
2882+
project_root = str(Path(project_root).resolve())
2883+
platform_id = _load_project_platform_id(project_root)
2884+
if not platform_id:
2885+
console.print("[red]Project is not linked to the platform.[/red]")
2886+
console.print(
2887+
"Run [bold]cf link[/bold] to connect this project, or [bold]cf init[/bold] to create a new one."
2888+
)
2889+
raise click.Abort()
2890+
2891+
config = load_user_config()
2892+
if not config.get("api_key"):
2893+
console.print("[red]Not logged in.[/red] Run [bold]cf login[/bold] before submitting.")
2894+
raise click.Abort()
2895+
2896+
try:
2897+
_api_post(f"/projects/{platform_id}/submit", {})
2898+
console.print("[green]✓ Project submitted for review[/green]")
2899+
except SystemExit:
2900+
raise click.Abort()
2901+
28632902
@main.command('confirm')
28642903
@click.option('--project-root', required=False, type=click.Path(exists=True, file_okay=False), help='Path to the local ChipFoundry project directory (defaults to current directory if .cf/project.json exists).')
28652904
@click.option('--sftp-host', default=DEFAULT_SFTP_HOST, show_default=True, help='SFTP server hostname.')

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.4.9"
3+
version = "2.4.10"
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)