Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (24)
📝 WalkthroughWalkthrough共通の共有DBパス解決ロジックを Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@db/migrate-integrations-to-shared.ts`:
- Around line 13-18: The path normalization currently checks
pathname.startsWith('/') which misclassifies relative file: URLs like
"file:./data/db" because new URL() normalizes them; update sharedDbFilePath to
inspect the original DATABASE_URL string instead: get const urlStr =
process.env.DATABASE_URL ?? 'file:./data/data.db', then if urlStr
startsWith('file:') and does NOT startWith('file:///') treat it as a relative
file URL and resolve to an absolute path via join(process.cwd(), new
URL(urlStr).pathname); otherwise parse with new URL(urlStr) and, for absolute
file URLs (file:///...) return the URL.pathname as before. This change targets
the function sharedDbFilePath and the DATABASE_URL handling logic.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 67211e4f-8418-47f3-a856-540a3788a326
📒 Files selected for processing (1)
db/migrate-integrations-to-shared.ts
a6c0bd0 to
ea421b2
Compare
DATABASE_URL をパースして NODE_ENV で prefix を分岐する自前ロジックを完全廃止。 Dockerfile で既に定義されていた UPFLOW_DATA_DIR を正本にする。 - db/data-dir.ts: resolveDataDir() を軽量モジュールとして抽出 - db.server.ts: resolveDataDir() を re-export、path.join(dataDir, 'data.db') - tenant-db.server.ts: resolveDataDir() から tenant DB パスを組み立て - apply-tenant-migrations.ts / migrate-integrations-to-shared.ts: resolveDataDir() を使用 - start.sh: UPFLOW_DATA_DIR から DB URL を組み立て - Dockerfile: DATABASE_URL を削除(不要になった) - dotenv.server.ts: DATABASE_URL を必須から削除、UPFLOW_DATA_DIR を追加 - .env.example / README.md: DATABASE_URL → UPFLOW_DATA_DIR に更新 - テスト: DATABASE_URL / NODE_ENV=production の stub を全削除、UPFLOW_DATA_DIR のみに - DB 未発見時は throw でプロセス停止 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ea421b2 to
92e259a
Compare
Summary
path.joinで絶対パスが二重結合される問題を修正(/upflow/upflow/data/data.db)背景
#245 のデプロイ時に、
DATABASE_URL=file:/upflow/data/data.dbの pathname をpath.join(process.cwd(), ...)で結合したため、パスが/upflow/upflow/data/data.dbになり DB が見つからなかった。スクリプトは「skip」として正常終了し、データがコピーされないまま tenant の integrations テーブルが削除された。Test plan
pnpm validate全パス🤖 Generated with Claude Code
Summary by CodeRabbit
リリースノート