Skip to content

Fix ranking ingestion, preserve Warden mode, and schedule weekly rollover - #30

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

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

Conversation

@MagicTheDev

Copy link
Copy Markdown
Member

Changes

  • Preserve Warden mode in exact army codes while excluding it from composition/family matching.
  • Fix clan_rankings_current writes to match the existing five-column schema.
  • Treat previousRank=-1 as absent; retain player history when optional clan metadata is incomplete.
  • Skip recognized unavailable local ranking boards without replacing existing data; unrelated/global failures remain errors.
  • Stop routine old-season backfill; skip completed IDs before parsing and isolate unknown formats.
  • Replace player-board Valkey publication with six-hour SQL materialized-view refreshes. No clan-board Valkey publication.
  • Keep the dedicated 20 RPS live Legend I updater; no Legend trophy reset.
  • Add a Monday 16:30–17:00 UTC reset for Unranked through Legend II, gated on successful Monday closeout. Batched 5,000-row transactions persist progress, never repeat after completion, and never catch up outside the window. Refresh boards after completion.

Dependencies and rollout

Requires ClashKingInc/DevKit#26 migration 020. Apply schema, deploy Tracking and verify populated views, then deploy the companion API reader. No production changes, restarts, migrations or merges performed.

Decisions

Routine history discovery uses a 35-day lookback or latest stored completion, whichever is later. Historical repair remains explicit. Missing Monday closeout blocks that week’s reset. Normal profile writers are not coordinated with the reset, as requested.

Validation

  • go test ./... passed.
  • Disposable canonical Timescale integration passed for current clan ranking insert/update, snapshot refresh cadence, closeout gating, 5,000-row reset/resume, excluded leagues, and completed-job idempotency.
  • Unit cases cover Warden mode, previous-rank sentinel, local/global 404 distinction, old seasons and reset-window boundaries.
  • git diff --check passed.

See docs/leaderboards.md and docs/scheduled.md for behavior and rollout details.

@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-17T03:25:44.690603Z 73df2ff PR opened
ℹ️ 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 schema: ClashKingInc/DevKit#26. Companion API reader: ClashKingInc/ClashKingAPI#66. Populate both migration-020 materialized views before deploying the API reader.

@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: 73df2ff71b

ℹ️ 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 thread scripts/scheduled.go
Comment on lines +885 to +886
if !window.EndTime.After(floor) {
continue

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 tagged test for the forward-only cutoff

When script_internal_tests is enabled—as it is by scripts/run-local-e2e.sh—this cutoff removes 2026-04 from the fixture in TestMissingCompletedLegendSeasonsUsesExactOfficialIDs, while that test still requires []string{"2026-04", v2Season}. The repository's local end-to-end command will therefore fail deterministically; update the existing test expectation or fixture to match the new forward-only behavior.

Useful? React with 👍 / 👎.

@MagicTheDev
MagicTheDev merged commit afda1df into main Sep 17, 2026
@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