Implement tools/generate-main-readme.sh (currently a no-op stub) - #808
Merged
Conversation
Closes the ROADMAP.md Automation item "Auto-generate topics table in README from directory structure". - Diffs topics/ on disk against README.md's HTML table and appends a row for anything missing. Auto-fills only what's mechanically certain from the filesystem (name, folder link, basics/practice existence); flags official docs link and icon as TODOs for a human rather than guessing them - a wrong guess is worse than a visible gap. Icon lookups against skillicons.dev are verified, not assumed: it silently returns a ~256-byte blank SVG for any unrecognised slug (found the hard way while adding the fluxcd topic), so the script checks response size before using a URL. - `--check` mode exits non-zero without modifying README.md, for CI. - Running it against this repo's actual current state immediately found two real, pre-existing gaps: `backstage` and `ssh` both have complete topic folders with no README.md table row at all. Fixed both rows by hand (real docs links, GitHub-avatar icon for Backstage, a plain book emoji for SSH matching the Architecture topic's precedent for icon-less entries), added the missing `topics/ssh/practice/README.md` so its Practice cell isn't a TODO, and found + fixed the same backstage/ssh gap in mkdocs.yml's nav (topics/index.md's card grid is a curated subset, not a 1:1 mirror, so left that alone). - Adds .github/workflows/check-readme-topics-table.yml (--check mode) so this exact gap can't silently recur on future PRs. - shellcheck clean (fixed one real SC2318 finding along the way - `local a=1 b=$a` doesn't reliably see `a` from the same statement).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Not tied to a labeled issue — found this by reading ROADMAP.md's Automation section ("Auto-generate topics table in README from directory structure") and noticing
tools/generate-main-readme.shis a literal no-op (echo "hehe, to be implemented"), already wired into a daily cron (main.yaml) that currently does nothing useful.Summary
tools/generate-main-readme.sh— diffstopics/on disk against README.md's HTML table and appends a row for anything missing. Deliberately conservative: it auto-fills only what's mechanically certain from the filesystem (display name, folder link, whetherbasics//practice/exist), and leaves the official docs link and icon as visible<!-- TODO -->placeholders rather than guessing — a wrong guessed link is worse than a flagged gap. Icon lookups againstskillicons.devare verified, not assumed: it silently serves a ~256-byte blank SVG for any slug it doesn't recognize (I hit this for real adding thefluxcdtopic), so the script checks response size before using a URL.--checkmode exits non-zero without touching README.md — for CI..github/workflows/check-readme-topics-table.yml— runs--checkon any PR touchingtopics/**orREADME.md, so a topic added without a table row fails the PR instead of silently drifting (which is exactly the mistake the next finding shows already happened twice).backstageandsshare complete topic folders (backstage even hasbasics/+practice/) with zero README.md table row and zeromkdocs.ymlnav entry. Fixed both by hand: real docs links, a GitHub-avatar icon for Backstage (skillicons.dev has none, same as FluxCD/ArgoCD), a plain 📖 for SSH matching the existing icon-less-topic precedent (Architecture), addedtopics/ssh/practice/README.md(the topic had no practice content at all), and added both tomkdocs.yml's nav under "Other Tools". Lefttopics/index.mdalone — it's already a curated subset (41 cards vs 47 topic folders, e.g.virtualboxisn't there either), not a 1:1 mirror, so "complete" doesn't apply there the same way.Test plan
bash tools/generate-main-readme.sh --checkon the now-fixed README —✅ Every topic under topics/ already has a README.md table row.backstage/sshon its very first run, confirmed both gaps are real by grepping README.md directly.shellcheck tools/generate-main-readme.sh— clean (fixed one realSC2318:local a=1 b=$ain one statement doesn't reliably seea's new value — split into separatelocallines).mkdocs build --strict— identical 5 pre-existing warnings asmain(root/topics/README-vs-index.md conflicts, two pre-existing broken image links inargocd/elk), nothing new from this PR'smkdocs.ymlchange.755in this repo already, an unrelated pre-existing quirk) — addedchmod --referencebefore themvso the tool never does that to anyone.