feat(sports): cache ESPN scoreboards under core's shared key (needs core 3.8.1) - #620
Draft
ChuckBuilds wants to merge 2 commits into
Draft
ChuckBuilds wants to merge 2 commits into
ChuckBuilds wants to merge 2 commits into
Conversation
ChuckBuilds
marked this pull request as draft
October 4, 2026 21:09
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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 | 0 |
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.
…ervice stage 2) Needs the LEDMatrix core release that ships fetch service stage 2 (ChuckBuilds/LEDMatrix#728: espn_scoreboard_cache_key, get_espn_scoreboard, SportsFetchMixin._schedule_cache_key / _cached_schedule). That is 3.8.1. - odds-ticker: per-day scoreboards go through core's read/store helpers under espn_scoreboard_cache_key, with scoreboard_data_* read as a fallback, and are fetched with fetch_espn_scoreboard (limit=500, the identifying session, the fetch service) instead of a bare requests.get. A day holding a live game is held to the live interval by the entry's own age. - baseball, basketball, football, hockey: the nine schedule-window managers use SportsFetchMixin._schedule_cache_key / _cached_schedule, with the old {sport_key}_schedule_{window} key read as a fallback. - afl, nrl, soccer: their window keys move to the canonical key for the URL, the old key read as a fallback. Soccer keeps 2.39.3's single fetch under the per-key window lock; _cached_window now reads through _cached_schedule. - The live poll shares today's scoreboard with odds-ticker: baseball, football and hockey still ask ESPN on every live poll but leave the answer under core's shared key (get_espn_scoreboard, max_age=0); basketball and soccer move their 30 s live cache from <sport_key>_scoreboard_current to the shared key for the dates asked, the old key read for a release. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…or 3.8.1) afl 1.36.0, baseball 1.58.0, basketball 1.43.0, football 3.19.0, hockey 1.43.0, nrl 1.35.0, odds-ticker 1.8.0, soccer 2.40.0, each with a versions[] entry floored on core 3.8.1 (the first release with ChuckBuilds/LEDMatrix#728), CHANGELOG entries and plugins.json. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ChuckBuilds
force-pushed
the
claude/espn-canonical-scoreboard-keys
branch
from
October 4, 2026 23:00
28dbbef to
774dce3
Compare
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.
Waiting for core 3.8.1
Do not merge until LEDMatrix v3.8.1 is tagged. Every touched plugin now requires core 3.8.1 (
ledmatrix_min_version). That is the first release that contains ChuckBuilds/LEDMatrix#728 (fetch service stage 2): #728 is one of the 46 commits afterv3.8.0, and ChuckBuilds/LEDMatrix#756 ("prepare the 3.8.1 release") is still open. This branch was first floored on an assumed "3.9.0"; 3.8.1 is the release that actually ships #728.What it does
Moves odds-ticker and the scoreboards onto core's shared ESPN scoreboard cache key (
espn_scoreboard_cache_key). A plugin showing a league and odds-ticker now read and write the same cached copy instead of each fetching it.scoreboard_data_*key is still read as a fallback. Days are fetched withfetch_espn_scoreboard(limit=500, the identifying session, the fetch service) instead of a barerequests.get. A day holding a live game is still held to the live interval, now judged by the entry's own age.SportsFetchMixin._schedule_cache_key/_cached_schedule, with the old{sport_key}_schedule_{window}key read as a fallback.get_espn_scoreboard,max_age=0).<sport_key>_scoreboard_current(whatever the dates) to the shared key for the dates asked. The old key is read for one release.Rebased onto main
_cached_window(cache_key, (legacy_key,))now reads through_cached_schedule, as fix(soccer-scoreboard): fetch a league's schedule window once per miss (2.39.3) #615's overlap note describes.espn_dates. Window fetches still go through core's_fetch_season_directly→fetch_espn_date_chunks, and odds-ticker's single-day requests go throughfetch_espn_scoreboard, so #751's behaviour applies unchanged.Versions (each with a new
versions[]entry,ledmatrix_min_version: 3.8.1, CHANGELOG, plugins.json)Tests (all against a fresh LEDMatrix main clone,
a74b5a2f,LEDMATRIX_COREset; Pillow 12.3.0 before and after)run_plugin_tests.pyfor all eight plugins, on this branch and onorigin/main: identical results.test_baseball_activity.pyand the interactivetest_football_plugin.py.All 47
scripts/test_*.py: pass, on both trees.Guards:
check_version_bump.py --base origin/mainwith the eight ids: PASS.check_manifest_version_fields,check_min_core_version,check_core_api_signatures,check_sports_helpers_parity,check_module_collisions,check_sports_drift,check_manifests_ascii: all OK.update_registry.py --check: PASS.Core parity tests with
LEDMATRIX_PLUGINSpointed at this branch (test_sports_stage3_parity,test_sports_stage4_parity,test_sports_fetch,test_espn_scoreboard_cache,test_sports_drift_report): 169 passed, 0 skipped. Same result against main.No rendering change. I ran core's
check_plugin.pyfor the seven scoreboards (main, then branch, then main again) and compared pixels withImageChops.difference().getbbox(), not PNG hashes.test/harness.json, all sizes): 160 PNGs, 0 differ, both main→branch and main→main. Goldens all pass. The fixtures seed the old keys, so this also checks the legacy-key fallback.The shared key is used. In the live-data run, the cache writes on this branch were:
espn_scoreboard_australian-football_afl_20260920-20261011espn_scoreboard_baseball_mlb_20260920-20261011espn_scoreboard_basketball_nba_20260920-20261011andespn_scoreboard_basketball_nba_20261004(the live poll)espn_scoreboard_football_nfl_20260920-20261011espn_scoreboard_hockey_nhl_20260920-20261011espn_scoreboard_rugby-league_3_20260920-20261011espn_scoreboard_soccer_eng.1_20260920-20261018andespn_scoreboard_soccer_eng.1_20261004(the live poll)On main there were none: only
*_schedule_*and*_scoreboard_current.Merge plan
v3.8.1.🤖 Generated with Claude Code