Add an auth read-replica database client#1759
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7ebcccb8f5
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| github.com/aws/aws-sdk-go-v2/service/s3 v1.79.3 | ||
| github.com/bits-and-blooms/bitset v1.22.0 | ||
| github.com/dchest/uniuri v1.2.0 | ||
| github.com/e2b-dev/infra/packages/db v0.0.0-20251013083250-eb6cd250d671 |
There was a problem hiding this comment.
I wanted to remove the shared dependency on db (it was circular)
| } | ||
| } | ||
|
|
||
| func FromDB(build queries.EnvBuild) MachineInfo { |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
Note
Introduces a dedicated
authdb.ClientwithRead/Writeseparation and optional read-replica, and refactors services to use it for auth flows.postgres-read-replica-connection-stringsecret and passesAUTH_DB_*env vars in Nomad/API; updates Terraform wiringAUTH_DB_CONNECTION_STRING,AUTH_DB_READ_REPLICA_CONNECTION_STRING, pool sizing; defaults toPOSTGRES_CONNECTION_STRINGwhen unsetpackages/db/pkg/authwith generatedauth/queries; updates handlers, team/db helpers, and caches to useauthdb.Client; backgroundUpdateLastTimeUsedpoolbuilder; addsbuilds.ToMachineInfo; removes direct machineinfo-from-EnvBuild couplingauthdb.Clientpackages/dbMakefileseed-dbWritten by Cursor Bugbot for commit ddc8fdc. This will update automatically on new commits. Configure here.