Skip to content

Commit fbb4bbe

Browse files
authored
Merge pull request #664 from codeflash-ai/chore/add-review-staging-link-logging
[Chore] Log staging link
2 parents a716c9b + 5667d9d commit fbb4bbe

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

codeflash/optimization/function_optimizer.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1258,7 +1258,25 @@ def process_review(
12581258
data["git_remote"] = self.args.git_remote
12591259
check_create_pr(**data)
12601260
elif self.args.staging_review:
1261-
create_staging(**data)
1261+
response = create_staging(**data)
1262+
if response.status_code == 200:
1263+
staging_url = f"https://app.codeflash.ai/review-optimizations/{self.function_trace_id[:-4] + exp_type if self.experiment_id else self.function_trace_id}"
1264+
console.print(
1265+
Panel(
1266+
f"[bold green]✅ Staging created:[/bold green]\n[link={staging_url}]{staging_url}[/link]",
1267+
title="Staging Link",
1268+
border_style="green",
1269+
)
1270+
)
1271+
else:
1272+
console.print(
1273+
Panel(
1274+
f"[bold red]❌ Failed to create staging[/bold red]\nStatus: {response.status_code}",
1275+
title="Staging Error",
1276+
border_style="red",
1277+
)
1278+
)
1279+
12621280
else:
12631281
# Mark optimization success since no PR will be created
12641282
mark_optimization_success(

0 commit comments

Comments
 (0)