Skip to content

Commit 9f24d83

Browse files
committed
💄 Update how we show messages
Shortcake-Parent: main
1 parent 8a39a12 commit 9f24d83

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

‎src/fastapi_cloud_cli/commands/deploy.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,7 @@ def _wait_for_deployment(
468468
) as progress,
469469
APIClient() as client,
470470
):
471+
progress.metadata["done_emoji"] = "🚀"
471472
try:
472473
for log in client.stream_build_logs(deployment.id):
473474
time_elapsed = time.monotonic() - started_at
@@ -476,6 +477,7 @@ def _wait_for_deployment(
476477
progress.log(Text.from_ansi(log.message.rstrip()))
477478

478479
if log.type == "complete":
480+
progress.title = "Build complete!"
479481
progress.log("")
480482
progress.log(
481483
f"You can also check the app logs at [link={deployment.dashboard_url}]{deployment.dashboard_url}[/link]"
@@ -756,6 +758,7 @@ def deploy(
756758
toolkit.progress(title="Creating deployment") as progress,
757759
handle_http_errors(progress),
758760
):
761+
progress.metadata["done_emoji"] = "📦"
759762
logger.debug("Creating deployment for app: %s", app.id)
760763
deployment = _create_deployment(app.id)
761764

‎src/fastapi_cloud_cli/utils/cli.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def _get_tag_segments(
4040
tag = emojis[self.animation_counter % len(emojis)]
4141

4242
if done:
43-
tag = emojis[-1]
43+
tag = metadata.get("done_emoji", emojis[-1])
4444

4545
left_padding = self.tag_width - 1
4646
left_padding = max(0, left_padding)

‎tests/test_cli_deploy.py‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import string
33
from datetime import timedelta
44
from pathlib import Path
5-
from typing import Optional, TypedDict
5+
from typing import TypedDict
66
from unittest.mock import patch
77

88
import httpx
@@ -37,14 +37,14 @@ class RandomApp(TypedDict):
3737
slug: str
3838
id: str
3939
team_id: str
40-
directory: Optional[str]
40+
directory: str | None
4141

4242

4343
def _get_random_app(
4444
*,
45-
slug: Optional[str] = None,
46-
team_id: Optional[str] = None,
47-
directory: Optional[str] = None,
45+
slug: str | None = None,
46+
team_id: str | None = None,
47+
directory: str | None = None,
4848
) -> RandomApp:
4949
name = "".join(random.choices(string.ascii_lowercase, k=10))
5050
slug = slug or "".join(random.choices(string.ascii_lowercase, k=10))
@@ -62,7 +62,7 @@ def _get_random_app(
6262

6363
def _get_random_deployment(
6464
*,
65-
app_id: Optional[str] = None,
65+
app_id: str | None = None,
6666
status: str = "waiting_upload",
6767
) -> dict[str, str]:
6868
id = "".join(random.choices(string.digits, k=10))
@@ -1314,7 +1314,7 @@ def build_logs_handler(request: httpx.Request, route: respx.Route) -> Response:
13141314
with changing_dir(tmp_path), patch("time.sleep"):
13151315
result = runner.invoke(app, ["deploy"])
13161316

1317-
assert "short wait message" in result.output
1317+
assert "Build complete!" in result.output
13181318

13191319

13201320
@pytest.mark.respx
@@ -1382,7 +1382,7 @@ def build_logs_handler(request: httpx.Request, route: respx.Route) -> Response:
13821382
with changing_dir(tmp_path), patch("time.sleep"):
13831383
result = runner.invoke(app, ["deploy"])
13841384

1385-
assert "long wait message" in result.output
1385+
assert "Build complete!" in result.output
13861386

13871387

13881388
@pytest.mark.respx

0 commit comments

Comments
 (0)