Skip to content

test(bundle): drive parseProwConfig's empty-document arm (config.ts:373) through dist/index.js - #395

Merged
mrbobbytables merged 4 commits into
mainfrom
quality/test-empty-config-document
Oct 9, 2026
Merged

mrbobbytables merged 4 commits into
mainfrom
quality/test-empty-config-document

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds __tests__/bundle/emptyConfigDocument.test.ts, driving the empty-document arm of parseProwConfig (src/utils/config.ts:373, return {} when the loaded yaml is undefined/null) through dist/index.js.

For each of a blank .github/prow.yaml and a bare --- document:

  • /lifecycle stale → exit 0, lifecycle: using built-in labels frozen,stale,rotten, exactly one POST /issues/1/labels with lifecycle/stale, and the configuration reads stop at .github/prow.yaml (the empty file is a found source, so no prow configuration found is never raised)
  • /kind cleanup → exit 1, kind: yaml malformed, expected 'kind' top level key, no no prow configuration found, no label write

Evidence on main @ aa6a0f8: npm run test:coverage:e2e on origin/main + the heads of all 35 open hold-gated bundle PRs (#283 … #392) left config.ts:373 at 0 hits; with this file it gets 4. Unit coverage already reached the arm via __tests__/utils/config.test.ts:420-426.

Files / functions claimed: __tests__/bundle/emptyConfigDocument.test.ts (new) only; parseProwConfig empty-document arm. Disjoint from #314 (explicit config source), #339 (schema rejections) and #388 (label listing refusals).

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 in the trim() guard, filed as #393 for a maintainer; the test names it and leaves that row out until it is fixed.

Related Issue

Closes #394


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

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

…73) through dist/index.js

A blank or bare-'---' .github/prow.yaml is a found configuration source
with no sections: /lifecycle stale falls back to the built-in defaults
and /kind cleanup fails naming the missing key rather than reporting no
configuration. Neither path had end-to-end coverage.

A comment-only file still throws through the bundle (issue #393), so
that row is left out until parseProwConfig handles zero-document input.

Closes #394

Signed-off-by: quality <quality@hive.kubestellar.io>
@hivecommons-hive
hivecommons-hive Bot requested a review from jpmcb as a code owner October 8, 2026 18:40
@hivecommons-hive hivecommons-hive Bot added the hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 8, 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. Non-outreach agents are held at ACMM L3–L5; the outreach agent is always held because it publishes project-facing communication.

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.

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

/kind cleanup


🐝 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

@github-actions github-actions Bot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. and removed needs-kind labels Oct 8, 2026

@jeefy jeefy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The blank-file /lifecycle row (:51) reaches config.ts:373 and every new branch. The other rows add nothing.

  • Drop the bare-document-marker row at emptyConfigDocument.test.ts:52 and the /kind it.each at :66–73.

…ocument arm

Signed-off-by: quality <quality@hive.kubestellar.io>
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Addressed in 138529c: dropped the --- row and the /kind it.each; the blank-file /lifecycle case stands alone as a plain it (the #393 note about the comment-only shape stays).


🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5q9t | SHA: 138529c

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

mrbobbytables and others added 2 commits October 9, 2026 10:55
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Bob Killen <bkillen@linuxfoundation.org>
@mrbobbytables
mrbobbytables merged commit aa1e34b into main Oct 9, 2026
5 checks passed
@mrbobbytables
mrbobbytables deleted the quality/test-empty-config-document branch October 9, 2026 18:00
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. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[quality] parseProwConfig's empty-document arm (config.ts:373, return {}) has no end-to-end coverage through dist/index.js

2 participants