Skip to content

feat(hosting): --hostname names the app's Cloud Run service on GCP - #6937

Merged
Kastier1 merged 1 commit into
mainfrom
simon/deploy-shim-and-gcp-service-name
Aug 28, 2026
Merged

feat(hosting): --hostname names the app's Cloud Run service on GCP#6937
Kastier1 merged 1 commit into
mainfrom
simon/deploy-shim-and-gcp-service-name

Conversation

@Kastier1

@Kastier1 Kastier1 commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Rebuilt on top of main. The deploy-flag shim this PR originally carried is gone: #6924 moved the whole reflex deploy command — options and body — into reflex_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.

--hostname names the Cloud Run service on GCP

On the deploy that first lands an app on GCP (fresh app or provider switch), --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 for service_name ships separately in the control plane; older servers ignore the field and mint/derive as 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 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 chars, the reserved 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_provider forwards service_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 --hostname set still sending service_name=None.

Linear: ENG-11613

@greptile-apps

greptile-apps Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The 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.

  • Adds hostname-to-service-name validation and provider-pin forwarding.
  • Documents the new GCP naming behavior and updates CLI help.
  • Adds unit coverage for payload forwarding, validation, first landing, and redeployment behavior.

Confidence Score: 5/5

The PR appears safe to merge because no blocking failure remains within the eligible follow-up scope.

No blocking failure remains.

Important Files Changed

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

Comment thread packages/reflex-hosting-cli/src/reflex_cli/utils/hosting.py
@codspeed-hq

codspeed-hq Bot commented Aug 24, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 27 untouched benchmarks
⏩ 8 skipped benchmarks1


Comparing simon/deploy-shim-and-gcp-service-name (85aae18) with main (3d2b539)

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.

@Kastier1
Kastier1 marked this pull request as ready for review August 24, 2026 19:06
@Kastier1
Kastier1 requested a review from a team as a code owner August 24, 2026 19:06

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 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".

Comment thread reflex/reflex.py Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Comment thread tests/units/reflex_cli/v2/test_deploy_options.py Outdated
Comment thread tests/units/test_reflex.py Outdated
Comment thread packages/reflex-hosting-cli/src/reflex_cli/v2/cli.py

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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
@masenf
masenf force-pushed the simon/deploy-shim-and-gcp-service-name branch from 712eb83 to 85aae18 Compare August 28, 2026 00:11
@masenf masenf changed the title feat(hosting): hosting CLI owns the deploy flags; --hostname names the GCP service feat(hosting): --hostname names the app's Cloud Run service on GCP Aug 28, 2026
@Kastier1
Kastier1 enabled auto-merge (squash) August 28, 2026 00:31
@Kastier1
Kastier1 merged commit 3b09137 into main Aug 28, 2026
134 of 135 checks passed
@Kastier1
Kastier1 deleted the simon/deploy-shim-and-gcp-service-name branch August 28, 2026 00:32
masenf pushed a commit that referenced this pull request Aug 28, 2026
…-context-refactor-jv3pig

Picks up #6937 and #6962, both confined to reflex-hosting-cli. Clean
auto-merge; nothing touches client state, memoization, or foreach.
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