It turns out that the Hub description length limit is 25k *bytes*, not characters. We've gotten lucky that our few unicode glyphs have landed so far such that we've never run into a problem with this before now, but we're currently hitting this while trying to push the `amd64/nextcloud` description in that the trimmed version ends up being exactly 25,003 bytes thanks to the unicode glyphs throwing off our trimming calculations (and getting really [un]lucky with the exact positioning of the markdown such that our trimming doesn't walk back far enough).
This fixes that by calculating and trimming based on bytes, accounting for cases of unicode glyphs directly spanning the 25k byte boundary.
After applying this fix, the same breaking `amd64/nextcloud` trimmed description is 24,725 bytes instead.
* Add repo metadata, start with categories!
scripts for checking repo categories, updating the canonical set
added categories to push.pl
* Add initial set of semi-acurate categories
* Adjustments following tianon's review
* Simplify metadata.sh use cases (CI or interactive); just diff and check all the time
Update README.md about metadata.sh usage
* Unify the categories checks into one jq expressions
* Update initial categories
* Link to Docker docs for categories; minor categories script adjustments
This has to be slightly more clever than the warning at the beginning to try and avoid weird markdown rendering (so it looks reasonably clean) but it isn't *too* horrible.
Instead of cutting off the end of the image documentation, this change makes the code prefer to trim the entire "Supported tags" list, which for all our images which currently go over the limit brings them down enough to be within. The note about where to get the full `README.md` file (with the "Supported tags" list intact) still stands, although could maybe do with some better styling and/or wording to make it more obvious (TBD).
I also verified that this change does the right thing in the fallback case by making the `postgres` image description intentionally extra long and verified that it simply trims the description content as before (since taking off the tags doesn't make the description short enough to be under the limit in that case).
This is inspired by Gentoo's `dispatch-conf`, which I've got configured to use `vimdiff` on all my Gentoo boxen, and it's just about the greatest thing ever.
This has a nasty little `monkey_patch` to Mojo's `CookieJar` that needs more digging to figure out what's going on there, but otherwise it's pretty solid.