Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughThis PR introduces ClickHouse readiness checks across CI/CD workflows and the startup sequence, refactors ClickHouse migration SQL to use direct field access with explicit type casting, removes deduplicationId from Upstash request payloads, adds diagnostic logging to external database sync logic, changes metadata column types from JSON to String in the ClickHouse schema, and updates error message text in sign-up rule test snapshots. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Suggested reviewers
Poem
✨ 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 |
apps/backend/src/app/api/latest/internal/external-db-sync/poller/route.ts
Show resolved
Hide resolved
Greptile SummaryThis PR fixes several ClickHouse sync issues and improves CI reliability:
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant CI as CI Workflow
participant Docker as Docker Compose
participant CH as ClickHouse
participant PG as PostgreSQL
participant Init as db:init
CI->>Docker: deps-compose up
Docker->>PG: Start PostgreSQL
Docker->>CH: Start ClickHouse
CI->>PG: wait-until-postgres-is-ready
PG-->>CI: Ready
CI->>CH: wait-on http://localhost:PORT/ping
CH-->>CI: Ready (NEW)
CI->>Init: pnpm run db:init
Init->>PG: Run Prisma migrations
Init->>CH: Run ClickHouse migrations
Note over CH: Token-refresh migration<br/>uses new data.field::Type syntax
Note over CH: Users table uses<br/>String instead of JSON<br/>for metadata columns
Last reviewed commit: 8d1a710 |
| if (rows.length > 1) { | ||
| console.log("db-sync-postgres: more than 1 row returned from source db fetch", { tenancyId, numRows: rows.length }); | ||
| } |
There was a problem hiding this comment.
Consider using captureError instead of console.log
The rest of this file uses captureError for reporting unexpected conditions (lines 731, 735, 775, 779, 793). Using console.log here means this diagnostic signal won't appear in your error tracking/alerting system. If this is expected in normal operation (e.g., batch queries returning multiple rows), then a console.log is fine as a temporary debug aid. But if "more than 1 row" indicates an unexpected condition worth monitoring, captureError would be more consistent with the existing patterns in this file.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Additional Comments (1)
Looking at git history, the token-refresh migration was updated from the old pattern to the new one (commit Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time! |
<!-- Make sure you've read the CONTRIBUTING.md guidelines: https://github.com/stack-auth/stack-auth/blob/dev/CONTRIBUTING.md -->
Summary by CodeRabbit
Bug Fixes
Chores