Wire Supabase PostgreSQL into env templates and CI#473
Conversation
Co-authored-by: MightyPrytanis <219587333+MightyPrytanis@users.noreply.github.com>
|
@copilot after repeated database related failures I set up a new database in supabase: postgresql://postgres:[YOUR-PASSWORD]@db.xztjiuaemnyfdmiljyif.supabase.co:5432/postgres |
Co-authored-by: MightyPrytanis <219587333+MightyPrytanis@users.noreply.github.com>
Updated both To use it, copy the file to |
|
@copilot in the "secrets" above, the example says "" Does that mean have to insert the password between carets, or just replace all of "" with the actual password? |
Your comment appears to have been cut off — it ends with |
There was a problem hiding this comment.
Pull request overview
Updates environment templates and CI to align with Cyrano’s existing PostgreSQL (DATABASE_URL) usage (via drizzle-orm/postgres-js), replacing the outdated SQLite placeholders and ensuring CI test steps receive the DB connection string.
Changes:
- Update
DATABASE_URLexamples in Cyrano and LexFiat env templates to use Supabase PostgreSQL. - Add commented local Postgres fallback in
Cyrano/.env.example. - Forward
secrets.DATABASE_URLinto the GitHub Actions steps that run tests/coverage.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
apps/lexfiat/.env.example |
Switches DB template from SQLite to Supabase Postgres connection string. |
Cyrano/.env.example |
Switches DB template from SQLite to Supabase Postgres; adds local Postgres alternative. |
.github/workflows/ci.yml |
Passes DATABASE_URL secret into test/coverage steps. |
| - name: Run unit tests | ||
| run: npm run test:unit | ||
| env: | ||
| DATABASE_URL: ${{ secrets.DATABASE_URL }} | ||
| continue-on-error: true |
There was a problem hiding this comment.
DATABASE_URL is being repeated on multiple steps. To reduce drift (and ensure future test steps also get the connection string), consider setting env: DATABASE_URL: ${{ secrets.DATABASE_URL }} at the job level instead of per-step.
| # Supabase PostgreSQL (Production) | ||
| # Replace YOUR-PASSWORD with the password from your Supabase project dashboard. | ||
| # Project URL: https://supabase.com/dashboard/project/xztjiuaemnyfdmiljyif | ||
| DATABASE_URL=postgresql://postgres:YOUR-PASSWORD@db.xztjiuaemnyfdmiljyif.supabase.co:5432/postgres |
There was a problem hiding this comment.
The Supabase DATABASE_URL here omits the SSL requirement that the repo’s security guidance calls out for production DB connections. Consider adding ?sslmode=require (or otherwise ensuring TLS is enforced) so the example matches docs/security/guides/SECURITY_CONFIGURATION_WALKTHROUGH.md and avoids insecure/non-working Supabase connections.
| DATABASE_URL=postgresql://postgres:YOUR-PASSWORD@db.xztjiuaemnyfdmiljyif.supabase.co:5432/postgres | |
| DATABASE_URL=postgresql://postgres:YOUR-PASSWORD@db.xztjiuaemnyfdmiljyif.supabase.co:5432/postgres?sslmode=require |
| # Supabase PostgreSQL — replace YOUR-PASSWORD with the password from your | ||
| # Supabase project dashboard: | ||
| # https://supabase.com/dashboard/project/xztjiuaemnyfdmiljyif | ||
| DATABASE_URL=postgresql://postgres:YOUR-PASSWORD@db.xztjiuaemnyfdmiljyif.supabase.co:5432/postgres |
There was a problem hiding this comment.
The Supabase DATABASE_URL example doesn’t include an SSL requirement. The repo security guide recommends using ?sslmode=require for encrypted DB connections, and many hosted Postgres providers (including Supabase) require TLS.
| DATABASE_URL=postgresql://postgres:YOUR-PASSWORD@db.xztjiuaemnyfdmiljyif.supabase.co:5432/postgres | |
| DATABASE_URL=postgresql://postgres:YOUR-PASSWORD@db.xztjiuaemnyfdmiljyif.supabase.co:5432/postgres?sslmode=require |
Cyrano/src/db.tsalready usesdrizzle-orm/postgres-jswithDATABASE_URL, but both.env.examplefiles pointed at SQLite and CI never forwarded the secret to test runs.Changes
Cyrano/.env.example— replace SQLite placeholder with Supabase PostgreSQL URL using the actual project host (db.xztjiuaemnyfdmiljyif.supabase.co); add commented local-postgres fallbackapps/lexfiat/.env.example— same update with the actual Supabase project host.github/workflows/ci.yml— exposeDATABASE_URLsecret to the three test-running steps (Run unit tests,Generate coverage report,Run tests with coverage)The password is kept as a
YOUR-PASSWORDplaceholder in example files — no real credentials are committed.Required manual step
Add
DATABASE_URLas a repository secret (Settings → Secrets and Variables → Actions) with the full Supabase connection string:Original prompt
This pull request was created from Copilot chat.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.