Skip to content

feat(sports): cache ESPN scoreboards under core's shared key (needs core 3.8.1) - #620

Draft
ChuckBuilds wants to merge 2 commits into
mainfrom
claude/espn-canonical-scoreboard-keys
Draft

ChuckBuilds wants to merge 2 commits into
mainfrom
claude/espn-canonical-scoreboard-keys

Conversation

@ChuckBuilds

@ChuckBuilds ChuckBuilds commented Oct 4, 2026 •

Copy link
Copy Markdown
Owner

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 after v3.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.

  • odds-ticker: per-day scoreboards go through core's read/store helpers under the canonical key. The old scoreboard_data_* key is still read as a fallback. Days 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 still held to the live interval, now judged 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: the window keys move to the canonical key for the URL, with the old key read as a fallback.
  • Live poll:
    • baseball, football and hockey still ask ESPN on every live poll, but now leave the answer under the shared key (get_espn_scoreboard, max_age=0).
    • basketball and soccer move their 30 s live cache from <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

Versions (each with a new versions[] entry, ledmatrix_min_version: 3.8.1, CHANGELOG, plugins.json)

plugin main this PR
afl-scoreboard 1.35.2 1.36.0
baseball-scoreboard 1.57.2 1.58.0
basketball-scoreboard 1.42.1 1.43.0
football-scoreboard 3.18.7 3.19.0
hockey-scoreboard 1.42.3 1.43.0
nrl-scoreboard 1.34.2 1.35.0
odds-ticker 1.7.7 1.8.0 (no CHANGELOG file)
soccer-scoreboard 2.39.4 2.40.0

Tests (all against a fresh LEDMatrix main clone, a74b5a2f, LEDMATRIX_CORE set; Pillow 12.3.0 before and after)

  • run_plugin_tests.py for all eight plugins, on this branch and on origin/main: identical results.

    • afl 27/0, baseball 53/1, basketball 38/0, football 65/1, hockey 42/0, nrl 22/0, odds-ticker 9/0, soccer 41/0 (passed/failed).
    • The two failures are the same on main: test_baseball_activity.py and the interactive test_football_plugin.py.
  • All 47 scripts/test_*.py: pass, on both trees.

  • Guards:

    • check_version_bump.py --base origin/main with 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_PLUGINS pointed 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.py for the seven scoreboards (main, then branch, then main again) and compared pixels with ImageChops.difference().getbbox(), not PNG hashes.

    • Harness fixtures (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.
    • Live ESPN data (fixtures replaced, frozen at 2026-10-04 18:00 UTC, 128x32 / 192x48 / 128x64): HTTP was recorded once across both arms and replayed to each. 60 PNGs (39 non-blank), 0 differ main→branch, 0 differ main→main.
  • The shared key is used. In the live-data run, the cache writes on this branch were:

    • espn_scoreboard_australian-football_afl_20260920-20261011
    • espn_scoreboard_baseball_mlb_20260920-20261011
    • espn_scoreboard_basketball_nba_20260920-20261011 and espn_scoreboard_basketball_nba_20261004 (the live poll)
    • espn_scoreboard_football_nfl_20260920-20261011
    • espn_scoreboard_hockey_nhl_20260920-20261011
    • espn_scoreboard_rugby-league_3_20260920-20261011
    • espn_scoreboard_soccer_eng.1_20260920-20261018 and espn_scoreboard_soccer_eng.1_20261004 (the live poll)

    On main there were none: only *_schedule_* and *_scoreboard_current.

Merge plan

  1. Merge LEDMatrix #756 and tag v3.8.1.
  2. Re-run CI here.
  3. Squash-merge, and confirm the "Auto-update plugin registry" commit.

🤖 Generated with Claude Code

@ChuckBuilds
ChuckBuilds marked this pull request as draft October 4, 2026 21:09
@coderabbitai

coderabbitai Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity

Metric Results
Complexity 0

View in Codacy

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.

ChuckBuilds and others added 2 commits October 4, 2026 18:57
…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
ChuckBuilds force-pushed the claude/espn-canonical-scoreboard-keys branch from 28dbbef to 774dce3 Compare October 4, 2026 23:00
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