Skip to content

Print model push summary before watch/tail/wait - #49

Merged
cretz merged 1 commit into
mainfrom
cretz/push-summary-before-watch
Aug 7, 2026
Merged

Print model push summary before watch/tail/wait#49
cretz merged 1 commit into
mainfrom
cretz/push-summary-before-watch

Conversation

@cretz

@cretz cretz commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

🚀 What

  • model push prints the summary card (IDs, endpoint, logs URL) immediately after the deployment is created, instead of after --watch/--tail/--wait finish.
  • --watch --wait is now a usage error; --wait was silently ignored before.
  • --wait prints a settled verdict at the end: active, or a warning with the failure status.

💻 How

  • Moved the summary call ahead of the watch/tail/wait switch, with predict/logs URLs resolved once and passed to the printer.
  • Dropped the status-based branch from the summary (status is always in-progress that early); the verdict now lives in the --wait case.
  • JSON output stays last, so stdout is still exactly one object carrying the final status.

🔬 Testing

  • Added --watch --wait validation coverage and assertions for the new verdict lines; --tail-only asserts no verdict.
  • Updated the watch-interrupt test: the summary is now on stdout even when interrupted.
  • Full unit suite passes; e2e will run in CI.

@cretz
cretz requested review from Copilot and marius-baseten August 6, 2026 16:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adjusts model push CLI output and flag validation so users see the push summary earlier, and --wait provides a final “settled” verdict while keeping JSON output cleanly separated.

Changes:

  • Print the push summary immediately after deployment creation (stderr in JSON mode) so links are available while the deployment is still building.
  • Add --watch + --wait validation error and cover it with tests.
  • Add --wait-only settled verdict messaging and update existing tests for the new output ordering.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
internal/cmd/command.model_push.go Moves summary earlier, adds --watch && --wait validation, changes JSON emission timing, and adds --wait settled-verdict messaging.
internal/cmd/command.model_push_test.go Updates assertions to reflect new summary timing/output streams and adds a new validation test for --watch + --wait.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 131 to +148
switch {
case flags.Watch:
err = watchModelPushDeployment(ctx, api.API(), created, flags)
case flags.Tail:
err = tailModelPushDeployment(ctx, api.API(), created, flags.Wait)
case flags.Wait:
err = waitModelPushDeployment(ctx, api.API(), created)
// Only --wait sees the deployment settle, so only it reports how: a bare
// --tail streams past ACTIVE and ends on interrupt. The summary already
// announced the push; this says whether the deployment came up.
if err == nil {
if created.Deployment.Status == managementapi.DeploymentStatus_ACTIVE {
printf("\n✅ Model %s is deployed and active\n", created.Model.Name)
} else {
printf("\n⚠️ Model %s was pushed but the deployment did not become active (status: %s)\n",
created.Model.Name, created.Deployment.Status)
}
}
@cretz
cretz force-pushed the cretz/push-summary-before-watch branch from 76639fd to 9f2b252 Compare August 7, 2026 14:28
@cretz
cretz merged commit 74894d3 into main Aug 7, 2026
4 checks passed
@cretz
cretz deleted the cretz/push-summary-before-watch branch August 7, 2026 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants