Skip to content

fix(relay): harden migration IPv6/TLS, add full worker boot test, and log public deploy outputs - #502

Merged
shuv1337 merged 3 commits into
mainfrom
fix/connect-relay-followups-477
Nov 25, 2026
Merged

shuv1337 merged 3 commits into
mainfrom
fix/connect-relay-followups-477

Conversation

@shuv1337

Copy link
Copy Markdown
Owner

Refs #477.

Addresses the five code and deploy-robustness follow-ups from #477 (leaving hosting/account items open on #477):

  • Full Worker runtime boot test (infra/relay/src/workerPlan.test.ts): Added RELAY_DB_PORT: "5432" to externalDbEnv and added an end-to-end runtime boot test that sets globalThis.__ALCHEMY_RUNTIME__ = true (restored via Effect.acquireUseRelease), supplies only runtime Worker bindings (zero deploy-only env vars), boots RelayWorker.layer, and serves GET /.well-known/oauth-authorization-server.
  • IPv6 host bracketing (infra/relay/src/postgresMigrations.ts, postgresMigrations.test.ts): Bracketed bare IPv6 hosts (::1 → [::1]) without double-bracketing when building sslmode=prefer|allow URLs, stripped brackets for structured PgClientConfig.host, and added unit tests across prefer, allow, disable, and URL forms.
  • Consistent sslmode=require / verify-ca TLS handling (infra/relay/src/postgresMigrations.ts, postgresMigrations.test.ts): Aligned RELAY_DB_* + RELAY_DB_MIGRATION_SSLMODE=require with RELAY_DATABASE_URL=...sslmode=require on verified TLS (ssl: true or { rejectUnauthorized: true, servername } over loopback tunnels), matching @effect/sql-pg / node-postgres v8+, and aligned verify-ca across both forms.
  • First-deploy Alchemy 404 note (docs/operations/hosted-fork.md): Documented the transient State store request failed (DecodeError, HTTP 404) ~3s after creating a fresh account's state store Worker (re-running deploy once resolves it) and noted require certificate verification.
  • Automation-readable public deploy outputs (.github/workflows/deploy-relay.yml, infra/relay/src/forkOwnership.test.ts): Logged only the two public outputs (T3CODE_RELAY_URL and T3CODE_CLOUD_MINT_PUBLIC_KEY) to stdout in addition to $GITHUB_STEP_SUMMARY, with updated forkOwnership.test.ts assertions keeping the secret-free guard intact.

Verification

  • Targeted relay tests: 3 files, 34/34 passed.
  • check:changed passed format, lint, Knip (1/2 + 2/2), typecheck (44 packages), and tests (4 files, 36/36 passed); agentContextBudget.json is unchanged.

Built with gemini-4-neon (antigravity).

@shuv1337
shuv1337 merged commit 68a5e32 into main Nov 25, 2026
6 checks passed
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