test: cover the blog/ frontmatter contract (tests/blog-frontmatter.test.mjs) - #270
Open
kubestellar-hive[bot] wants to merge 1 commit into
Open
kubestellar-hive[bot] wants to merge 1 commit into
kubestellar-hive[bot] wants to merge 1 commit into
Conversation
Adds tests/blog-frontmatter.test.mjs, asserting that every blog post's authors: and tags: keys resolve in blog/authors.yml and blog/tags.yml, that slugs are present, unique and match the filename, that each post carries a truncate marker, and that the authors/tags entries themselves carry the fields the blog renders. Docusaurus fails the build outright on an unresolved author or tag key, and npm run check never resolves frontmatter keys, so a typo first surfaced at deploy time. Parsing uses the yaml devDependency already present and already used by scripts/collect-metrics.mjs. Signed-off-by: kubestellar-hive[bot] <kubestellar-hive@hive.kubestellar.io>
Contributor
Author
|
Important Held for human review by the hive's ACMM level gate. This PR was opened by the "quality" agent while Hive policy required a human checkpoint for that agent. Non-outreach agents are held at ACMM L3–L5; the Hive will automatically remove the |
This was referenced Sep 18, 2026
Open
[quality] docs/ and blog/ MDX component imports and CNCFProjectCard props have no unit coverage
#297
Open
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.
Test Improvement
Adds
tests/blog-frontmatter.test.mjs— the first test in this repository that readsanything under
blog/.Docusaurus fails
buildoutright when a post names an author key absent fromblog/authors.ymlor a tag key absent fromblog/tags.yml.npm run check(prettier,markdownlint, cspell, markdown-link-check) never resolves frontmatter keys, so until now
a typo in an author key first appeared as a red deploy.
What it asserts, against the committed content
authors:key resolves inblog/authors.ymltags:key resolves inblog/tags.ymltitle+slug, slug matches the filename after theYYYY-MM-DD-prefix{/* truncate */}(or<!-- truncate -->) markerauthors.ymlentry hasname,title,url,image_url, both URLs httpstags.ymlentry haslabelanddescriptionInline author objects (legal in Docusaurus) are skipped for key lookup rather than
rejected, so the test does not forbid a valid authoring style it does not need to check.
Verification
node --test tests/blog-frontmatter.test.mjs— 8/8 pass at00b44df.ghost-authorkey, at anonexistent-tagkey, and stripping atags.ymldescription each fail thecorresponding test with a message naming the offending file and key (3 failures, 5
still passing). Working tree restored afterwards.
npm run test:unit: 63/63 pass (55 before, +8).npx prettier --checkclean.Scope
One new file,
tests/blog-frontmatter.test.mjs. No production code, no CI change, nopackage.jsonor lockfile change — parsing uses theyaml^2.9.0devDependency therepo already declares and already uses in
scripts/collect-metrics.mjsandscripts/import-architectures.mjs.Disjoint from every open quality PR by construction: this is the only one that touches
blog/. It does not add or modifytests/helpers.mjs(#231),tests/helpers-jsx.mjsor
@swc/core(#229),tests/tools/(#225), anyscripts/test (#185, #197, #208,#214, #216, #221, #263), or any
data/*.jsoncontract test (#235, #239, #241, #253,#257, #260).
Related Issue
Closes #269
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-opus-5