Skip to content

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
mainfrom
quality/test-issue-template-contract
Open

kubestellar-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-issue-template-contract

Conversation

@kubestellar-hive

Copy link
Copy Markdown
Contributor

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 duplicate id on a non-markdown element, an empty label, an empty labels entry, or a dropdown with no options. None of those are caught by npm run check (prettier, markdownlint, cspell and markdown-link-check never parse issue-form structure) or by npm run test:unit. A broken form is reported only to the contributor trying to file with it.

Separately, an author dropdown option that does not resolve in blog/authors.yml sends a contributor away with a frontmatter key Docusaurus cannot resolve, which is a fatal npm run build error.

What it asserts, against the committed files

assertion why it matters
every form parses as YAML with non-empty name, description, body GitHub rejects the form outright without them
labels, when present, is a list of non-empty strings an empty label is silently applied to every filed issue
every body element uses a supported type (markdown, input, textarea, dropdown, checkboxes) unknown type breaks the whole form
every non-markdown element has a unique id and non-empty attributes.label; markdown elements have attributes.value duplicate ids collide in the rendered issue body
every dropdown has a non-empty list of unique attributes.options an empty dropdown cannot satisfy its own required: true
blog-post.yml still collects title, content and author these ids are what a submission is read back out of
every author option resolves in blog/authors.yml an unresolved author key is a fatal Docusaurus build error
.github/PULL_REQUEST_TEMPLATE.md is present and non-empty silently dropping it removes the checklist contributors see

Verification

  • node --test tests/issue-template-contract.test.mjs — 9/9 pass at 00b44df.
  • Mutation-checked, not just run green. Each assertion was made to fire against a deliberately broken copy of .github/ISSUE_TEMPLATE/blog-post.yml: adding a ghost-author dropdown option, duplicating the title element id, blanking description, removing the content field, repeating an option, blanking a labels entry, and renaming type: dropdown to type: combobox. Each failed with a message naming the file and the offending element (for example body[3] has unsupported type "combobox"). Working tree restored afterwards and re-verified clean with git status --porcelain.
  • Full suite npm run test:unit: 64/64 pass (55 before, +9).
  • npx prettier --check tests/issue-template-contract.test.mjs clean.

Deliberately out of scope

The reverse parity assertion — every blog/authors.yml key must appear in the dropdown — is not included. It is red on main right now (nate-double-u is in authors.yml but 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.yml entries themselves (name, title, url, image_url, https URLs) belongs to #270 and is not re-asserted here — this test reads authors.yml only as the set of valid keys.

Scope

One new file, tests/issue-template-contract.test.mjs. No production code, no CI or workflow change, no package.json or lockfile change — parsing uses the yaml ^2.9.0 devDependency the repo already declares and already uses in scripts/collect-metrics.mjs and scripts/import-architectures.mjs.

Disjoint from every open PR by construction: .github/ISSUE_TEMPLATE/ and .github/PULL_REQUEST_TEMPLATE.md are claimed by no other open PR. It does not touch tests/helpers.mjs (#231), tests/helpers-jsx.mjs or @swc/core (#229), tests/tools/ (#225), any scripts/ test (#185, #197, #208, #214, #216, #221, #263), any data/*.json contract test (#235, #239, #241, #253, #257, #260, #287), blog/ (#270), docs/ (#296, #298), package.json script 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

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>
@kubestellar-hive

Copy link
Copy Markdown
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 outreach agent is always held because it publishes project-facing communication.

Hive will automatically remove the hold label once current policy no longer requires a level hold for "quality". If this is an outreach PR, a human must review it and remove the label.

@kubestellar-hive kubestellar-hive Bot added quality Approved by a Hive merger/owner for auto-merge on green CI testing Approved by a Hive merger/owner for auto-merge on green CI agent/quality Approved by a Hive merger/owner for auto-merge on green CI hive/hosted-available-lke648397-260827-5n31 Approved by a Hive merger/owner for auto-merge on green CI labels Sep 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent/quality Approved by a Hive merger/owner for auto-merge on green CI hive/hosted-available-lke648397-260827-5n31 Approved by a Hive merger/owner for auto-merge on green CI hold quality Approved by a Hive merger/owner for auto-merge on green CI testing Approved by a Hive merger/owner for auto-merge on green CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[quality] .github/ISSUE_TEMPLATE/ is untested; the blog-post author dropdown silently drifts from blog/authors.yml

0 participants