You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: replace libSQL/Turso with MongoDB Atlas for heartbeat storage (#891)
* feat: replace libSQL/Turso with MongoDB Atlas for heartbeat storage
- Add MongoDB Go driver v2 repository implementations for HeartbeatRepository
and HeartbeatMonitorRepository interfaces
- Create mongodb.go connection helper with Atlas support and index creation
- Update DI container to wire MongoDB as the hedging secondary backend
- Replace 'turso' case with 'mongodb' case for standalone MongoDB usage
- Update integration test docker-compose to use mongo:7 instead of sqld
- Update .env.test with MongoDB connection string
HEARTBEAT_DB_BACKEND options:
- 'hedging': PostgreSQL primary, MongoDB secondary (fail-open writes)
- 'mongodb': MongoDB only
- default: PostgreSQL only (GORM)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chore: remove unused libSQL/Turso files and dependencies
- Delete libsql.go, libsql_heartbeat_repository.go, libsql_heartbeat_monitor_repository.go
- Remove TursoDB() method and tursoDB field from DI container
- Remove unused database/sql import from container
- Run go mod tidy to remove libsql-client-go dependency
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* refactor: use entity structs directly with bson tags instead of document types
- Add bson struct tags to entities.Heartbeat and entities.HeartbeatMonitor
- Register custom UUID codec so uuid.UUID is stored as string _id in MongoDB
- Remove intermediate heartbeatDocument/heartbeatMonitorDocument structs
- MongoDB repositories now marshal/unmarshal entities directly
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* refactor: derive MongoDB database name from URI appName parameter
- Remove hardcoded mongoDBName constant
- Parse appName query parameter from MONGODB_URI as the database name
- NewMongoDB now returns (client, dbName, error)
- Repository constructors accept dbName parameter
- DI container caches and passes the DB name to repositories
- Update test .env to include appName=httpsms in URI
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* refactor: pass *mongo.Database directly to repository constructors
- NewMongoDB now returns *mongo.Database instead of (*mongo.Client, dbName)
- Repository constructors accept *mongo.Database instead of client + dbName
- DI container caches the *mongo.Database singleton directly
- Removes MongoDBName() helper - no longer needed
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix: correct outgoing message queue docs URL in settings
Fix typo in URL: outgiong -> outgoing
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* feat: add OpenTelemetry tracing to MongoDB client
Use otelmongo.NewMonitor() as the command monitor on the MongoDB
client to automatically trace all database operations.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix: address PR review comments
- Remove MongoDB URI from Ping error message to prevent credential
exposure in logs and error aggregators
- Use separate contexts for Ping (10s) and index creation (30s) so
they don't share a timeout budget
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix: update send schedule docs link to correct URL
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix: update CI workflow to check MongoDB instead of sqld
Replace the sqld health check with a MongoDB mongosh ping check
since the test infrastructure now uses mongo:7 instead of sqld.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
0 commit comments