Skip to content

test(docs): parse every prow.yaml and OWNERS example in the guides against the config and OWNERS parsers - #501

Open
hivecommons-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-docs-yaml-examples
Open

hivecommons-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-docs-yaml-examples

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Files claimed: __tests__/docsYamlExamples.test.ts (new, test-only). Reads README.md and docs/**/*.md (bar docs/releases/) and calls src/utils/config.ts (parseProwConfig, mergeProwConfig, resolveTide, resolveHoldLabel, resolveSweepLookback, resolveAuthorization, isMapping), src/utils/owners.ts (parseOwners) and the approveSettings / blunderbussSettings / lgtmSettings resolvers. No src/, dist/, workflow or docs change. Disjoint from #497 (src/plugins/approve.ts, src/issueComment/meow.ts), #498 (__tests__/bundle/tideOptionalFields.test.ts) and #500 (vitest.config.mjs, docs/contributing.md).

configurationDocs.test.ts holds the docs/configuration.md example to the parser and the code's defaults; the 19 prow.yaml and 7 OWNERS blocks in the other guides were never read by any test. parseProwConfig only core.debugs an unknown top-level key (config.ts:420-422) and every section normalizer stripUndefineds unknown fields (config.ts:561-567), so a renamed or typo'd documented example would be accepted silently.

The new file extracts every fenced ```yaml block with its file:line and introducing paragraph, classifies it, and asserts:

  • every block is a yaml mapping or a list of workflow steps (- uses: …)
  • OWNERS blocks (told apart by the introducing prose or a # …OWNERS leading comment, since a legacy-form prow.yaml is also a mapping of lists) use only keys parseOwners reads or docs/commands.md lists as accepted-and-ignored, parse, and name at least one approver or reviewer
  • prow.yaml blocks parse, have no top-level key the parser would ignore, have no section field the normalizers would strip (field names read off the resolvers, as configurationDocs.test.ts does for the tables), and are accepted by every resolver
  • workflow blocks only have to parse — workflows.test.ts and version.test.ts already hold them to the action and the release

36 blocks → 77 cases (74 kind-specific cases skipped by it.runIf).

Verification (local, this branch, main @ 1062ce7)

  • npx eslint __tests__/docsYamlExamples.test.ts clean; npx tsc --noEmit clean
  • npm run test:coverage: 158 files / 2193 tests pass (was 157 / 2116 + chore(coverage): raise the unit coverage floor to 99/99/99/99 and fix the documented values #500's); totals unchanged at 100 % lines, 99.7 % branches, 100 % functions, 100 % statements
  • Mutation checks, each reverted: tide.merge_on_event (docs/automatic-merging.md:114) → unknown field 'tide.merge_on_event'; aprovers: (docs/commands.md:189) → unknown OWNERS key 'aprovers'; require_matching_labels: (docs/labeling.md:173) → parser rejects it as a malformed label section
  • The e2e suite (__tests__/bundle) is untouched

Related Issue

Refs #499 — this lands the folded "prow.yaml and OWNERS examples outside docs/configuration.md are never parsed by a test" finding (comment hive-finding-folded on #499, folded there on the docs/contributing.md mention). #499 itself is the coverage-floor finding that #500 closes; nothing else of this finding remains after this merges.


Filed by quality agent (hold-gated mode). Human review required.

— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88

configurationDocs.test.ts holds the docs/configuration.md example to the
parser; the 19 prow.yaml and 7 OWNERS blocks in the other guides were never
read by a test. parseProwConfig only debug-logs an unknown top-level key and
the section normalizers strip unknown fields, so a typo'd example would be
accepted silently.

docsYamlExamples.test.ts extracts every fenced yaml block from README.md and
docs/ (bar docs/releases/), classifies it as workflow, OWNERS or prow.yaml,
and feeds the latter two to parseOwners and parseProwConfig plus the section
resolvers, rejecting any key or field the code would ignore.

Signed-off-by: quality <quality@hive.kubestellar.io>
@hivecommons-hive
hivecommons-hive Bot requested a review from jpmcb as a code owner October 17, 2026 10:39
@hivecommons-hive hivecommons-hive Bot added the hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 17, 2026
@hivecommons-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. Agent PRs are held at ACMM L3–L5; an outreach PR that targets a repository this hive does not manage is held at every level because it publishes project-facing communication into someone else's project.

Hive will keep the hold label until a human removes it. Operators can make a deliberate one-off release during an ACMM level change with release_level_holds=true, but level changes never release this hold automatically.

@github-actions

Copy link
Copy Markdown
Contributor

Please add a kind label with /kind feature, /kind failing-test or /kind cleanup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hold Indicates that a PR should not merge because someone has issued a /hold command. needs-kind

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants