Skip to content

fix(config): treat a comment-only prow.yaml as an empty configuration - #415

Merged
mrbobbytables merged 1 commit into
cncf:mainfrom
mrbobbytables:fix/comment-only-prow-yaml
Oct 9, 2026
Merged

mrbobbytables merged 1 commit into
cncf:mainfrom
mrbobbytables:fix/comment-only-prow-yaml

Conversation

@mrbobbytables

Copy link
Copy Markdown
Member

Description

parseProwConfig only short-circuited blank/whitespace input. A file holding only comments contains zero YAML documents, which yaml.load rejects with expected a document, but the input is empty, breaking every configuration-reading command. The document count is now checked first, so a comment-only file loads as an all-empty configuration like a blank one.

Fixes #393

Testing

  • Added a comment-only case to treats %s as an all-empty config in __tests__/utils/config.test.ts
  • npm test

The bundle test for this arm is in #395, which can add the comment-only case to its emptyDocuments table once both land.

Checklist

  • I ran npm run all to lint and build my code
  • I ran npm run pack and committed dist/
  • Commits are signed off (DCO)
  • Note any new dependencies these changes bring in (none)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (n/a)
  • My changes generates no new warnings (the 2 existing jsdoc warnings are unrelated)

yaml.load throws on zero-document input, which a file holding only
comments is. Check the document count first so it loads as {}.

Fixes cncf#393

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Bob Killen <bkillen@linuxfoundation.org>
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

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

@mrbobbytables
mrbobbytables merged commit 55a0ed5 into cncf:main Oct 9, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

1 participant