Skip to content

test: guard the scroll/Vegas card, without depending on logo assets - #404

Merged
ChuckBuilds merged 3 commits into
mainfrom
test/scroll-card-guard
Sep 3, 2026
Merged

test: guard the scroll/Vegas card, without depending on logo assets#404
ChuckBuilds merged 3 commits into
mainfrom
test/scroll-card-guard

Conversation

@ChuckBuilds

Copy link
Copy Markdown
Owner

Re-lands the guard I pulled from #359, rebuilt so it cannot fail on inputs that aren't the plugin's rendering.

Why the guard exists

check_plugin.py drives every scoreboard in switch mode, so its renders come from the full-screen scorebug in sports.py. game_renderer.py — the scroll/Vegas card renderer — is imported but never called. Replacing render_game_card, _draw_upcoming_center, _center_gap_width and _logo_slot_width with functions that raise leaves all 16 of hockey's harness renders passing and byte-identical.

A harness.json variant setting *_display_mode: "scroll" doesn't help either — those renders come out identical to the switch ones.

That gap is not theoretical: three consolidation PRs were each verified as "byte-identical across 176 renders" while not one of those renders touched the file being changed.

Why the first attempt failed CI

It rendered with real logos loaded from the core checkout, and 21 of its 72 goldens differed in CI on the same Pillow 12.3.0. The logo files themselves vary between checkouts — main recently dropped case-colliding duplicate league logos — so the goldens encoded one machine's asset set rather than the plugin's rendering.

The fix

Cards are drawn without logos, leaving the repo's own fonts as the only input. The geometry is still covered: _center_gap_width and _logo_slot_width are computed to lay the card out whether or not a logo is painted.

clean tree 72/72 pass, twice in a row
centre gap widened 2px in the core mixin 24 of 72 fail

Two deliberate details

  • It asserts the card count, not just the mismatch count. A comparison whose inputs quietly went missing reports zero differences and reads as a pass — that exact failure produced a green identical: 24, differing: 0 earlier in this work against a baseline that had never rendered, and again a 0/0 when a worktree failed to create.
  • It chdir()s to the core, because the plugins' default logo_dir values are relative and resolve only from there.

Picks up the existing scripts/test_*.py convention, so CI discovers it with no workflow change. No plugin code changes.

Re-lands the guard pulled from #359, rebuilt so it cannot fail on inputs that
are not the plugin's rendering.

Why it exists: check_plugin.py drives every scoreboard in `switch` mode, so its
renders come from the full-screen scorebug in sports.py. game_renderer.py --
the scroll/Vegas card renderer -- is imported but never called. Replacing
render_game_card, _draw_upcoming_center, _center_gap_width and
_logo_slot_width with functions that raise leaves all 16 of hockey's harness
renders passing and byte-identical. A harness.json variant setting
`*_display_mode: "scroll"` does not help either: those renders come out
identical to the switch ones.

Why the first attempt failed: it rendered with real logos loaded from the core
checkout, and 21 of its 72 goldens differed in CI on the *same* Pillow 12.3.0.
The logo files themselves vary between checkouts -- main recently dropped
case-colliding duplicate league logos -- so the goldens encoded one machine's
asset set rather than the plugin's rendering.

The cards are now drawn without logos, leaving the repo's own fonts as the only
input. The geometry is still covered: _center_gap_width and _logo_slot_width
are computed to lay the card out whether or not a logo is painted.

Verified it still bites: widening the centre gap by 2px in the core mixin fails
24 of the 72 cards; on the clean tree all 72 pass, twice in a row.

Two details kept from the first version, both deliberate: it asserts the card
COUNT rather than only the mismatch count, because a comparison whose inputs
quietly went missing reports zero differences and reads as a pass; and it
chdir()s to the core, because the plugins' default logo_dir values are relative
and resolve only from there.
@coderabbitai

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 9db3e57b-dd2b-4f3e-a94a-04638ed96f32


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 26 complexity

Metric Results
Complexity 26

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.

Down from 21 CI mismatches to 3, all of them baseball's upcoming card -- the
only card in the set that draws a clock time.

The config set no timezone, so the time rendered in the machine's local zone:
America/New_York where the goldens were generated, UTC on the runner. The
goldens encoded where they were made rather than what the plugin draws.

Pinned to "Etc/UTC", not "UTC": the plugins treat a bare "UTC" as a leftover
from an old config write-back bug and override it with the system zone, which
would have left the same problem in place while looking fixed.

Verified the way the previous attempt was not -- by rendering under other
zones rather than hoping CI agrees. The goldens match under TZ=UTC and
TZ=America/Los_Angeles as well as locally, and widening the centre gap by 2px
still fails 24 of the 72 cards.

Also merges main for #403, whose x-propertyOrder fix this branch predated; the
property-order guard passes again.
@ChuckBuilds
ChuckBuilds merged commit f11b0af into main Sep 3, 2026
4 checks passed
@ChuckBuilds
ChuckBuilds deleted the test/scroll-card-guard branch September 3, 2026 18:15
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.

2 participants