feat(hosting): --hostname names the app's Cloud Run service on GCP - #6937
Conversation
Greptile SummaryThe PR forwards a valid first-landing hostname as a requested Cloud Run service name while preserving existing behavior for invalid names and subsequent GCP deployments.
Confidence Score: 5/5The PR appears safe to merge because no blocking failure remains within the eligible follow-up scope. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| packages/reflex-hosting-cli/src/reflex_cli/v2/cli.py | Adds validated hostname-derived Cloud Run service names to the initial GCP provider pin. |
| packages/reflex-hosting-cli/src/reflex_cli/utils/hosting.py | Extends the provider endpoint payload with an optional service name. |
| packages/reflex-hosting-cli/src/reflex_cli/v2/deploy.py | Updates the hostname option help to describe first-landing GCP naming. |
| tests/units/reflex_cli/v2/test_cli.py | Covers service-name validation and first-landing versus redeployment forwarding behavior. |
| tests/units/reflex_cli/utils/test_hosting.py | Verifies that optional service names are included in provider requests. |
Reviews (7): Last reviewed commit: "feat(hosting): --hostname names the app'..." | Re-trigger Greptile
Merging this PR will not alter performance
Comparing Footnotes
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 02085bea6c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
1 issue found and verified against the latest diff
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/reflex-hosting-cli/src/reflex_cli/v2/cli.py">
<violation number="1" location="packages/reflex-hosting-cli/src/reflex_cli/v2/cli.py:160">
P2: When `--hostname` is a full custom domain such as `myapp.reflex.dev`, this line validates the entire domain and skips `service_name`. Derive the service name from the same normalized subdomain that `get_hostname()` reserves.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 11 files
Requires human review: Auto-approval blocked because this review re-detected 2 unresolved issues already reported by Cubic.
Re-trigger cubic
On the deploy that first lands an app on GCP (a fresh app, or a switch from another provider), `--hostname` doubles as the requested Cloud Run service name, sent as `service_name` on the provider pin, so the service in the customer's GCP console reads like the app's URL instead of `app-<uuid>`. Server support ships separately in the control plane; an older server ignores the field and mints as it does today. Only the first-landing pin carries a name: it is the moment the server would mint one, and the only time a request cannot collide with a name already pinned to a live service. Redeploys of an app already on GCP never send it. A hostname the service-name grammar refuses (leading digit, over 49 characters, the reserved `app-<uuid>` shape) is skipped with a note and the server mints from the app name, so an invocation that deployed yesterday still deploys today. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QvFknzaPpLatZkzbgZiqAH
712eb83 to
85aae18
Compare
Rebuilt on top of
main. The deploy-flag shim this PR originally carried is gone: #6924 moved the wholereflex deploycommand — options and body — intoreflex_cli.v2.deploy, so the hosting CLI already owns its flag list and there is nothing left to split, adopt, or keep a baseline copy of. An older reflex simply cannot pass a new hosting flag, which is the expected outcome. What remains is the GCP service-name feature.--hostnamenames the Cloud Run service on GCPOn the deploy that first lands an app on GCP (fresh app or provider switch),
--hostnamedoubles as the requested Cloud Run service name, sent asservice_nameon the provider pin — so the service in the customer's GCP console reads like the app's URL instead ofapp-<uuid>. Server support forservice_nameships separately in the control plane; older servers ignore the field and mint/derive as today.app-<uuid>shape) is skipped with a note and the server mints from the app name — an invocation that deployed yesterday still deploys today.Tests cover the payload (
set_app_providerforwardsservice_name), the grammar in isolation, the first-landing pin, an unusable hostname falling back to a server-minted name, and a GCP-to-GCP redeploy with--hostnameset still sendingservice_name=None.Linear: ENG-11613