Repository navigation
soccer: use core's favourite-team check (2.37.0, requires core 3.6.2) - #571
Merged
Merged
Conversation
Soccer had its own favourite-team diagnostic in manager.py: the one #233 added, which #235 generalised into <sport>_favorite_check.py for the other scoreboards and stage 2 promoted to core as src.common.favorite_team_check. Soccer now uses core's, wired like the other scoreboards (the wiring is the parked claude/sports-stage2-soccer-favcheck-parked branch's, minus its bundled copy: the floor is 3.6.1 since the stage 2 sunset, so manager.py imports `from src.common.favorite_team_check import FavoriteTeamCheck` plainly): - update() calls _check_favorite_teams(registry_snapshot) once. It builds the check lazily over every league in the registry -- a registry key is the league's ESPN code, predefined or custom (_load_custom_leagues keys custom leagues by their normalised league_code; the sanitised safe_key is only for attribute names) -- as {key: (LEAGUE_NAMES name, "soccer/<key>")}, and schedules each enabled league with the favourites of the first of live / recent / upcoming that has any. Any exception is logged at debug and never escapes update(). - on_config_change drops the check instead of reset()ting it as the other scoreboards do: soccer's league list (custom leagues) can change, and the check's league table is fixed when it is built. The next update rebuilds it for the new list, so it reports again. - Deleted from the plugin class, with nothing else using them: the old _check_favorite_teams body, _abbreviates, _suggest_team_code, _fetch_league_teams, _fetch_season_start and _favorites_checked. Behaviour change (log only, approved): the check runs on a daemon thread instead of inside update(); between matchdays a correct code logs the next fixture's date where the old check logged "recognised" (on today's ESPN data: Premier League "nothing on until 10 October 2026"); a finished season with nothing published says so; a wrong code's warning links to the league's ESPN team list instead of TEAMS.md; suggestions also match word fragments. TEAMS.md's tip says what the log now reports. Tests: test_favorite_team_diagnostics.py runs the Premier League cases against the FavoriteTeamCheck manager.py imports, plus the wiring (enabled leagues only, first mode with favourites, custom-league endpoints, a bad registry entry never escaping). scripts/test_timezone_and_favorite_check_copies.py adds soccer to FAVORITE_SUNSET. docs 08 and CLAUDE.md: only ufc is without core's check. Every harness render is byte-identical (24 PNGs; the check only logs). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rounds) Core 3.6.1's favourite check still called the Europa League's season finished between matchdays; 3.6.2 (core #670) fixes it. Soccer is the plugin that meets that case, so it floors on 3.6.2. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 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. Comment |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | -12 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
7 of 8 tasks
ChuckBuilds
added a commit
that referenced
this pull request
Sep 29, 2026
Eight manifests on main carried raw UTF-8 (em dashes, and baseball's up/down arrows): clock-simple, ledmatrix-weather, pomodoro-timer and five scoreboards (baseball, basketball, football, lacrosse, soccer; added in #570/#571). Tools that open manifest.json in the platform default encoding -- cp1252 on Windows: cores before 3.4.0 and the core's scripts/dev_server.py -- garble those bytes, or raise UnicodeDecodeError on characters whose UTF-8 includes a byte cp1252 leaves undefined. Every other manifest already stores such characters as JSON escapes. - Rewrite the eight with a text-level substitution to JSON escape sequences (formatting, key order and line endings unchanged; json.loads before == after), and PATCH-bump each with a new top versions[] entry. plugins.json synced by update_registry.py. - scripts/check_manifests_ascii.py: fails on any raw non-ASCII byte in plugins/*/manifest.json, naming line, column and the escape to write; also flags a BOM or a legacy-encoded byte, and fails if it finds 40 or fewer manifests. - scripts/test_check_manifests_ascii.py: regression suite, which also runs the guard over the real tree so CI's scripts/test_*.py glob enforces it. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Soccer now uses core's
FavoriteTeamCheckfromsrc.common.favorite_team_check, as the other scoreboards do. It replaces soccer's own older check inmanager.py, which the core module grew out of. The owner approved the change in log output. Nothing on the display changes.Changes
manager.pyimports core's check directly (no bundled copy) and wires it like the other scoreboards.soccer/<ESPN code>, custom leagues included.on_config_changerebuilds the check instead of resetting it, because soccer's league list can change._abbreviates,_suggest_team_code,_fetch_league_teams,_fetch_season_start,_favorites_checked). Nothing else used them.versions[]entry, CHANGELOG andplugins.json. The guard now covers soccer. Doc 08, CLAUDE.md and the TEAMS.md tip are updated.What users will see in the log
The check also runs on a background thread now. The old one ran inside
update(), so a league's first update waited on up to two ESPN requests.Verification
All runs are on core v3.6.2.
run_plugin_tests.py soccer-scoreboardgives 38/38, the same set as before.scripts/test_*.pyguard passes, and so docheck_version_bumpandupdate_registry --check.🤖 Generated with Claude Code