test: cover data/community-people.json contract (tests/community-people-data.test.mjs) - #257
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
data/community-people.json is regenerated on a schedule by refresh-community-people.yml and read directly by src/components/CommunityPeople, but had no validator and no test. A renamed, dropped or emptied section silently renders an empty grid on the Community page, and social handles are interpolated unescaped into profile URLs. Add tests/community-people-data.test.mjs, asserting the committed file against exactly what its consumers rely on: a parseable fetchedAt, a section set matching data/community-roster.json, non-empty sections for every section the docs render (discovered by scanning docs/ rather than hard-coded), per-person field types, unique names, an https image, bare social handles, and a blog that normalises to an http(s) URL under the component's own rule. Test-only; no production code or workflow change. node --test goes from 55 to 69 passing tests. 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
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
data/community-people.jsonwas the only generated data file in the repository with neither a validator script nor a test. It is regenerated on a schedule by.github/workflows/refresh-community-people.ymland read directly bysrc/components/CommunityPeople/index.js, whichdocs/community/end-user-community.mdrenders assection="tab"andsection="staff". Because the component doespeopleData.people[section] || [], a refresh that renames, drops or empties a section produces an empty grid with no build error — the Community page silently loses its people.Files claimed by this PR (test-only; one new file, nothing else touched):
tests/community-people-data.test.mjs(new) — 14 tests asserting the committeddata/community-people.jsonagainst exactly the contract its consumers rely on:fetchedAtis a parseable date andpeopleis a plain object of arraysdata/community-roster.json, and each section has one generated entry per rostered person — the generator's own invariantsection="..."the docs actually render exists and is non-empty. The section names are discovered by scanningdocs/**/*.md(x)for<CommunityPeople section="…">rather than hard-coded, so a newly rendered section is covered automatically; a guard test fails if that scan ever finds nothing.namenon-empty and unique within its section (the component keys cards by name),imagea non-emptyhttps://URL,bio/location/blogstrings,role/linkedin/twitter/profileUpdatedAtstring-or-null,publicRepos/followersnon-negative integers,profileUpdatedAtparseable when presentgithub/linkedin/twitterare bare handles. The component interpolates them unescaped intohttps://github.com/${value},https://www.linkedin.com/in/${value}andhttps://twitter.com/${value}, so a value containing/,?,#or..would send the link somewhere other than the profile it claims.blogis empty or normalises to anhttp/httpsURL with a host, applying the component's ownstartsWith('http') ? blog : 'https://' + blogruleNo production code, no new dependency, and no workflow file is touched —
npm run test:unit(node --test) already discoverstests/*.test.mjsand CI already runs it.Verification
Local clone of
cncf/endusersat parent revision00b44dfafternpm ci, 2026-09-17:node --test: 69 tests pass, 0 fail (55 before).npx prettier --check tests/community-people-data.test.mjsis clean.tabtotab2fails 3 tests, emptyingstafffails 2, setting agithubhandle toevil.com/xfails 1, and blanking animagefails 1. The suite is not vacuous.Coverage evidence
node --test --experimental-test-coverageat00b44df— before this PR, 55 tests pass and the coverage report lists onlyscripts/**andtests/helpers.mjs; no test loadeddata/community-people.json.playwright/cypress/puppeteer/seleniumdependency or script inpackage.jsonand no such job in any of the six workflows in.github/workflows/. It also publishes no coverage artifact from any suite (tracked in [quality] CI publishes no coverage evidence, so coverage findings cannot be verified #186), so no cross-suite coverage merge was possible.Scope, against the open quality PRs
This PR claims
tests/community-people-data.test.mjsand no other file. It is disjoint from #214, which coversscripts/fetch-community-people.mjsbehaviour with an offline fetch stub rather than the committed output, and from #241, thedata/community-roster.jsoncontract — this suite reads the roster only to compare section keys and person counts and asserts nothing about the roster's own internal shape. It adds no dependency and does not touchpackage.json, so it does not overlap #225 or #229.Related Issue
Closes #256
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-opus-5