feat(board): the board art ships beside the files that name it - #952
feat(board): the board art ships beside the files that name it#952ExtraToast wants to merge 1 commit into
Conversation
|
Closing in favour of #955 and #954, which split this branch's two concerns. The art duplicates #929, which was already in flight when this branch was built and is now open as #955. The two sets are 26 and 27 files with no overlapping paths — this branch nests them ( The CodeQL fix is not lost. It is on #954 as its own commit, with an identical patch-id to this branch's, and nothing else attached to it. That keeps a one-line correctness fix from waiting on 3 MB of pictures to be reviewed. Two things from this branch worth carrying, and both are recorded rather than discarded: the naming rule (a row's master is its own No work is wasted that was not already being done twice — my fault for letting two agents reach the same files. |
Follow-up to #949, which landed the board seed. Two things it left behind.
The board art ships beside the files that name it
db/seed/boards/art/— the twenty-six board photographs and portraits the site draws, as WebP masters, with aCREDITS.mdbeside them. This mirrorsdb/seed/esports/art/, which is where the esports history keeps its own.One rule locates a picture: the master for a row is that row's own
imagewith.webpfor an extension. A board whoseimageisboard9/board9.jpgis drawn byart/board9/board9.webp; a seat whoseimageisboard6/roos.jpgbyart/board6/roos.webp. No lookup table, no second column, and nothing to fall out of step — which is why the directory structure is kept rather than flattened the way the esports art is.Conversion, matching the esports pipeline: fitted so neither side exceeds 2560, aspect ratio untouched, nothing upscaled, then
cwebp -q 82 -m 6. Nothing else changed.The sixth board's portraits come from the
*BIG.jpgcopies sitting beside the ones the page loads — three to four times the resolution, 3803x5705 at the largest — so the masters are the best originals available rather than the thumbnails. Everything else was already at or under the cap and is untouched in size.3.0 MB in total, against the 36 MB the frontend's asset directories hold. Those directories stay until #935; this is the groundwork for #929, which is what actually stores these on start-up. Nothing reads the directory yet.
Two tests keep it honest, both pure and both cheap:
CREDITS.mdalso records what is still wanted — a group photograph for boards 1 to 4, portraits for board 5, anything at all for the tenth board, and whether the two unreferenced images in the frontend's assets (wholeboardBIG.jpg,casual7thBoardPic.jpg) belong to a board.The CodeQL warning on the seed
CodeQL flagged
java/constant-comparison— "Test is always false" — onif (attached > 0)inR__Boards_seed.migrate.It was right about the shape, if not the outcome.
attached,writtenandskippedwerevars tallied inside aforEach, so Kotlin boxes each into aRef.IntRefand the lambda writes to the field rather than the local. Read from the bytecode,attachedis a localintinitialised to 0 and never assigned inmigrateat all — hence "always false". At runtime it worked; static analysis could not see that, and neither can a reader who has to hold the boxing in their head.Fixed by counting from what came back instead of tallying as it goes:
Same numbers, no mutable state crossing a lambda boundary, and the outcome of every seat is in one place. The
whenthat dispatched on the three outcomes goes with it.Tests
Run locally, exit codes checked. The integration suite ran against a throwaway MariaDB 10.11.10 container on port 3309 with
blueshell-testcreated fromservices/api/0_init.sqland CI's ownMYSQL_*env../gradlew :services:api:compileKotlin :services:api:compileTestKotlin :services:api:compileIntegrationTestKotlin./gradlew :services:api:test./gradlew :services:api:integrationTest(full suite)The frontend is untouched.
Diff breakdown —
█added░removed, scaled to the largest row.