Repository navigation
Move Orbit from EKS to Vercel and Supabase - #85
Conversation
The EKS deploy pipeline goes away with the move to Vercel. Image builds and rollouts are handled by the platform now, so the buildspec has no remaining consumer.
The Vercel project builds green once the Orbit configuration reaches it, so this reads the prd config and writes each value to the project. Redis is skipped by default because the Doppler value addresses the in-cluster service, and a replacement is passed with --set.
The server code imports Bun built-ins directly: SQL and drizzle-orm/bun-sql in packages/db, RedisClient in the realtime publisher, S3Client in storage, password in auth, and randomUUIDv7 across services. On the Node runtime every request failed with 'Cannot find module bun'. Selecting the Bun runtime keeps all of that working, and the build script already passes --bun so nothing else changes.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
pulkitxm has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.
|
preview on the bun runtime, hitting supabase that last one is the one that matters: better-auth read the user table in supabase and data restored from the 24 jul dump, diffed against a local reference restore: pg_trgm had to be installed by hand: the four gin trigram indexes on issue.title, |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughVercel runtime configuration was added, the deployment buildspec was removed, and a CLI was introduced to fetch filtered Doppler secrets, resolve credentials, and upsert encrypted environment variables in Vercel across selected targets. ChangesVercel deployment configuration
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant CLI
participant AWSSecretsManager
participant Doppler
participant Vercel
CLI->>AWSSecretsManager: Resolve DOPPLER_TOKEN_BUILD when needed
CLI->>Doppler: Fetch filtered computed secrets
CLI->>Vercel: List existing keys for selected targets
CLI->>Vercel: Upsert encrypted environment values
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (1)
scripts/sync-vercel-env.ts (1)
198-278: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winNo retry/backoff around Doppler or Vercel calls.
Both APIs document rate limiting, and this script runs unattended as part of the deploy flow; a single transient 429/5xx aborts the whole sync mid-way. Consider a small retry-with-backoff wrapper around
fetchinreadDoppler/existingEnv/vercelfor resiliency.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@scripts/sync-vercel-env.ts` around lines 198 - 278, Introduce a shared retry-with-backoff fetch wrapper and route all Doppler and Vercel requests through it, including calls from readDoppler, existingEnv, and vercel. Retry transient 429 and 5xx responses with a small bounded backoff, while returning other responses immediately and preserving the existing response-status error handling.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@scripts/sync-vercel-env.ts`:
- Around line 87-113: Update dopplerTokenFromAws to capture the AWS subprocess
stderr instead of configuring stderr as 'ignore'. Read the captured diagnostics
and include them in the error thrown when proc.exited is nonzero, while
preserving the existing success parsing and fallback guidance.
- Around line 16-53: Replace the manual payload validation in isRecord,
dopplerSecrets, and vercelEnvEntries with Zod schemas that validate the complete
Doppler and Vercel response shapes before transformation. Use the parsed Zod
results to build the existing Map<string, string> and VercelEnvEntry[] outputs,
preserving the current malformed-payload error behavior where practical.
- Around line 228-240: Update existingEnv to retain every matching Vercel
environment-entry ID rather than collapsing records by key alone. Track IDs per
key and target, or otherwise return all entries whose targets overlap
options.targets, then update the deletion flow to remove every matching ID
before recreating replacements.
- Around line 263-274: Update the environment-variable replacement flow to avoid
deleting the existing variable before a successful replacement. In the block
guarded by previous, replace the DELETE request and subsequent create-only flow
with an in-place PATCH to /v9/projects/{projectId}/env/{previous}, preserving
the key, value, type, and target fields; alternatively use the supported POST
upsert behavior. Keep error handling for unsuccessful requests and retain
creation behavior when previous is undefined.
---
Nitpick comments:
In `@scripts/sync-vercel-env.ts`:
- Around line 198-278: Introduce a shared retry-with-backoff fetch wrapper and
route all Doppler and Vercel requests through it, including calls from
readDoppler, existingEnv, and vercel. Retry transient 429 and 5xx responses with
a small bounded backoff, while returning other responses immediately and
preserving the existing response-status error handling.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 971a6500-f278-4d6d-b75f-ea607ba26f1f
📒 Files selected for processing (3)
apps/web/vercel.jsonbuildspec.ymlscripts/sync-vercel-env.ts
💤 Files with no reviewable changes (1)
- buildspec.yml
Delete then create left a window where a failed POST removed a live variable outright. Vercel also returns one entry per key and target, so collapsing the lookup by key alone deleted only one of a pair and left the other stale. Posting with upsert lets Vercel match on key and target and never removes anything first. The AWS lookup now surfaces stderr so a credential failure says why.
There was a problem hiding this comment.
pulkitxm has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.
scripts/sync-vercel-env.ts pulls secrets from Doppler and pushes them into Vercel. It arrived with the move from EKS to Vercel in #85 and has never been referenced since: no package script, no workflow, no doc. The only match for "doppler" anywhere in the repository is the file itself. Orbit's environment is set directly in Vercel. Leaving a script that describes a different process is worse than having no script, because it reads as documentation. It cost me exactly that: I read it, concluded env flowed through Doppler, and told the owner a secret had to be added there. It did not. It went straight into Vercel, where everything else already lives.
Run the web app on Vercel's Bun runtime against Supabase Postgres and retire the CodeBuild pipeline.