Repository navigation
[quality] parseProwConfig's empty-document arm (config.ts:373, return {}) has no end-to-end coverage through dist/index.js #394
Description
Finding
The empty-document arm of parseProwConfig — src/utils/config.ts:373, return {} when the loaded yaml is undefined/null — is never exercised by the bundle test suite, although it is the arm every blank or placeholder prow.yaml takes.
Evidence (main @ aa6a0f8, Node v26.10.0, vitest 5.0.3):
- Unit:
npx vitest run --coverage→ 100 % lines ofsrc/. The arm is reached by__tests__/utils/config.test.ts:420-426(treats %s as an all-empty config:'','---\n',' \n'). - End-to-end:
npm run test:coverage:e2eon a scratch branch =origin/main+ the heads of all 35 open hold-gated bundle PRs (test(bundle): drive root-OWNERS authorization on an issue and the OWNERS-based /lgtm refusal through dist/index.js #283 … test(bundle): drive the lgtm job's no-lgtm-label arm (onPrLgtm.ts:33) and label-sync's verbatim labels.labels allowlist (labelCatalog.ts:80) through dist/index.js #392, all merge clean; 56 files / 426 tests pass) → 97.76 % lines ofsrc/;config.tsresidual is220,373,427. Line 220 is the test-onlyresetProwConfigCache; 373 has 0 hits; 427 is thenormalizeSectionsmap callback, whose 0 hits are inconsistent with the/kindand/lifecyclebundle runs that build sections from a file, so it is not claimed here (likely a source-map remap artifact, left for a separate look). - Reachability from the bundle:
loadRepoTierreturns the first repository path that exists, so a blank.github/prow.yamlis a found source (config.sources.length === 1) andgetLabelConfigdoes not raiseno prow configuration found;/lifecycle stalethen serves Prow's built-infrozen,stale,rottenand/kind cleanupfails withkind: yaml malformed, expected 'kind' top level key. Neither behaviour is asserted anywhere under__tests__/bundle/:labelCommands.test.tscovers the built-in defaults only via a.prowlabels.yamlthat lacks the key, and the no-file failure.
Not claimed by #314 (explicit config source), #339 (schema rejections), #366 or #386.
Recommendation
- add
__tests__/bundle/emptyConfigDocument.test.ts: routeGET /repos/Codertocat/Hello-World/contents/.github%2Fprow.yamlwith a blank body and with---\n, drive/lifecycle stale(exit 0,lifecycle: using built-in labels frozen,stale,rotten, onePOST /issues/1/labelswithlifecycle/stale, config reads stop at.github/prow.yaml) and/kind cleanup(exit 1,kind: yaml malformed, expected 'kind' top level key, nono prow configuration found, no label write)
A comment-only file belongs in the same table but currently throws YAMLException: expected a document, but the input is empty through the bundle; that is a production defect filed separately, and the test leaves that row out until it is fixed.
Priority
- Impact: medium (unit-covered, no end-to-end coverage)
- Effort: low
🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5q9t | SHA: aa6a0f8
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88
Activity
github-actions commentedon Oct 8, 2026
Please add a kind label with
/kind failing-testor/kind cleanup.test(bundle): drive parseProwConfig's empty-document arm (config.ts:3…