Skip to content

CC-63: Average Ranking Factors Divided by Wrong Round Count#331

Merged
ianpaschal merged 4 commits into
mainfrom
ian/cc-63-average-ranking-factors-divided-by-wrong-round-count
May 15, 2026
Merged

CC-63: Average Ranking Factors Divided by Wrong Round Count#331
ianpaschal merged 4 commits into
mainfrom
ian/cc-63-average-ranking-factors-divided-by-wrong-round-count

Conversation

@ianpaschal
Copy link
Copy Markdown
Owner

@ianpaschal ianpaschal commented May 15, 2026

Resolves CC-63

Summary by CodeRabbit

  • Improvements

    • Tournament ranking calculations now use a corrected rounds-played value for more accurate rankings.
    • Tournament results automatically refresh when ranking factors change, keeping rankings synchronized.
  • Chores

    • Migration and refresh process updated to iterate and refresh existing tournament result records directly.

Review Change Stack

@vercel
Copy link
Copy Markdown

vercel Bot commented May 15, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
combat-command Ready Ready Preview, Comment May 15, 2026 6:28am

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 15, 2026

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 34d61a73-0573-455b-a8ae-cb84b2ad2614

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • ✅ Review completed - (🔄 Check again to review again)

Walkthrough

This PR refactors tournament ranking factor refresh mechanics. It updates aggregateTournamentData to compute ranking factors using roundsPlayed = round + 1 for both registration and competitor-level calculations. A new refreshTournamentResults trigger is introduced that watches for rankingFactors changes on tournaments and refreshes all associated tournament results via deep-equality checks, excluding archived tournaments. The trigger is wired into the function registry, and the migration strategy shifts from iterating computed rounds for archived tournaments to querying and refreshing all existing tournament result documents.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main bug being fixed: ranking factors were being divided by the wrong round count.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ian/cc-63-average-ranking-factors-divided-by-wrong-round-count

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ianpaschal ianpaschal merged commit 4db2b35 into main May 15, 2026
3 checks passed
@ianpaschal ianpaschal deleted the ian/cc-63-average-ranking-factors-divided-by-wrong-round-count branch May 15, 2026 09:11
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