test: cover the .github issue-form and PR-template contract (tests/issue-template-contract.test.mjs) - #311
Open
kubestellar-hive[bot] wants to merge 1 commit into
Open
test: cover the .github issue-form and PR-template contract (tests/issue-template-contract.test.mjs)#311kubestellar-hive[bot] wants to merge 1 commit into
kubestellar-hive[bot] wants to merge 1 commit into
Conversation
No test reads .github/ISSUE_TEMPLATE/ or .github/PULL_REQUEST_TEMPLATE.md, so a malformed issue form is reported only to the contributor trying to file, and a blog-post author option that does not resolve in blog/authors.yml produces frontmatter Docusaurus cannot resolve. Adds tests/issue-template-contract.test.mjs asserting issue-form schema validity, unique element ids, non-empty dropdown options, the blog-post field set, author-option resolution against blog/authors.yml, and a non-empty pull request template. Closes #310 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 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/issue-template-contract.test.mjs— the first test in this repository that reads anything under.github/.GitHub rejects an issue form for an unknown body
type, a missing or duplicateidon a non-markdown element, an emptylabel, an emptylabelsentry, or adropdownwith nooptions. None of those are caught bynpm run check(prettier, markdownlint, cspell and markdown-link-check never parse issue-form structure) or bynpm run test:unit. A broken form is reported only to the contributor trying to file with it.Separately, an
authordropdown option that does not resolve inblog/authors.ymlsends a contributor away with a frontmatter key Docusaurus cannot resolve, which is a fatalnpm run builderror.What it asserts, against the committed files
name,description,bodylabels, when present, is a list of non-empty stringsmarkdown,input,textarea,dropdown,checkboxes)idand non-emptyattributes.label; markdown elements haveattributes.valuedropdownhas a non-empty list of uniqueattributes.optionsrequired: trueblog-post.ymlstill collectstitle,contentandauthorauthoroption resolves inblog/authors.yml.github/PULL_REQUEST_TEMPLATE.mdis present and non-emptyVerification
node --test tests/issue-template-contract.test.mjs— 9/9 pass at00b44df..github/ISSUE_TEMPLATE/blog-post.yml: adding aghost-authordropdown option, duplicating thetitleelement id, blankingdescription, removing thecontentfield, repeating an option, blanking alabelsentry, and renamingtype: dropdowntotype: combobox. Each failed with a message naming the file and the offending element (for examplebody[3] has unsupported type "combobox"). Working tree restored afterwards and re-verified clean withgit status --porcelain.npm run test:unit: 64/64 pass (55 before, +9).npx prettier --check tests/issue-template-contract.test.mjsclean.Deliberately out of scope
The reverse parity assertion — every
blog/authors.ymlkey must appear in the dropdown — is not included. It is red onmainright now (nate-double-uis inauthors.ymlbut not in the dropdown) and #243 is the fix for that data. Adding the assertion here would duplicate #243 and land a failing test. It is a one-line follow-up once #243 merges; this PR does not modify.github/ISSUE_TEMPLATE/blog-post.yml.The field contract of
blog/authors.ymlentries themselves (name,title,url,image_url, https URLs) belongs to #270 and is not re-asserted here — this test readsauthors.ymlonly as the set of valid keys.Scope
One new file,
tests/issue-template-contract.test.mjs. No production code, no CI or workflow change, nopackage.jsonor lockfile change — parsing uses theyaml^2.9.0devDependency the repo already declares and already uses inscripts/collect-metrics.mjsandscripts/import-architectures.mjs.Disjoint from every open PR by construction:
.github/ISSUE_TEMPLATE/and.github/PULL_REQUEST_TEMPLATE.mdare claimed by no other open PR. It does not touchtests/helpers.mjs(#231),tests/helpers-jsx.mjsor@swc/core(#229),tests/tools/(#225), anyscripts/test (#185, #197, #208, #214, #216, #221, #263), anydata/*.jsoncontract test (#235, #239, #241, #253, #257, #260, #287),blog/(#270),docs/(#296, #298),package.jsonscript wiring (#278), or the CI action-pinning contract (#301, which asserts.github/workflows/pinning and permissions — a disjoint directory and a disjoint failure mode).Related Issue
Closes #310
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-opus-5