Skip to content

Handle AwaitingApproval status in watch_deployment_status#6797

Open
adhami3310 wants to merge 2 commits into
mainfrom
hosting-cli-awaiting-approval
Open

Handle AwaitingApproval status in watch_deployment_status#6797
adhami3310 wants to merge 2 commits into
mainfrom
hosting-cli-awaiting-approval

Conversation

@adhami3310

Copy link
Copy Markdown
Member

What

When watching a hosting deployment, handle the AwaitingApproval status: report that the build was submitted for approval (and will deploy automatically once approved) and stop watching, rather than looping indefinitely.

Also simplifies the status-change loop to only log when the status actually changes.

Why

Deployments that require approval previously never reached a terminal state in watch_deployment_status, so the CLI would keep polling with no useful feedback.

@adhami3310
adhami3310 requested a review from a team as a code owner July 17, 2026 23:05
@greptile-apps

greptile-apps Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds handling for the AwaitingApproval deployment status in watch_deployment_status, so the CLI exits the polling loop with a helpful message rather than spinning indefinitely. It also incidentally fixes a latent busy-poll bug: the old code used continue to skip the time.sleep(0.5) call whenever the status was unchanged, causing the function to hammer the API at full speed; the refactored loop now always sleeps between polls.

  • Adds an AwaitingApproval branch that prints a user-friendly message and breaks out of the loop cleanly.
  • Restructures the status-change guard so time.sleep(0.5) is unconditional, eliminating the accidental busy-loop on repeated identical statuses.

Confidence Score: 5/5

Safe to merge. The change is narrowly scoped to a single polling function, adds a clean exit path for a previously unhandled status, and the loop restructuring is a straightforward improvement.

Both changes are small and correct: the new AwaitingApproval branch follows the same break-and-return-True pattern as the existing success branch, and moving time.sleep outside the status-change guard is strictly better behaviour. No existing terminal paths are affected.

No files require special attention.

Important Files Changed

Filename Overview
packages/reflex-hosting-cli/src/reflex_cli/utils/hosting.py Adds AwaitingApproval terminal case to the polling loop and fixes implicit busy-polling when status is unchanged (missing sleep).
packages/reflex-hosting-cli/news/6797.feature.md Changelog entry describing the new AwaitingApproval behaviour; no issues.

Reviews (2): Last reviewed commit: "Add changelog fragment" | Re-trigger Greptile

@codspeed-hq

codspeed-hq Bot commented Jul 17, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 26 untouched benchmarks
⏩ 8 skipped benchmarks1


Comparing hosting-cli-awaiting-approval (128310f) with main (f79d011)

Open in CodSpeed

Footnotes

  1. 8 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

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.

1 participant