docs: add frontmatter-check tool and wire it into CI - #734
Conversation
e3afca8 to
396277f
Compare
|
Review pass. The tool itself is good. The CI wiring is the problem, and it's the specific failure mode this repo has been bitten by before: a check made blocking while the tree is still dirty. 1. Blocking: this gate will fail PRs that did nothing wrong, and I reproduced it. The changed-files variant narrows which files get checked, but it checks each file's entire frontmatter, not the lines the PR touched. So any PR that edits one of the already-broken pages for an unrelated reason fails on a field the author never went near. Appending one comment line to How often that bites: 15 of the last 57 commits on 2. The step immediately below yours is non-blocking for the same reason. 3. The README claim doesn't match the behavior, and it's the load-bearing one. 4. The regeneration loop will keep reopening this. 91 of the 158 broken pages are under 5. Paths filter is missing the new tool. 6. Unclassified paths are skipped with no output at all. 7. Minor. Numbers, in case they're useful. Current Good work worth noting. The parser is solid: I threw ten edge cases at it (no frontmatter, |
sterlingkoch
left a comment
There was a problem hiding this comment.
See inline comments (most are agent-to-agent comments).
396277f to
b1797b5
Compare
Adds a Go tool that verifies required frontmatter fields per section (title/description/canonical for Talos, title/description for Omni and Kubernetes guides), plus a changed-files variant used as the CI gate so the large legacy backlog doesn't block unrelated PRs. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Signed-off-by: Amarachi Iheanacho <amarachi.iheanacho@siderolabs.com>
b1797b5 to
54bd891
Compare
|
@sterlingkoch 1,2, and 4 are fixed by these prs: https://github.com/siderolabs/docs/pull/735/changes and #733 but i fixed the others |
sterlingkoch
left a comment
There was a problem hiding this comment.
Approving the code, but don't merge this until #733 and #735 are both in. The step at .github/workflows/docs-ci.yaml:43-44 is still blocking with no continue-on-error, so landing it before the backfills would fail PRs that did nothing wrong. Measured with this PR's own tool:
maintoday: 159 issues over 1706 filesmain+ #733: 45main+ #733 + #735: 2, and both arepublic/omni/_ci-test.mdx, which this PR deletes
So the tree hits 0 exactly when this one goes in last. Order is #733, then #735, then this.
The code changes are all good: README wording at tools/frontmatter-check/README.md:71 is accurate now, tools/frontmatter-check/** is in the paths filter, classUnknown plus the "Skipped N exempt file(s)" line closes the silent-skip gap, _ci-test.mdx is gone, and go-version-file kills the second toolchain download.
Two things about #735 that gate it, both new since yesterday. Eleven files have raw conflict markers committed at lines 3, 5 and 8 (the nine learn-more pages and four opennebula.mdx). And #733 and #735 now conflict with each other on 62 files, which wasn't true when I looked yesterday: #733 writes the v1.14 canonical, #735 writes v1.13, same line. Every one resolves by taking #733's side, which is another argument for dropping the canonical half of #735 and keeping just the descriptions.
Worth knowing as evidence for this PR: docs-checks is currently green on #735 with those 11 broken-YAML files in it. Nothing in CI parses frontmatter today and the style check is continue-on-error, so invalid frontmatter merges silently. That's the gap this closes.
What
Adds a
frontmatter-checktool that verifies pages carry the frontmatter fields their section requires, and wires a changed-files variant into CI.Why
Talos pages need a
canonicalURL and all pages needtitle/description, but nothing enforced this — pages could ship missing them silently.Change
tools/frontmatter-check: checkstitle+description+canonicalon Talos pages,title+descriptionon Omni and Kubernetes guides pages.check-frontmatter(full scan, for local audits) andcheck-frontmatter-changed(diffs against a base ref, mirrorsstyle-check-changed).docs-ci.yamlnow runscheck-frontmatter-changedas a blocking gateTesting
make check-frontmatter(full scan, confirms 159 pre-existing issues, none new),make check-frontmatter-changed(confirmed it flags a scratch file with missing fields and passes with none changed),gofmt -l/go veton the new tool