Skip to content

Exclude unplayed 0:0 matches from round-robin standings#1664

Draft
Copilot wants to merge 2 commits intomasterfrom
copilot/fix-unplayed-matches-counts
Draft

Exclude unplayed 0:0 matches from round-robin standings#1664
Copilot wants to merge 2 commits intomasterfrom
copilot/fix-unplayed-matches-counts

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 16, 2026

Fresh round-robin tournaments currently show every assigned-but-unplayed match as a 0:0 draw, inflating draws/points and making standings misleading until all games are completed. This change treats default 0:0 as “no result yet” for ranking/statistics calculation.

  • Ranking calculation update

    • Added a match-result guard in backend ranking logic.
    • determine_ranking_for_stage_item(...) now excludes definitive matches that still have default 0-0 scores.
  • Behavioral effect

    • Unplayed scheduled matches no longer contribute to wins/draws/losses/points in standings.
    • Played matches with non-default scores continue to be counted as before.
  • Focused unit coverage

    • Added a round-robin unit test that includes one unplayed 0-0 match and one played match, asserting only the played match affects team statistics.
def match_has_result(match: MatchWithDetailsDefinitive) -> bool:
    return not (match.stage_item_input1_score == 0 and match.stage_item_input2_score == 0)

matches = [
    match
    for round_ in stage_item.rounds
    if not round_.is_draft
    for match in round_.matches
    if isinstance(match, MatchWithDetailsDefinitive)
    if match_has_result(match)
]

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • 127.0.0.11
    • Triggering command: REDACTED, pid is -1 (packet block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI linked an issue Apr 16, 2026 that may be closed by this pull request
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Apr 16, 2026

Deploying bracket-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: b7b2716
Status: ✅  Deploy successful!
Preview URL: https://c0fc8397.bracket-docs.pages.dev
Branch Preview URL: https://copilot-fix-unplayed-matches.bracket-docs.pages.dev

View logs

@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying bracket-frontend with  Cloudflare Pages  Cloudflare Pages

Latest commit: b7b2716
Status: ✅  Deploy successful!
Preview URL: https://ccf51f6e.bracket-abd.pages.dev
Branch Preview URL: https://copilot-fix-unplayed-matches.bracket-abd.pages.dev

View logs

Copilot AI changed the title [WIP] Fix unplayed matches showing as draw in standings Exclude unplayed 0:0 matches from round-robin standings Apr 16, 2026
Copilot AI requested a review from evroon April 16, 2026 20:46
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.

Unplayed matches are counted as 0:0 / draw

2 participants