Skip to content

Add SQL player leaderboard snapshots and weekly-job checkpoints - #26

Merged
MagicTheDev merged 3 commits into
mainfrom
fix/ranking-ingestion-rollover
Sep 17, 2026
Merged

MagicTheDev merged 3 commits into
mainfrom
fix/ranking-ingestion-rollover

Conversation

@MagicTheDev

Copy link
Copy Markdown
Member

Changes

  • Add forward Goose migration 020: top-500 Town Hall and ranked-league materialized views, plus durable scheduled-job checkpoints.
  • Preserve all existing player and historical tables; migration does not reset trophies or populate views.
  • Document Warden mode as preserved share-code data, excluded from family matching.

Rollout

Apply 020, deploy the companion Tracking branch to populate both views, verify ispopulated, then deploy the companion API reader. No production changes or merges performed.

Validation

  • Schema-owned disposable Timescale: Goose 001–020 and snapshot ordering/cap/refresh integration test passed.
  • All 14 fixture harness tests passed.
  • git diff --check passed.

See database/PLAYER_LEADERBOARD_ROLLOUT.md for fields, examples, access requirements and rollback order.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 17, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-17T04:30:17.532161Z 899b62f New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@MagicTheDev

Copy link
Copy Markdown
Member Author

Companion PRs: ClashKingInc/ClashKingTracking#30 and ClashKingInc/ClashKingAPI#66. Rollout order: migration 020 → Tracking initial population → API reader. All are non-draft; no merges or production operations performed.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7a769896ee

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@@ -0,0 +1,38 @@
-- +goose Up

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Update the explicit migration inventory for 020

Adding this migration makes TestTimescaleMigrationsAreExplicitlyNumbered in database/migrations/war_archive_schema_test.go fail: its glob now finds 20 SQL files, while the unchanged want slice still ends at 019_unlimited_personal_bases.sql and requires equal lengths. Add 020_player_leaderboard_snapshots.sql to that inventory so the repository's required go test ./... validation can pass.

Useful? React with 👍 / 👎.

@MagicTheDev

Copy link
Copy Markdown
Member Author

Base-storage correction added in 899b62f: forward migration 021 moves images and votes onto bases, preserving positions, voter identities, directions and timestamps. Downloads remain unchanged. The old base_images/base_votes tables are removed. IMPORTANT: unlike additive 020, 021 requires draining old base traffic and deploying paired API PR #66 before resuming it. See database/INLINE_BASE_STORAGE.md. Populated 018→021 upgrade, full disposable-database Go tests and harness tests passed. No production changes performed.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 899b62f64b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +49 to +50
DROP TABLE public.base_images;
DROP TABLE public.base_votes;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Update the existing operational contract for inline base data

When migration 021 is applied, these tables no longer exist, but docs/final-operational-contract.md still directs API implementers to store and stage data through base_images and base_votes (including its first-click flow), and database/timescale/README.md still presents migration 019 as the latest contract. Update those established contract documents or clearly mark them as superseded; otherwise downstream work following them will issue queries against tables this migration drops.

Useful? React with 👍 / 👎.

@MagicTheDev
MagicTheDev merged commit e2fa8ce into main Sep 17, 2026
2 checks passed
@MagicTheDev
MagicTheDev deleted the fix/ranking-ingestion-rollover branch September 17, 2026 05:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant