Skip to content

Commit c66099d

Browse files
authored
Merge PR_26177_GOLF_036-game-journey-metrics-sqlite-to-postgres-migration
Merge Game Journey completion metrics SQLite to Postgres migration.
2 parents 41eaa1d + c9ad2f0 commit c66099d

13 files changed

Lines changed: 1961 additions & 255 deletions
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# PR_26177_GOLF_036-game-journey-metrics-sqlite-to-postgres-migration
2+
3+
Team: Golf
4+
Branch: pr/26177-GOLF-036-game-journey-metrics-sqlite-to-postgres-migration
5+
Base: main
6+
Lifecycle: Build / Validation
7+
8+
## Scope
9+
10+
- Added a one-time server-side migration utility for legacy Game Journey completion metrics.
11+
- Inspected the legacy SQLite file at `tmp/local-api/game-journey-completion-metrics.sqlite`.
12+
- Migrated valid completion metric data through the existing Postgres client/service contract path.
13+
- Preserved legacy `createdAt` and `updatedAt` values for rows already present in Postgres.
14+
- Archived the legacy SQLite file only after the migration completed successfully.
15+
16+
## Legacy SQLite Inspection
17+
18+
- File inspected: `tmp/local-api/game-journey-completion-metrics.sqlite`
19+
- Table found: `game_journey_completion_metrics`
20+
- Schema objects found: 4
21+
- Valid rows found: 14
22+
- Columns matched the current Postgres table shape.
23+
24+
## Migration Result
25+
26+
- Command: `node --use-system-ca scripts/migrate-game-journey-completion-metrics-sqlite-to-postgres.mjs`
27+
- Env file: `.env` loaded; secrets were not printed.
28+
- Legacy rows: 14
29+
- Rows inserted: 0
30+
- Rows already present: 0
31+
- Rows timestamp-patched: 14
32+
- Result: PASS
33+
- Legacy file archived to:
34+
`tmp/local-api/legacy-migrated/game-journey-completion-metrics-20260625T195902Z.sqlite`
35+
36+
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.
37+
38+
## Changed Files
39+
40+
- `scripts/migrate-game-journey-completion-metrics-sqlite-to-postgres.mjs`
41+
- `src/dev-runtime/persistence/game-journey-completion-metrics-migration.mjs`
42+
- `src/dev-runtime/persistence/game-journey-completion-metrics-store.mjs`
43+
- `tests/dev-runtime/GameJourneyCompletionMetricsMigration.test.mjs`
44+
- `docs_build/dev/reports/coverage_changed_js_guardrail.txt`
45+
- `docs_build/dev/reports/playwright_v8_coverage_report.txt`
46+
47+
## Validation
48+
49+
- PASS: `node --check src/dev-runtime/persistence/game-journey-completion-metrics-migration.mjs`
50+
- PASS: `node --check scripts/migrate-game-journey-completion-metrics-sqlite-to-postgres.mjs`
51+
- PASS: `node --check src/dev-runtime/persistence/game-journey-completion-metrics-store.mjs`
52+
- PASS: `node --test tests/dev-runtime/GameJourneyCompletionMetricsMigration.test.mjs`
53+
- PASS: `node --use-system-ca scripts/migrate-game-journey-completion-metrics-sqlite-to-postgres.mjs --inspect-only`
54+
- PASS: `node --use-system-ca scripts/migrate-game-journey-completion-metrics-sqlite-to-postgres.mjs`
55+
- PASS: `npx playwright test tests/playwright/tools/GameJourneyTool.spec.mjs --grep "completion metrics" --workers=1 --reporter=line`
56+
- PASS: `git diff --check`
57+
58+
## ZIP
59+
60+
- `tmp/PR_26177_GOLF_036-game-journey-metrics-sqlite-to-postgres-migration_delta.zip`
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# PR_26177_GOLF_036 Branch Validation
2+
3+
Branch: pr/26177-GOLF-036-game-journey-metrics-sqlite-to-postgres-migration
4+
Base: main
5+
6+
Result: PASS
7+
8+
Checks:
9+
- PASS: Branch created from clean, synced `main` after Charlie PRs #177, #178, #180, #181, #183, and #184 merged.
10+
- PASS: Branch name matches PR identity.
11+
- PASS: Worktree changes are scoped to migration utility, migration tests, and required reports.
12+
- PASS: No `start_of_day` files changed.
13+
- PASS: No UI files changed.
14+
- PASS: No browser storage or browser-owned product data was introduced.
15+
- PASS: Legacy SQLite file was moved only after successful migration.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# PR_26177_GOLF_036 Manual Validation Notes
2+
3+
- Confirmed legacy SQLite existed before migration at `tmp/local-api/game-journey-completion-metrics.sqlite`.
4+
- Confirmed inspect-only mode found 14 valid rows and did not move the file.
5+
- Confirmed actual migration loaded `.env` without printing secrets.
6+
- Confirmed actual migration patched 14 timestamp-only Postgres differences.
7+
- Confirmed actual migration inserted 0 rows because completion metrics were already present.
8+
- Confirmed actual migration archived the legacy file to `tmp/local-api/legacy-migrated/game-journey-completion-metrics-20260625T195902Z.sqlite`.
9+
- Confirmed `tmp/local-api/game-journey-completion-metrics.sqlite` no longer exists after migration.
10+
- Confirmed targeted Game Journey completion metrics Playwright tests passed.
11+
- Confirmed no `start_of_day` files changed.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# PR_26177_GOLF_036 Requirement Checklist
2+
3+
- PASS: Inspected the legacy SQLite schema and data.
4+
- PASS: Exported valid Game Journey completion metrics from legacy SQLite.
5+
- PASS: Migrated valid metrics through the Postgres service/client path.
6+
- PASS: Preserved `createdAt` and `updatedAt` values where available.
7+
- PASS: Did not silently overwrite existing Postgres data.
8+
- PASS: Detected duplicate and conflicting rows before writes.
9+
- PASS: Moved legacy SQLite only after successful migration.
10+
- PASS: Archived legacy SQLite under `tmp/local-api/legacy-migrated/`.
11+
- PASS: Did not delete data.
12+
- PASS: Did not use browser storage.
13+
- PASS: Did not introduce MEM DB, local-mem, fake-login, or silent fallback terminology.
14+
- PASS: Preserved Web UI -> API/Service Contract -> Database ownership.
15+
- PASS: Created required reports and ZIP artifact.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# PR_26177_GOLF_036 Validation Lane Report
2+
3+
Impacted lanes:
4+
- Game Journey completion metrics persistence.
5+
- One-time legacy SQLite migration command.
6+
- Postgres duplicate/conflict handling.
7+
- Targeted Game Journey completion metrics Playwright coverage.
8+
9+
Commands:
10+
- PASS: `node --check src/dev-runtime/persistence/game-journey-completion-metrics-migration.mjs`
11+
- PASS: `node --check scripts/migrate-game-journey-completion-metrics-sqlite-to-postgres.mjs`
12+
- PASS: `node --check src/dev-runtime/persistence/game-journey-completion-metrics-store.mjs`
13+
- PASS: `node --test tests/dev-runtime/GameJourneyCompletionMetricsMigration.test.mjs`
14+
- PASS: `node --use-system-ca scripts/migrate-game-journey-completion-metrics-sqlite-to-postgres.mjs --inspect-only`
15+
- PASS: `node --use-system-ca scripts/migrate-game-journey-completion-metrics-sqlite-to-postgres.mjs`
16+
- PASS: `npx playwright test tests/playwright/tools/GameJourneyTool.spec.mjs --grep "completion metrics" --workers=1 --reporter=line`
17+
- PASS: `git diff --check`
18+
19+
Skipped lanes:
20+
- Full samples smoke skipped; not impacted by this scoped migration utility.
21+
- Full Project Workspace suite skipped; targeted Game Journey persistence and Playwright coverage was sufficient.
22+
23+
Result: PASS
Lines changed: 26 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,28 @@
1-
# git diff --name-only pr/26177-CHARLIE-034-startup-runtime-report-cleanup --
2-
assets/theme-v2/css/status.css
3-
assets/theme-v2/css/tables.css
4-
docs_build/dev/reports/PR_26177_CHARLIE_035-system-health-ui-polish.md
5-
docs_build/dev/reports/PR_26177_CHARLIE_035-system-health-ui-polish_branch-validation.md
6-
docs_build/dev/reports/PR_26177_CHARLIE_035-system-health-ui-polish_manual-validation-notes.md
7-
docs_build/dev/reports/PR_26177_CHARLIE_035-system-health-ui-polish_requirements-checklist.md
8-
docs_build/dev/reports/PR_26177_CHARLIE_035-system-health-ui-polish_validation-lane.md
9-
docs_build/dev/reports/codex_changed_files.txt
10-
docs_build/dev/reports/codex_review.diff
11-
docs_build/dev/reports/coverage_changed_js_guardrail.txt
12-
docs_build/dev/reports/playwright_v8_coverage_report.txt
13-
141
# git status --short
15-
M docs_build/dev/reports/PR_26177_CHARLIE_035-system-health-ui-polish.md
16-
M docs_build/dev/reports/codex_review.diff
17-
M docs_build/dev/reports/coverage_changed_js_guardrail.txt
2+
M docs_build/dev/reports/coverage_changed_js_guardrail.txt
3+
M docs_build/dev/reports/playwright_v8_coverage_report.txt
4+
M src/dev-runtime/persistence/game-journey-completion-metrics-store.mjs
5+
?? docs_build/dev/reports/PR_26177_GOLF_036-game-journey-metrics-sqlite-to-postgres-migration.md
6+
?? docs_build/dev/reports/PR_26177_GOLF_036-game-journey-metrics-sqlite-to-postgres-migration_branch-validation.md
7+
?? docs_build/dev/reports/PR_26177_GOLF_036-game-journey-metrics-sqlite-to-postgres-migration_manual-validation-notes.md
8+
?? docs_build/dev/reports/PR_26177_GOLF_036-game-journey-metrics-sqlite-to-postgres-migration_requirements-checklist.md
9+
?? docs_build/dev/reports/PR_26177_GOLF_036-game-journey-metrics-sqlite-to-postgres-migration_validation-lane.md
10+
?? scripts/migrate-game-journey-completion-metrics-sqlite-to-postgres.mjs
11+
?? src/dev-runtime/persistence/game-journey-completion-metrics-migration.mjs
12+
?? tests/dev-runtime/GameJourneyCompletionMetricsMigration.test.mjs
13+
14+
# git ls-files --others --exclude-standard
15+
docs_build/dev/reports/PR_26177_GOLF_036-game-journey-metrics-sqlite-to-postgres-migration.md
16+
docs_build/dev/reports/PR_26177_GOLF_036-game-journey-metrics-sqlite-to-postgres-migration_branch-validation.md
17+
docs_build/dev/reports/PR_26177_GOLF_036-game-journey-metrics-sqlite-to-postgres-migration_manual-validation-notes.md
18+
docs_build/dev/reports/PR_26177_GOLF_036-game-journey-metrics-sqlite-to-postgres-migration_requirements-checklist.md
19+
docs_build/dev/reports/PR_26177_GOLF_036-game-journey-metrics-sqlite-to-postgres-migration_validation-lane.md
20+
scripts/migrate-game-journey-completion-metrics-sqlite-to-postgres.mjs
21+
src/dev-runtime/persistence/game-journey-completion-metrics-migration.mjs
22+
tests/dev-runtime/GameJourneyCompletionMetricsMigration.test.mjs
1823

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

0 commit comments

Comments
 (0)