Pantheon community race leaderboard snapshot (API) - #150
Merged
Conversation
Falls back to the legacy materialized view when the snapshot table is not deployed yet, enabling a phased rollout with no API downtime. Co-authored-by: Cursor <cursoragent@cursor.com>
Barecheck - Code coverage reportTotal: 91.65%Your code coverage diff: 0.13% ▴ Uncovered files and lines
|
2 tasks
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pantheon_custom_race_snapshotinstead of the liveteam_pantheon_custom_race_leaderboardmaterialized view.42P01), so this can deploy safely before or after the DB migration.Rollout (no downtime)
Apply in this order. Each step is safe to pause between.
Step 1 — Prod SQL: create snapshot (before any deploy)
Run the contents of
RaidHub-Services/infrastructure/postgres/migrations/012_pantheon_custom_race_snapshot.sqlon prod.leaderboard.pantheon_custom_race_snapshotand seeds 110 frozen rows.Dry-run after apply:
Step 2 — Deploy this API PR
Smoke test:
Step 3 — Prod SQL: drop legacy MV
Run
RaidHub-Services/infrastructure/postgres/migrations/013_drop_pantheon_custom_race_leaderboard.sql:Safe once step 2 is deployed — API no longer depends on the MV.
Step 4 — Deploy Services PR
pantheon_custom_race_snapshotinstead of the MV.Step 5 — Prod SQL: blacklist cleanup
Dry-run:
Apply:
Removes LB-only manual blacklists for race-window instances not on the frozen standings. Cheat-marked manual blacklists are kept.
Test plan
bun run typecheckbun test src/routes/leaderboard/team/custom.test.ts/leaderboard/team/custom/pantheon-community-raceand a known finisher profile PGCR rank badgeMade with Cursor