Skip local training and embedding disk access on Vercel - #2049
groupthinking with Copilot wants to merge 3 commits into
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configurationConfiguration used: Repository: groupthinking/EventRelay/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: groupthinking <154503486+groupthinking@users.noreply.github.com>
🔍 PR Validation |
✅ E2E Test Results: ALL TESTS PASSED
Test Output |
There was a problem hiding this comment.
Copilot review overview
🟢 Approved
The focused guard changes match the stated scope and are covered for both local stores.
Review effort: Balanced
Findings: None
What changed in this PR
Updates local training and embedding stores to avoid filesystem access in Vercel deployments.
Changes:
- Detect Vercel through either
VERCEL=1or non-emptyVERCEL_ENV. - Add regression coverage confirming both stores make no filesystem calls in preview environments.
| File | Description |
|---|---|
apps/web/src/lib/training-store.ts |
Broadens Vercel runtime detection. |
apps/web/src/lib/embedding-store.ts |
Broadens Vercel runtime detection. |
apps/web/src/lib/__tests__/serverless-local-store.test.ts |
Tests serverless filesystem bypass behavior. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
✅ E2E Test Results: ALL TESTS PASSED
Test Output |
Dependency Review SummaryThe full dependency review summary was too large to display here (13153KB, limit is 1024KB). Please download the artifact named "dependency-review-summary" to view the complete report. |
Canonical issue
Automated issue linkage is handled separately.
Outcome
Vercel serverless executions stop attempting local training/embedding filesystem access, eliminating the
ENOENTmkdir/read noise from those code paths.Scope
apps/web/src/lib/training-store.tsandapps/web/src/lib/embedding-store.tsto recognize deployed Vercel environments viaVERCEL_ENV, not justVERCEL=1.VERCEL_ENV=previewand asserting nofs.promisescalls occur.Risk
VERCEL_ENVis set unexpectedly outside Vercel, local training/embedding disk persistence will be skipped for that process.Verification
List exact automated and manual checks, tied to the current head SHA.
npm --workspace=apps/web run test -- src/lib/__tests__/serverless-local-store.test.ts src/app/api/v1/refinery/dataset/__tests__/route.test.ts@86b36e5Production evidence
Not applicable. This is a runtime guard adjustment for Vercel serverless filesystem behavior; no preview-only UI or infrastructure evidence was required.
Agent handoff