Fix broken DiscoLike sponsor logo on the website - #6253
Conversation
The logo URLs are derived from the sponsor keys in github_stats.json, but the files were still named "Discolike.*.webp" while the key had been lowercased to "discolike". The mismatch 404s on the Linux server and is invisible on macOS, where the filesystem is case-insensitive. Rename the files to match the key, and add a test that compares the sponsor keys against a directory listing so a future mismatch fails on any platform. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
falkoschindler
left a comment
There was a problem hiding this comment.
Thanks for tracking this down so thoroughly — the case-sensitivity analysis and the verification on a case-sensitive filesystem made this easy to trust.
One restructuring before merging: I moved the logo check from tests/test_sponsors_section.py into fetch_github_stats.py (dd4446e). We like to keep the pytest suite focused on the library itself, so website concerns don't really belong there. The fetch script is also the more natural checkpoint: it runs exactly when the sponsor list changes, and it now fails loudly before writing github_stats.json if a special key has no matching logo. Your directory-listing trick survives the move — since iterdir() returns the names as stored on disk, the check catches a case mismatch even on the case-insensitive macOS machine the script runs on.
|
Agreed — better placement, and I confirmed it still catches the bug. Verified your version both ways, plus one residual worth knowingRan the assert block from === with the fix (current branch) ===
guard PASSED
=== with the fix reverted ===
AssertionError: Logo for special sponsor "discolike" is missing in website/static/sponsors
=== restored ===
guard PASSEDMoving it out of Residual, entirely your call: the check now runs only when the script is run with a token, so it never runs in CI. The original mismatch was introduced by a hand-edit of the sponsor key (the script preserves |
Posted by Claude Code on evnchn's behalf.
The DiscoLike logo is currently broken on nicegui.io — its two
.webpfiles are still namedDiscolike.*while the sponsor key was lowercased todiscolike, so the URL the website builds 404s on the Linux server.It renders fine on macOS, which is why it slipped through: the filesystem there is case-insensitive.
Motivation
website/components/sponsors_section.pyderives the logo URL from the sponsor key ingithub_stats.json:Commit 24a10a1 lowercased that key from
Discoliketodiscolike(matching the real GitHub login), but the two image files kept their original capitalization. The site therefore requests a path that does not exist:/static/sponsors/discolike.light.webp/static/sponsors/discolike.dark.webp/static/sponsors/Discolike.light.webp/static/sponsors/lechler-gmbh.light.webpConfirmed against the live site (commands + output)
The deployed homepage really does request the lowercase paths:
Only DiscoLike is affected;
lechler-gmbhmatches its key and is fine.Implementation
Rename the files to match the key —
Discolike.{dark,light}.webp→discolike.{dark,light}.webp.The rename goes in this direction rather than restoring the capitalized key because
fetch_github_stats.pyuses these keys for a case-sensitive exclusion, so that a special sponsor is not also rendered as a top sponsor:The real GitHub login is lowercase (
api.github.com/users/discolikereturns"login": "discolike"), so the lowercased key is correct and the filenames should follow it.Plus a guard, since this class of bug is invisible on macOS.
fetch_github_stats.pynow asserts that everyspecialsponsor key has a matching logo file, comparing against a directory listing ofwebsite/static/sponsorsrather than usingPath.exists()— the latter is case-insensitive on macOS and would have happily reported the old files as present. (iterdir()returns the names as stored on disk and macOS is case-preserving, so the exact string comparison catches a mismatch even on the machine the script runs on.) It mirrors both branches insponsors_section.py(single{sponsor}.webp, or the themed light/dark pair), so the script fails loudly before writinggithub_stats.jsonif a key and its files drift apart again. The check lives in the fetch script rather than a pytest so the library test suite stays free of website concerns.Verified on a case-sensitive filesystem and through the real static route
macOS cannot tell the two states apart, so the before/after was also run on Linux (files copied onto a container's own overlayfs, so the host's case-insensitivity could not leak in):
And booting
main.pyfrom this branch, through NiceGUI's actual/staticmount:Checked and ruled out
README.mdmentions DiscoLike, and it uses the GitHub avatar URL (https://github.com/discolike.png), not this directory. Unaffected.lechler-gmbhmatches its key.testmu-ai.{dark,light}.webpare orphaned (that sponsor left the list in 44cc19e, back when it lived insponsors.json); left untouched here as it is out of scope, happy to remove them in a follow-up if you would like.git mv, and the diff shows both files as pure renames (Bin/ no content change).Progress