Skip to content

Prepare gated domain cutover and final deployment artifacts - #9702

Merged
Kitenite merged 3 commits into
mainfrom
feat/domain-cutover-prep
Nov 13, 2026
Merged

Kitenite merged 3 commits into
mainfrom
feat/domain-cutover-prep

Conversation

@Kitenite

@Kitenite Kitenite commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Moving browser sign-in onto paradev.com needs reversible redirects that preserve released clients and in-flight auth and billing returns. This PR prepares fixed-origin 307s behind default-disabled DOMAIN_MOVE_ENABLED and the shared web-domain-move flag. Web and desktop use the same browser cohort; API/tRPC, CLI/MCP/OAuth, desktop callbacks, invitations and billing returns stay on their existing host. Signed OAuth login/signup continuations remain on the legacy host without evaluating the rollout flag.

The manual staging workflow gains prepare-final: build only the two new projects with final browser URLs and the legacy token issuer, use --skip-domain, and report artifacts without assigning aliases. Production workflow wiring remains deferred; deploy-production.yml is unchanged. The mocked deployment guard suite now runs in CI.

Sentry currently has one configured Redirect URL on api.superset.sh. Final/stage Sentry connect hands off to a fixed legacy-web continuation before OAuth state creation, signs in there if necessary, and resumes at the old API with the explicit organization ID. The original API membership check still authorizes the organization before state is created. The continuation, Sentry result page and protected sign-in continuations remain on the old host even at 100% rollout.

Validation before merge: focused suites, 5 Python workflow guard tests, API/web/shared typechecks, Biome, actionlint and independent review passed. The latest head 20dc47c051f87ecc0f4b3e313ad434c7c86a2aa6 passed CI, including tests, typechecks, lint, CLI build and deployment previews. CodeRabbit passed; Cubic was neutral because of its monthly review quota.

Final-domain acceptance — November 13, 2026

Merged by explicit admin authorization as 2eda1fefa86c665999fe82a2c08a368002acb63f. Production deployment and prepare-final succeeded.

The final domains now belong to the new Vercel projects and point to artifacts built from that merge:

  • api.paradev.com: dpl_4hLmc3YPFi9X2wNMct2Zk5PhxKd4
  • app.paradev.com: dpl_GYWRkG7Zgt7d13HobEufYLaouDJQ

Verified with real browser flows and deployed endpoints:

  • Google sign-in uses the final API callback and authenticates the final web app. Chrome account navigation and reload preserve the signed-in session.
  • A temporary desktop Google loopback receiver obtained a new test session and JWT. The JWT signature validated against the legacy API JWKS, with the unchanged issuer/audience and expected user. Only that temporary desktop session was signed out afterward; the ordinary browser session still works.
  • Production PostHog recorded a paradev.com marketing pageview and app.paradev.com anonymous pageviews using the same anonymous ID, followed by $identify with that exact $anon_distinct_id and the account ID. All resolve to one person. This used an existing designated test account, not a newly created signup.
  • OAuth discovery keeps issuer api.superset.sh while browser endpoints use api.paradev.com. MCP resource identity remains api.superset.sh/mcp. Final web-to-API credentialed CORS passes.
  • Sentry connect returns the expected fixed legacy-web handoff with the organization preserved.
  • Final domain ownership, verified status and exact deployment assignments pass; both stage aliases remain unchanged. Legacy sign-in still serves normally.

Rollout remains off: marketing still links to app.superset.sh, old-web and legacy desktop-start redirects are not enabled, and the rollout flag was not changed. Only the existing app.paradev.com platform redirect was removed as part of assigning that final domain.

Limits before broader rollout: actual integration consent/install writes were not exercised. Teams/Notion registrations remain unverified; only Sentry has the legacy handoff implemented here. GitHub passed on staging but was not rerun on the final domain in this acceptance pass. Installed desktop sessions were not replaced.

Summary by CodeRabbit

  • New Features
    • Added controlled domain-routing support for eligible web and desktop sign-in requests, preserving paths and query parameters during redirects.
    • Added a Sentry integration handoff that supports sign-in continuation and organization-specific authorization.
  • Documentation
    • Documented domain-routing configuration, rollout conditions, and staging and final-domain preparation steps.

@coderabbitai

coderabbitai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

This change adds opt-in routing from legacy web and desktop OAuth endpoints to Paradev domains, Sentry integration handoff routes, and a staging workflow mode that prepares final-host deployments without assigning aliases.

Changes: Domain Move and Cutover Preparation

Layer / File(s) Summary
Domain-move policy and evaluation
packages/shared/src/domain-move/*, packages/shared/src/constants.ts, packages/shared/package.json
Adds request eligibility rules, flag evaluation, cohort-cookie handling, and redirect or fallback behavior. Tests cover request boundaries, flag outcomes, and cookie reuse.
Web and desktop route integration
apps/web/src/proxy.ts, apps/api/src/app/api/auth/desktop/connect/*, apps/api/src/env.ts, .env.example, .env.local.example, turbo.jsonc, .github/workflows/deploy-preview.yml, docs/environment-variables.md
Routes eligible web and desktop requests through domain-move handling. Adds the server setting and passes it through preview deployment configuration.
Legacy Sentry integration handoff
packages/shared/src/legacy-integration-connect/*, packages/shared/package.json, apps/api/src/app/api/integrations/sentry/connect/route.ts, apps/web/src/app/auth/integration-connect/route.ts, apps/web/src/proxy-routes*
Adds validated handoffs from Sentry connect requests to a legacy continuation route. Connects the routes and tests request validation, redirects, and existing response handling.
Deployment preparation and rollout configuration
.github/workflows/deploy-paradev-staging.yml, scripts/deploy-paradev-staging/guard_test.py, .github/workflows/ci.yml, docs/paradev-staging.md
Adds prepare-final, which uses final-host deployment settings and reports deployment IDs, URLs, and commit SHA without alias assignment. Adds guard tests and workflow documentation.

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Browser
  participant WebProxy
  participant withDomainMove
  participant PostHog
  Browser->>WebProxy: Send web request
  WebProxy->>withDomainMove: Check eligibility and routing setting
  withDomainMove->>PostHog: Look up web-domain-move flag
  PostHog-->>withDomainMove: Return flag result
  withDomainMove-->>Browser: Return redirect or fallback response
Loading
Merge Risk: Minimal · up to 20dc4

The change prepares a gated domain move that is disabled by default and keeps OAuth, CLI and MCP flows on the existing host. No merge-blocking risk was identified in the supplied evidence.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "Prepare gated domain cutover and final deployment artifacts" matches the main change: a default-disabled gate for domain moves plus the prepare-final staging mode that builds final deployme…
Description check Passed The description follows the repository template in substance. It has a 'What & why' section that explains the domain move, the gate, and the staging prepare-final mode, with the Sentry handoff and def…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "Prepare gated domain cutover and final deployment artifacts" matches the main change: a default-disabled gate for domain moves plus the prepare-final staging mode that builds final deployment artifacts without aliases. It is specific enough for a teammate scanning history. It does not name the Sentry handoff or the OAuth routing work, which are secondary parts of the changeset.

Full details: Description check

Explanation

The description follows the repository template in substance. It has a 'What & why' section that explains the domain move, the gate, and the staging prepare-final mode, with the Sentry handoff and deferred production wiring. It has a 'How I tested it' section that lists the focused tests, typechecks, Biome, actionlint, the independent review, and prior staging acceptance. The checklist items from the template (conventional title, lint/typecheck, maintainer edits, CLA) are not shown as checked or addressed. The title is in conventional form only loosely, since it lacks a type(scope) prefix. The description also says CodeRabbit and mobile previews are still running, and the reviewer's requested OAuth sign-in fix is not addressed in the description text.

Resolution

Optionally add the template checklist status (conventional title prefix, lint and typecheck results, maintainer-edit setting, CLA) and address or link the outstanding OAuth sign-in review finding about the sig and client_id query parameters.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 39bd9c1d-f12b-4dab-b4ad-cad1598b4c2a
Commits

Reviewing files that changed from the base of the PR and between 7e44037 and 20dc47c.

Files selected for processing: 5

  • .github/workflows/ci.yml
  • docs/environment-variables.md
  • docs/paradev-staging.md
  • packages/shared/src/domain-move/domain-move.test.ts
  • packages/shared/src/domain-move/domain-move.ts
Files skipped from review as they are similar to previous changes: 1

  • docs/environment-variables.md

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

  • ✅ Neon database branch

Thank you for your contribution! 🎉

@expo

expo Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Preview update published for development build 43eb0229 (fingerprint 315789730588). Open the build on your phone and scan:

Update group 5fa21ac4

@Kitenite
Kitenite marked this pull request as ready for review November 13, 2026 04:15

Copy link
Copy Markdown
Contributor

Verdict: needs changes. The gate moves the OAuth-provider login page to the new host, which breaks this PR's own "OAuth/CLI/MCP stay on the old host" contract. The rest is careful and well tested.

  • High packages/shared/src/domain-move/domain-move.ts:49: safePage checks only redirect on /sign-in. better-auth's loginPage (packages/auth/src/server.ts:403) sends MCP/CLI OAuth clients to /sign-in?client_id=…&sig=…, and with the gate on that URL gets a 307 to app.paradev.com. Retain sign-in/up when sig/client_id is present, and add a test.
  • Medium scripts/deploy-paradev-staging/guard_test.py:1: no CI job runs this suite (it passes locally), so the "prepare-final never aliases" guard has no regression check.
  • Low apps/web/src/proxy.ts:24: reads process.env.DOMAIN_MOVE_ENABLED, while the new apps/web/src/env.ts:14 entry is never read.
  • Low docs/paradev-staging.md:701: PR-process notes ("keep unmerged draft", "PR fix(analytics): preserve acquisition attribution across marketing and app signup #9661 is not part of this change") go stale on merge. Move them to the PR description.

Tests at 7e440370: shared 17/17, api desktop-connect 6/6, web proxy-routes 53/53, guard_test OK. I simulated the gate-on routing and Sentry handoff locally. The web preview is behind Vercel SSO, and live hosts were not tested.

Full review: https://app.superset.sh/page/pr-9702-review-domain-cutover-prep-nubjin

This branch was previously deployed

1 inactive deployment
preview — 20dc47c0 Deployed Nov 13, 2026 by Kitenite via Cleanup Preview Resources #5583
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.

2 participants