PR #9702 review: Domain cutover prep
Summary
Adds a default-off, PostHog-flagged (web-domain-move) 307 from app.superset.sh document navigations and api.superset.sh/api/auth/desktop/connect to the paradev.com hosts, gated by the server setting DOMAIN_MOVE_ENABLED=true. It also adds a Sentry connect handoff from the new/stage API back to a legacy-web continuation (Sentry has one registered callback on api.superset.sh), and a prepare-final mode for the manual staging workflow that builds final-URL artifacts without touching aliases. Production wiring is deliberately absent, so merging is inert.
Verdict
Needs changes — the gate moves the OAuth-provider login page (/sign-in?client_id=…&sig=…) to the new host. That breaks the PR's own contract that OAuth/CLI/MCP stay on the old host. The rest is careful and well tested.
Findings
packages/shared/src/domain-move/domain-move.ts:49
What is wrong: safePage retains /sign-in and /sign-up only by looking at redirect params. better-auth's oauthProvider (packages/auth/src/server.ts:403, loginPage: ${WEB}/sign-in) sends unauthenticated MCP/CLI OAuth clients to /sign-in?response_type=code&client_id=…&exp=…&sig=… with no redirect. The sign-in page's oauthProviderClient then posts window.location.search as oauth_query. With the gate on and the flag true, this URL gets a 307 to app.paradev.com/sign-in?… (shown in Evidence). The authorize flow then continues against the final API that the web is built with, not the API that started it. The PR text, docs/paradev-staging.md ("Keep … OAuth, CLI auth … on the old flow") and plans/20261026-app-domain-move.md:132 ("OAuth loginPage/consentPage stay on app.superset.sh") all say this must not move.
Fix: in safePage, retain /sign-in and /sign-up when the query has sig or client_id (the signed oauth-provider params). Add a case to the "retains encoded, absolute and nested protected sign-in/up continuations" test.
scripts/deploy-paradev-staging/guard_test.py:1
What is wrong: no CI job runs this Python suite. No workflow calls unittest/pytest or this file. It is the only guard for "prepare-final never assigns aliases or reads domain ownership", and an edit to the inline guard in deploy-paradev-staging.yml can break it silently. It passes locally.
Fix: add a python3 -I scripts/deploy-paradev-staging/guard_test.py step to the existing lint/test workflow (path-filtered to the workflow and script), or move the guard into a TS script tested by bun test.
apps/web/src/proxy.ts:24
What is wrong: it reads process.env.DOMAIN_MOVE_ENABLED directly, but the PR also adds DOMAIN_MOVE_ENABLED to apps/web/src/env.ts:14, and nothing reads it there. The API reads it through env. The two places can drift.
Fix: use env.DOMAIN_MOVE_ENABLED from @/env, or remove the unused schema entry if the proxy must not import env.
docs/paradev-staging.md:701
What is wrong: the new section has PR-process notes that go stale on merge ("Keep the cutover change local or in an unmerged draft", "PR #9661 is not part of this change", "this preparation commit"). AGENTS.md puts rationale in the commit/PR. The env-var section in docs/environment-variables.md:679 has the same "inert preparation change" wording.
Fix: keep the durable contract (gate semantics, retained routes, rollback order, Sentry handoff) and move the approval and status narrative to the PR description.
Evidence
Shared routing helpers, gate on (CLI simulation at 7e440370). A bun script drives the real withDomainMove, withLegacySentryConnect and continueLegacyIntegrationConnect with enabled: "true" and the flag stubbed to true. Retained routes stay. The OAuth login-page URL (last web line) moves, which is finding 1. The Sentry handoff goes new API → legacy continuation → legacy sign-in or legacy API, as the PR describes.
## web proxy, DOMAIN_MOVE_ENABLED=true, flag=true GET https://app.superset.sh/dashboard -> 307 location=https://app.paradev.com/dashboard set-cookie=__Secure-domain-move-id=46810e0e-1c46-4db8-968a-93502c6776d6 GET https://app.superset.sh/settings/billing?success=true -> 200 location=- set-cookie=- GET https://app.superset.sh/ -> 200 location=- set-cookie=- GET https://app.superset.sh/sign-in?redirect=%2Fintegrations%2Fsentry -> 200 location=- set-cookie=- GET https://app.superset.sh/sign-in?response_type=code&client_id=cli&redirect_uri=http%3A%2F%2F127.0.0.1%3A5555%2Fcb&state=s&code_challenge=x&code_challenge_method=S256&exp=1&sig=zz -> 307 location=https://app.paradev.com/sign-in?response_type=code&client_id=cli&redirect_uri=http%3A%2F%2F127.0.0.1%3A5555%2Fcb&state=s&code_challenge=x&code_challenge_method=S256&exp=1&sig=zz set-cookie=__Secure-domain-move-id=a7555a81-fcf3-4fac-a622-39595fd0fafa ## web proxy, DOMAIN_MOVE_ENABLED unset, flag=true GET https://app.superset.sh/dashboard -> 200 location=- set-cookie=- ## Sentry handoff GET https://api.paradev.com/api/integrations/sentry/connect?organizationId=803f13a4-49b9-4664-826f-4090c750b0bc -> 307 location=https://app.superset.sh/auth/integration-connect?provider=sentry&organizationId=803f13a4-49b9-4664-826f-4090c750b0bc set-cookie=- GET https://api.paradev.com/api/integrations/sentry/connect?organizationId=not-a-uuid -> 400 location=- set-cookie=- GET https://api.superset.sh/api/integrations/sentry/connect (legacy, unchanged) -> 200 location=- set-cookie=- GET https://app.superset.sh/auth/integration-connect?provider=sentry&organizationId=803f13a4-49b9-4664-826f-4090c750b0bc (signed out) -> 307 location=https://app.superset.sh/sign-in?redirect=%2Fauth%2Fintegration-connect%3Fprovider%3Dsentry%26organizationId%3D803f13a4-49b9-4664-826f-4090c750b0bc set-cookie=- GET https://app.superset.sh/auth/integration-connect?provider=sentry&organizationId=803f13a4-49b9-4664-826f-4090c750b0bc (signed in) -> 307 location=https://api.superset.sh/api/integrations/sentry/connect?organizationId=803f13a4-49b9-4664-826f-4090c750b0bc set-cookie=-
API preview (gate off, preview host). Desktop connect still validates and issues the normal Google OAuth redirect. Sentry connect on a preview host keeps its old behavior (401 without a session).
== GET https://web-pr-9702-superset.vercel.app/sign-in status=302 location=https://vercel.com/sso-api?url=https%3A%2F%2Fweb-pr-9702-superset.vercel.app%2Fsign-in&nonce=a581640cec228869d306500651096e82a2d2ef36e2fb711be08541477bfdb3c0 == GET https://web-pr-9702-superset.vercel.app/auth/integration-connect?provider=sentry&organizationId=803f13a4-49b9-4664-826f-4090c750b0bc status=302 location=https://vercel.com/sso-api?url=https%3A%2F%2Fweb-pr-9702-superset.vercel.app%2Fauth%2Fintegration-connect%3Fprovider%3Dsentry%26organizationId%3D803f13a4-49b9-4664-826f-4090c750b0bc&nonce=a57800e878ec62137c227c1e4dfef106bdb11bcb8fbcd88bf6e5fd0110015779 == GET https://web-pr-9702-superset.vercel.app/dashboard status=302 location=https://vercel.com/sso-api?url=https%3A%2F%2Fweb-pr-9702-superset.vercel.app%2Fdashboard&nonce=cc274253067a90dfcdd415358aeae751650907f28b5047aec7a2197e96ab488a == GET https://api-pr-9702-superset.vercel.app/api/auth/desktop/connect?provider=google&state=test status=307 location=https://accounts.google.com/o/oauth2/v2/auth?response_type=code&client_id=811389026306-tl7n3lnhps080ucptov11hasarq51bjn.apps.googleusercontent.com&state=YXUEUoUqZyC1GWIqF0qhHI-vSz8CH4en&scope=email+profile+openid&redirect_uri=https%3A%2F%2Fapi-pr-9702-superset.vercel.app%2Fapi%2Fauth%2Fcallback%2Fgoogle&prompt=select_account&code_challenge_method=S256&code_challenge=PgSiqqIDN0eVRg3xEBWnnpi4m4L6dKUex_e1KjnZhQc&include_granted_scopes=true == GET https://api-pr-9702-superset.vercel.app/api/auth/desktop/connect?provider=other&state=x status=400 location= == GET https://api-pr-9702-superset.vercel.app/api/integrations/sentry/connect?organizationId=803f13a4-49b9-4664-826f-4090c750b0bc status=401 location=
Not run:
- Web preview:
web-pr-9702-superset.vercel.appis behind Vercel SSO (302 tovercel.com/sso-api), and a preview host never matches the fixed legacy source origin, so the move cannot show there anyway. - Live final hosts, real PostHog evaluation, real Sentry consent, Vercel host normalization, and the
prepare-finalworkflow dispatch. These need production access, and the PR says they need separate approval. - No UI changed, so there are no screenshots.
Questions for the author
- Legacy-API Slack/Linear/GitHub callbacks return to
app.superset.sh/integrations/<provider>?…. With the gate on, those pages move (only/integrations/sentryis retained). Is it OK for an in-flight connect started on legacy to land on app.paradev.com, where the user may have no session yet? - Preview deploys now pass
secrets.DOMAIN_MOVE_ENABLED, but preview origins never match the fixed legacy source. Is that passthrough meant to do anything before production wiring? /is retained, so ordinary root visits never move. Is the plan to keep that permanently, or to remove it after the billing return URLs change?
Test / CI notes
- Commit
7e4403704050faa917b6cbdd7de052e9d75a37a3(PR head). - CI: all checks green (Lint, Typecheck, Test, Sherif, CLI build, API/Web/Marketing/Docs previews, CodeRabbit). cubic was neutral because of its quota.
bun test src/domain-move src/legacy-integration-connect(packages/shared): 17 pass, 0 fail.bun test src/app/api/auth/desktop/connect(apps/api): 6 pass, 0 fail.bun test src/proxy-routes.test.ts(apps/web): 53 pass, 0 fail.python3 -I scripts/deploy-paradev-staging/guard_test.py: OK. CI does not run it.