Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# PR_26177_GOLF_036-game-journey-metrics-sqlite-to-postgres-migration

Team: Golf
Branch: pr/26177-GOLF-036-game-journey-metrics-sqlite-to-postgres-migration
Base: main
Lifecycle: Build / Validation

## Scope

- Added a one-time server-side migration utility for legacy Game Journey completion metrics.
- Inspected the legacy SQLite file at `tmp/local-api/game-journey-completion-metrics.sqlite`.
- Migrated valid completion metric data through the existing Postgres client/service contract path.
- Preserved legacy `createdAt` and `updatedAt` values for rows already present in Postgres.
- Archived the legacy SQLite file only after the migration completed successfully.

## Legacy SQLite Inspection

- File inspected: `tmp/local-api/game-journey-completion-metrics.sqlite`
- Table found: `game_journey_completion_metrics`
- Schema objects found: 4
- Valid rows found: 14
- Columns matched the current Postgres table shape.

## Migration Result

- Command: `node --use-system-ca scripts/migrate-game-journey-completion-metrics-sqlite-to-postgres.mjs`
- Env file: `.env` loaded; secrets were not printed.
- Legacy rows: 14
- Rows inserted: 0
- Rows already present: 0
- Rows timestamp-patched: 14
- Result: PASS
- Legacy file archived to:
`tmp/local-api/legacy-migrated/game-journey-completion-metrics-20260625T195902Z.sqlite`

The existing Postgres rows matched the legacy rows except for `createdAt` and `updatedAt`. The migration patched those timestamp fields explicitly, then moved the SQLite file out of the runtime guard path.

## Changed Files

- `scripts/migrate-game-journey-completion-metrics-sqlite-to-postgres.mjs`
- `src/dev-runtime/persistence/game-journey-completion-metrics-migration.mjs`
- `src/dev-runtime/persistence/game-journey-completion-metrics-store.mjs`
- `tests/dev-runtime/GameJourneyCompletionMetricsMigration.test.mjs`
- `docs_build/dev/reports/coverage_changed_js_guardrail.txt`
- `docs_build/dev/reports/playwright_v8_coverage_report.txt`

## Validation

- PASS: `node --check src/dev-runtime/persistence/game-journey-completion-metrics-migration.mjs`
- PASS: `node --check scripts/migrate-game-journey-completion-metrics-sqlite-to-postgres.mjs`
- PASS: `node --check src/dev-runtime/persistence/game-journey-completion-metrics-store.mjs`
- PASS: `node --test tests/dev-runtime/GameJourneyCompletionMetricsMigration.test.mjs`
- PASS: `node --use-system-ca scripts/migrate-game-journey-completion-metrics-sqlite-to-postgres.mjs --inspect-only`
- PASS: `node --use-system-ca scripts/migrate-game-journey-completion-metrics-sqlite-to-postgres.mjs`
- PASS: `npx playwright test tests/playwright/tools/GameJourneyTool.spec.mjs --grep "completion metrics" --workers=1 --reporter=line`
- PASS: `git diff --check`

## ZIP

- `tmp/PR_26177_GOLF_036-game-journey-metrics-sqlite-to-postgres-migration_delta.zip`
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# PR_26177_GOLF_036 Branch Validation

Branch: pr/26177-GOLF-036-game-journey-metrics-sqlite-to-postgres-migration
Base: main

Result: PASS

Checks:
- PASS: Branch created from clean, synced `main` after Charlie PRs #177, #178, #180, #181, #183, and #184 merged.
- PASS: Branch name matches PR identity.
- PASS: Worktree changes are scoped to migration utility, migration tests, and required reports.
- PASS: No `start_of_day` files changed.
- PASS: No UI files changed.
- PASS: No browser storage or browser-owned product data was introduced.
- PASS: Legacy SQLite file was moved only after successful migration.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# PR_26177_GOLF_036 Manual Validation Notes

- Confirmed legacy SQLite existed before migration at `tmp/local-api/game-journey-completion-metrics.sqlite`.
- Confirmed inspect-only mode found 14 valid rows and did not move the file.
- Confirmed actual migration loaded `.env` without printing secrets.
- Confirmed actual migration patched 14 timestamp-only Postgres differences.
- Confirmed actual migration inserted 0 rows because completion metrics were already present.
- Confirmed actual migration archived the legacy file to `tmp/local-api/legacy-migrated/game-journey-completion-metrics-20260625T195902Z.sqlite`.
- Confirmed `tmp/local-api/game-journey-completion-metrics.sqlite` no longer exists after migration.
- Confirmed targeted Game Journey completion metrics Playwright tests passed.
- Confirmed no `start_of_day` files changed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# PR_26177_GOLF_036 Requirement Checklist

- PASS: Inspected the legacy SQLite schema and data.
- PASS: Exported valid Game Journey completion metrics from legacy SQLite.
- PASS: Migrated valid metrics through the Postgres service/client path.
- PASS: Preserved `createdAt` and `updatedAt` values where available.
- PASS: Did not silently overwrite existing Postgres data.
- PASS: Detected duplicate and conflicting rows before writes.
- PASS: Moved legacy SQLite only after successful migration.
- PASS: Archived legacy SQLite under `tmp/local-api/legacy-migrated/`.
- PASS: Did not delete data.
- PASS: Did not use browser storage.
- PASS: Did not introduce MEM DB, local-mem, fake-login, or silent fallback terminology.
- PASS: Preserved Web UI -> API/Service Contract -> Database ownership.
- PASS: Created required reports and ZIP artifact.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# PR_26177_GOLF_036 Validation Lane Report

Impacted lanes:
- Game Journey completion metrics persistence.
- One-time legacy SQLite migration command.
- Postgres duplicate/conflict handling.
- Targeted Game Journey completion metrics Playwright coverage.

Commands:
- PASS: `node --check src/dev-runtime/persistence/game-journey-completion-metrics-migration.mjs`
- PASS: `node --check scripts/migrate-game-journey-completion-metrics-sqlite-to-postgres.mjs`
- PASS: `node --check src/dev-runtime/persistence/game-journey-completion-metrics-store.mjs`
- PASS: `node --test tests/dev-runtime/GameJourneyCompletionMetricsMigration.test.mjs`
- PASS: `node --use-system-ca scripts/migrate-game-journey-completion-metrics-sqlite-to-postgres.mjs --inspect-only`
- PASS: `node --use-system-ca scripts/migrate-game-journey-completion-metrics-sqlite-to-postgres.mjs`
- PASS: `npx playwright test tests/playwright/tools/GameJourneyTool.spec.mjs --grep "completion metrics" --workers=1 --reporter=line`
- PASS: `git diff --check`

Skipped lanes:
- Full samples smoke skipped; not impacted by this scoped migration utility.
- Full Project Workspace suite skipped; targeted Game Journey persistence and Playwright coverage was sufficient.

Result: PASS
55 changes: 26 additions & 29 deletions docs_build/dev/reports/codex_changed_files.txt
Original file line number Diff line number Diff line change
@@ -1,31 +1,28 @@
# git diff --name-only pr/26177-CHARLIE-034-startup-runtime-report-cleanup --
assets/theme-v2/css/status.css
assets/theme-v2/css/tables.css
docs_build/dev/reports/PR_26177_CHARLIE_035-system-health-ui-polish.md
docs_build/dev/reports/PR_26177_CHARLIE_035-system-health-ui-polish_branch-validation.md
docs_build/dev/reports/PR_26177_CHARLIE_035-system-health-ui-polish_manual-validation-notes.md
docs_build/dev/reports/PR_26177_CHARLIE_035-system-health-ui-polish_requirements-checklist.md
docs_build/dev/reports/PR_26177_CHARLIE_035-system-health-ui-polish_validation-lane.md
docs_build/dev/reports/codex_changed_files.txt
docs_build/dev/reports/codex_review.diff
docs_build/dev/reports/coverage_changed_js_guardrail.txt
docs_build/dev/reports/playwright_v8_coverage_report.txt

# git status --short
M docs_build/dev/reports/PR_26177_CHARLIE_035-system-health-ui-polish.md
M docs_build/dev/reports/codex_review.diff
M docs_build/dev/reports/coverage_changed_js_guardrail.txt
M docs_build/dev/reports/coverage_changed_js_guardrail.txt
M docs_build/dev/reports/playwright_v8_coverage_report.txt
M src/dev-runtime/persistence/game-journey-completion-metrics-store.mjs
?? docs_build/dev/reports/PR_26177_GOLF_036-game-journey-metrics-sqlite-to-postgres-migration.md
?? docs_build/dev/reports/PR_26177_GOLF_036-game-journey-metrics-sqlite-to-postgres-migration_branch-validation.md
?? docs_build/dev/reports/PR_26177_GOLF_036-game-journey-metrics-sqlite-to-postgres-migration_manual-validation-notes.md
?? docs_build/dev/reports/PR_26177_GOLF_036-game-journey-metrics-sqlite-to-postgres-migration_requirements-checklist.md
?? docs_build/dev/reports/PR_26177_GOLF_036-game-journey-metrics-sqlite-to-postgres-migration_validation-lane.md
?? scripts/migrate-game-journey-completion-metrics-sqlite-to-postgres.mjs
?? src/dev-runtime/persistence/game-journey-completion-metrics-migration.mjs
?? tests/dev-runtime/GameJourneyCompletionMetricsMigration.test.mjs

# git ls-files --others --exclude-standard
docs_build/dev/reports/PR_26177_GOLF_036-game-journey-metrics-sqlite-to-postgres-migration.md
docs_build/dev/reports/PR_26177_GOLF_036-game-journey-metrics-sqlite-to-postgres-migration_branch-validation.md
docs_build/dev/reports/PR_26177_GOLF_036-game-journey-metrics-sqlite-to-postgres-migration_manual-validation-notes.md
docs_build/dev/reports/PR_26177_GOLF_036-game-journey-metrics-sqlite-to-postgres-migration_requirements-checklist.md
docs_build/dev/reports/PR_26177_GOLF_036-game-journey-metrics-sqlite-to-postgres-migration_validation-lane.md
scripts/migrate-game-journey-completion-metrics-sqlite-to-postgres.mjs
src/dev-runtime/persistence/game-journey-completion-metrics-migration.mjs
tests/dev-runtime/GameJourneyCompletionMetricsMigration.test.mjs

# git diff --stat pr/26177-CHARLIE-034-startup-runtime-report-cleanup --
assets/theme-v2/css/status.css | 52 ++
assets/theme-v2/css/tables.css | 37 ++
...PR_26177_CHARLIE_035-system-health-ui-polish.md | 25 +
...35-system-health-ui-polish_branch-validation.md | 14 +
...tem-health-ui-polish_manual-validation-notes.md | 8 +
...stem-health-ui-polish_requirements-checklist.md | 12 +
..._035-system-health-ui-polish_validation-lane.md | 10 +
docs_build/dev/reports/codex_changed_files.txt | 57 +-
docs_build/dev/reports/codex_review.diff | 617 +++++++--------------
.../dev/reports/coverage_changed_js_guardrail.txt | 4 +-
.../dev/reports/playwright_v8_coverage_report.txt | 10 +-
11 files changed, 382 insertions(+), 464 deletions(-)
# git diff --stat
.../dev/reports/coverage_changed_js_guardrail.txt | 6 +++--
.../dev/reports/playwright_v8_coverage_report.txt | 31 +++++++++++++---------
.../game-journey-completion-metrics-store.mjs | 2 +-
3 files changed, 23 insertions(+), 16 deletions(-)
Loading
Loading