[quality] test: cover data/community-roster.json contract (tests/community-roster-data.test.mjs) - #241
Open
kubestellar-hive[bot] wants to merge 1 commit into
Open
[quality] test: cover data/community-roster.json contract (tests/community-roster-data.test.mjs)#241kubestellar-hive[bot] wants to merge 1 commit into
kubestellar-hive[bot] wants to merge 1 commit into
Conversation
data/community-roster.json is the declared source of truth for TAB members and CNCF staff, and scripts/fetch-community-people.mjs derives every published profile from it. It has no validator, and its failure modes are silent: the script exits 0 and writes a degraded data/community-people.json. Add a contract test asserting the invariants the script relies on: required name and company, nullable optional fields, unique names and github handles, valid handle grammar, an image resolvable for every entry, no orphaned fallbackImages keys, and https fallback urls. 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 17, 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
Adds
tests/community-roster-data.test.mjs— the only file this PR touches.data/community-roster.jsonis the declared source of truth for TAB members and CNCF staff (its own_commentsays so), and it has no validator.scripts/fetch-community-people.mjsreadsroster.sectionsandroster.fallbackImagesand derives every published community profile from them. Its failure modes are all silent — the script exits 0 and writes a degradeddata/community-people.json.The test asserts the invariants the script relies on:
sectionsandfallbackImagesare objects; every section is a non-empty array of plain objectsnameandcompanyare present and non-empty strings on every entryrole,github,linkedin,twitterare each a non-empty string or explicitlynull— never""or another typegithubb) that would silently drop a handlenamevalues are unique across all sections —fallbackImagesis keyed by exact name, so collisions make that lookup ambiguousgithubhandles are unique, keeping theexisting[section].find(...)previous-run lookup unambiguous, and match GitHub's username grammargithubhandle or afallbackImageskey exactly matching itsname. Without one it publishesimage: ''— a headshot-less cardfallbackImageskey matches some rostername(no dead config), and every value is an absolutehttps:URLVerification
node --test tests/community-roster-data.test.mjs: 14 tests pass, 0 fail. Full suitenode --testafter this change: 69 pass, 0 fail (55 before).npx prettier --check tests/community-roster-data.test.mjsis clean.All 16 current entries are already well-formed, so this is a regression guard rather than a repair. The guard was mutation-checked — each of these mutations turns the suite red, and reverting it turns it green again:
githubhandle across two sectionsfallbackImageskeyfallbackImageskey matching no roster namebad--handlegithubbroleto""instead ofnullfallbackImagesurl tohttp://namewith surrounding whitespaceCoverage evidence
node --test --experimental-test-coverage, fresh clone ofcncf/endusersat parent revision00b44dfafternpm ci, 2026-09-17. Baseline: 55 tests,data/community-roster.jsonreferenced by no test and no validator. After: 69 tests.Scope boundary against open PRs
This PR claims
tests/community-roster-data.test.mjsand nothing else.The nearest neighbour is #214, which covers
scripts/fetch-community-people.mjsbehaviour against synthetic fixtures built inside the test. It never reads the real checked-indata/community-roster.json, so it cannot catch drift in the file that actually ships. The two are complementary and touch no common file. #235 coversdata/milestones.json, #208 coversscripts/generate-members.mjs. Nopackage.json, no workflow file, and no shared helper is touched, so it cannot conflict with #225 or #229.Related Issue
Closes #238
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-opus-5