Skip to content

Tournament Match Integration#666

Merged
brewmarsh merged 2 commits intomainfrom
tournament-match-integration-9565725900535790803
Feb 4, 2026
Merged

Tournament Match Integration#666
brewmarsh merged 2 commits intomainfrom
tournament-match-integration-9565725900535790803

Conversation

@brewmarsh
Copy link
Copy Markdown
Owner

Linked matches to tournaments by adding a tournamentId field to the matches collection. Updated the Match Recording UI to automatically pre-fill tournament context and restrict player selection to tournament participants when accessed from a tournament page. Modified the User Dashboard to display a '🏆 [Tournament Name]' badge next to the score for matches associated with a tournament. Added hidden fields to the match form to ensure reliable data persistence.

Fixes #660


PR created automatically by Jules for task 9565725900535790803 started by @brewmarsh

- Update Match model to include optional `tournamentId` field.
- Update `MatchForm` to include `tournament_id` and `group_id` hidden fields.
- Restrict player selection to tournament participants when recording a match from a tournament context.
- Pre-fill tournament information in the Match Recording UI.
- Enrich dashboard match history with tournament names and display a tournament badge.
- Add styling for the tournament badge.
- Add comprehensive unit tests for the integration.

Co-authored-by: brewmarsh <12343321+brewmarsh@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 4, 2026

Agent Scorecard Report

Target Agent Profile: Standard Agent Readiness checks (ACL & Type Safety)
Overall Score: 85.0/100 - PASS

Status: PASSED - This codebase is Agent-Ready.

🎯 Top Refactoring Targets (Agent Cognitive Load (ACL))

ACL = Complexity + (Lines of Code / 20). Target: ACL <= 10.

Function File ACL Status
record_match pickaladder/match/routes.py 34.8 🔴 Red
_get_candidate_player_ids pickaladder/match/routes.py 18.9 🟡 Yellow
get_latest_matches pickaladder/match/routes.py 17.4 🟡 Yellow
get_player_record pickaladder/match/routes.py 16.8 🟡 Yellow
format_matches_for_dashboard pickaladder/user/utils.py 16.3 🟡 Yellow
_save_match_data pickaladder/match/routes.py 14.8 🟡 Yellow
view_match_page pickaladder/match/routes.py 14.4 🟡 Yellow
calculate_stats pickaladder/user/utils.py 10.7 🟡 Yellow
_fetch_match_entities pickaladder/user/utils.py 10.6 🟡 Yellow

🛡️ Type Safety Index

Target: >90% of functions must have explicit type signatures.

File Type Safety Index Status
pickaladder/match/forms.py 0%
pickaladder/user/utils.py 100%
pickaladder/match/routes.py 100%
tests/test_tournament_match_integration.py 100%

🤖 Agent Prompts for Remediation

File: pickaladder/match/forms.py

  • Type Safety: Coverage is 0%. Prompt: 'Add explicit type signatures to all functions in pickaladder/match/forms.py to meet the 90% Type Safety Index requirement.'

File: pickaladder/match/routes.py

  • Critical ACL: Functions record_match have Red ACL (>20). Prompt: 'Refactor functions in pickaladder/match/routes.py with high cognitive load to bring ACL below 10. Split complex logic and reduce function length.'

📂 Full File Analysis

File Score Issues
pickaladder/user/utils.py 85 ✅ 3 Yellow ACL functions (-15)
pickaladder/match/forms.py 80 ✅ Type Safety Index 0% < 90% (-20)
pickaladder/match/routes.py 60 ❌ 1 Red ACL functions (-15), 5 Yellow ACL functions (-25)
tests/test_tournament_match_integration.py 100 ✅

Generated by Agent-Scorecard

- Update Match model to include optional `tournamentId` field.
- Update `MatchForm` to include `tournament_id` and `group_id` hidden fields for data persistence.
- Restrict player selection to tournament participants when recording a match from a tournament context.
- Pre-fill tournament information in the Match Recording UI.
- Enrich dashboard match history with tournament names and display a tournament badge.
- Add styling for the tournament badge.
- Fix linting, formatting, and type safety issues (Ruff/Mypy).
- Add comprehensive unit tests for the integration.

Co-authored-by: brewmarsh <12343321+brewmarsh@users.noreply.github.com>
@brewmarsh brewmarsh merged commit 6196ae9 into main Feb 4, 2026
10 checks passed
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.

Tournament Match Integration

1 participant