feat: SDLC database separation for CI/testing (#35)
## Summary - Fix `isProductionDatabase()` to allow CI database (`euchre_camp_ci`) - Add database schema reset before CI test runs - Create `global.teardown.ts` for cleanup (CI: full reset, dev/prod: selective cleanup) - Add `acceptance-tests` job to PR workflow with CI database - Create `sync-prod-to-dev.js` script for one-way prod→dev sync - Add `just` recipes: `sync-dev`, `test-prod`, `reset-ci-db` - Store credentials in `.credentials` (gitignored) with unique CI user ## Testing Verified against CI database: - Schema reset works - Migrations apply correctly - Test users created successfully - 219 tests pass (slow but working) ## Next Steps - Set `CI_DATABASE_URL` as Gitea repository variable Reviewed-on: #35 Co-authored-by: David Gwilliam <dhgwilliam@gmail.com> Co-committed-by: David Gwilliam <dhgwilliam@gmail.com>
This commit was merged in pull request #35.
This commit is contained in:
+24
-8
@@ -24,11 +24,11 @@
|
||||
- [x] Write TODO list to repository file
|
||||
- [x] Auto-create tournament when uploading matches without selecting one
|
||||
|
||||
### In Progress 🔄
|
||||
- [ ] Update API routes to handle new variant scoring fields
|
||||
- [ ] Update EditTournamentForm to add variant scoring controls
|
||||
- [ ] Update MatchEditor to use tournament-specific target score
|
||||
- [ ] Run tests and verify variant scoring implementation
|
||||
### Completed ✅
|
||||
- [x] Update API routes to handle new variant scoring fields
|
||||
- [x] Update EditTournamentForm to add variant scoring controls
|
||||
- [x] Update MatchEditor to use tournament-specific target score
|
||||
- [x] Run tests and verify variant scoring implementation
|
||||
|
||||
### Recently Completed ✅
|
||||
- [x] Update CI/CD workflows to use Bun (PR, release)
|
||||
@@ -59,11 +59,27 @@
|
||||
- [x] Create migration to add rating system tables (elo_ratings, glicko2_ratings, open_skill_ratings)
|
||||
- [x] Add tabbed rankings page to display Elo, OpenSkill, and Glicko2 ratings
|
||||
|
||||
### Completed ✅
|
||||
- [x] Add UI controls for variant scoring in tournament creation/edit
|
||||
- [x] Test variant tournament functionality end-to-end (e2e/tournament-edit-allowTies.test.ts)
|
||||
- [x] Add validation for tie scores based on tournament configuration (MatchEditor.tsx)
|
||||
|
||||
### Completed ✅ (CI/DB Infrastructure)
|
||||
- [x] Fix PostgreSQL database ownership — each env owns its own DB
|
||||
- [x] Fix role attributes — euchre_camp_dev gets CREATEDB, euchre_camp_ci loses SUPERUSER
|
||||
- [x] Update .env.development to use euchre_camp_dev user
|
||||
- [x] Update .env.development.local to use euchre_camp_dev user
|
||||
- [x] Update CI docker-compose to use euchre_camp_ci user
|
||||
- [x] Update dev docker-compose to use euchre_camp_dev user
|
||||
- [x] Recreate dev and CI containers with correct credentials
|
||||
- [x] Fix Playwright baseURL for CI (https://euchre-ci.notsosm.art)
|
||||
- [x] Fix Navigation unit tests (RoleSwitcherProvider wrapper)
|
||||
- [x] Fix secrets vs vars in PR workflow (secrets.CI_DATABASE_URL)
|
||||
|
||||
### Backlog 📋
|
||||
- [ ] Add UI controls for variant scoring in tournament creation/edit
|
||||
- [ ] Test variant tournament functionality end-to-end
|
||||
- [ ] Add validation for tie scores based on tournament configuration
|
||||
- [ ] Document variant tournament features
|
||||
- [ ] Update Gitea secret CI_DATABASE_URL to use euchre_camp_ci user
|
||||
- [ ] Test isolation improvements for parallel CI execution
|
||||
|
||||
## Recently Completed (Detailed)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user