Skip to content

[quality] cncf-missions: export + test parseSimpleYaml / loadSourcesConfig - #3222

Merged
hivecommons-hive[bot] merged 2 commits into
masterfrom
quality/test-cncf-missions-yaml-parser-1788656256
Sep 11, 2026
Merged

hivecommons-hive[bot] merged 2 commits into
masterfrom
quality/test-cncf-missions-yaml-parser-1788656256

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Refs #3165 (Track A — expose pure helpers, high-ROI).

Exposes two previously module-internal helpers in scripts/generate-cncf-missions.mjs — parseSimpleYaml and loadSourcesConfig — and adds 12 tests in scripts/__tests__/generate-cncf-missions.yaml-parser.test.mjs covering the interesting branching in the parser:

  • empty input
  • blank / comment-only line filtering
  • boolean, integer, unquoted-string, inline-array value shapes
  • single- and double-quote stripping
  • bare key: followed by - item array-of-scalars
  • lastArrayKey reset when a normal key: value follows a bare key
  • sources: vs description: has spaces disambiguation
  • currentSource-null guard on orphan 4-space lines
  • colonIdx > 0 guard on malformed 4-space lines
  • lastArrayKey guard on stray 6-space - item lines
  • inline # comment stripping on value lines

Plus a loadSourcesConfig smoke test that parses the checked-in knowledge-sources.yaml end-to-end.

Coverage delta on scripts/generate-cncf-missions.mjs

Metric Before (#3165 baseline) After
Statements 31.49% 37.13%
Branches 34.5% 46.47%
Functions 34.5% 51.47%

Full 76-file suite: 1120 tests pass (1 expected xfail unchanged).

Test-only + a one-line addition to the module's export { ... } list; no runtime behavior changes.


Filed by quality agent (ACMM L4/L6 — full mode)

— hive: agent=quality backend=copilot model=claude-opus-4.7

…onfig

Refs #3165 (Track A).

Exposes two previously module-internal helpers in
scripts/generate-cncf-missions.mjs — parseSimpleYaml and
loadSourcesConfig — and adds 12 tests in
scripts/__tests__/generate-cncf-missions.yaml-parser.test.mjs
covering the interesting branching in the parser:

- empty input
- blank / comment-only line filtering
- boolean, integer, unquoted-string, inline-array value shapes
- quote stripping (single + double)
- bare 'key:' followed by '- item' array-of-scalars
- lastArrayKey reset when a normal key: value follows a bare key
- 'source:' vs 'description: has spaces' disambiguation via the
  !trimmed.includes(' ') guard
- currentSource-null guard on orphan 4-space key: value lines
- colonIdx > 0 guard on malformed 4-space lines without ':'
- lastArrayKey guard on stray 6-space '- item' lines
- inline '# comment' stripping on value lines

Plus a loadSourcesConfig smoke test that parses the checked-in
knowledge-sources.yaml end-to-end.

Coverage delta on scripts/generate-cncf-missions.mjs:
  before (issue #3165 baseline): 31.49% stmt / 34.5% br / 34.5% fn
  after:                          37.13% stmt / 46.47% br / 51.47% fn

Test-only + one-line export list change.

Signed-off-by: kubestellar-hive[bot] <223556219+Copilot@users.noreply.github.com>
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Important

Held for human sign-off on the direction, not on the code.

This PR's only tracked rationale is #3165, which the hive filed itself — issue #3165 was filed by kubestellar-hive[bot] and no human has acknowledged it. An agent-filed issue does not, on its own, establish that anyone agreed to the direction (hivecommons/hive#5117).

The change may well be right; nothing here is a review of it. To release the hold, acknowledge the direction on that issue — comment on it, assign yourself, or add the approved-direction label — and remove the hold label here.

@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Sep 6, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign clubanderson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Sep 6, 2026
@clubanderson clubanderson removed the hold label Sep 11, 2026
@clubanderson

Copy link
Copy Markdown
Member

Direction acknowledged by hub admin (approved-direction added on #3165); releasing the #5117 hold. This hive runs at ACMM L6 and may act on its own findings.

@kubestellar-prow kubestellar-prow Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 11, 2026
# Conflicts:
#	scripts/generate-cncf-missions.mjs
@kubestellar-prow kubestellar-prow Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 11, 2026
@hivecommons-hive
hivecommons-hive Bot merged commit 0280b58 into master Sep 11, 2026
6 of 7 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the quality/test-cncf-missions-yaml-parser-1788656256 branch September 11, 2026 22:24
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

Check out what's new:

Stay connected: Slack #kubestellar-dev | Multi-Cluster Survey

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

Labels

copilot dco-signoff: yes Indicates the PR's author has signed the DCO. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants