Skip to content

test(bundle): drive parseProwConfig's schema rejections through dist/index.js - #339

Merged
github-actions[bot] merged 3 commits into
mainfrom
quality/test-config-schema-arms
Oct 9, 2026
Merged

github-actions[bot] merged 3 commits into
mainfrom
quality/test-config-schema-arms

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds __tests__/bundle/configSchemaArms.test.ts (new file only; imports comment, repo, token from ./helpers, start from ./fakeGithub, runBundle) — 28 runs of /kind cleanup through the committed dist/index.js against fakeGithub, each routing a different .github/prow.yaml so that parseProwConfig in src/utils/config.ts rejects it. Arms reached:

  • parseProwConfig / normalizeSection / normalizeValues (L327, 405, 421, 426): a scalar top level, a scalar legacy section, a { exclusive } mapping without values, a numeric value, a color with a leading #
  • normalizeRequireMatchingLabel (L433–468): not a list, non-mapping rule, non-string regexp, non-compiling regexp, empty missing_label, non-boolean prs, non-string missing_comment
  • normalizeTide (L488–506): not a mapping, empty label name in labels, non-string in missing_labels (also reaches isStringList/isLabelList at L692/696), unknown merge_method, non-boolean merge_on_events, unknown merge_queue
  • normalizeBlunderbuss (L532–551): not a mapping, request_count 0, max_request_count below request_count, non-boolean ignore_drafts, non-string in ignore_authors
  • normalizeApprove (L567, 572) and normalizeLgtm (L581, 585): not a mapping, non-boolean flag
  • the unknown-top-level-key debug (L370): one green run where unknown_plugin: sits next to a labels mapping, /kind cleanup still applies

Every rejection asserts exit 1, a could not get labels from yaml: Error: Codertocat/Hello-World:.github/prow.yaml: <field> … error annotation (or the <section>: … message for label sections, whose errors do not carry the source), and no POST /issues/1/labels.

Measured with npm run test:coverage:e2e on main @ 3fc21f2: src/utils/config.ts e2e lines 68.78 % → 82.92 %; all files 77.9 % → 79.21 % lines, 70.82 % → 73.98 % branches. The remap still lists L327, L377–379 and L431–433 as unhit although the asserted messages prove those statements ran — they are multi-line statements, and the tsc+webpack map credits only their first line; noted so nobody chases them. npx eslint and tsc --noEmit clean on the new file; the suite is 28 tests / ~8 s.

Disjoint from the held PRs touching this file: #314 (__tests__/bundle/explicitConfigSource.test.ts, source tiers L206–282), #293 (holdSweepSettings.test.ts, normalizeHold/normalizeSweep L519–527/592–612). fetchUrl (L288–301) is left out for the reason #314 gives.

Related Issue

Closes #338


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

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

…index.js

Adds __tests__/bundle/configSchemaArms.test.ts: 27 malformed .github/prow.yaml
documents (label sections, colors, require_matching_label, tide, blunderbuss,
approve, lgtm) each fail /kind cleanup naming the source and field with no label
write, plus the unknown-top-level-key debug arm. src/utils/config.ts e2e lines
68.78% -> 82.92% under npm run test:coverage:e2e.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: quality <quality@hive.kubestellar.io>
@hivecommons-hive
hivecommons-hive Bot requested a review from jpmcb as a code owner October 6, 2026 02:07
@hivecommons-hive hivecommons-hive Bot added the hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 6, 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

build-test on b6fb905 is red for the shared cause tracked in #294, not for this diff: all 81 files / 1667 tests pass and the job exits 1 on the single vitest unhandled error assert(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID") originating in __tests__/issueCommentTest/meow.test.ts (failed run 37402591432). The twin push run on the same SHA is green (37402545894). This PR only adds __tests__/bundle/configSchemaArms.test.ts.

Deferring until #294 closes (fix is #287); no retries or pushes for this failure.


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

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

@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.

25 of the 27 rows add a config.ts line of their own. Two don't:

  • configSchemaArms.test.ts:46 and :47 both hit the same malformedSection throw (config.ts:405→431) and the same branches. Keep one.
  • Drop :59 (tide.missing_labels: [1]). :58 already reaches the same throw (config.ts:493), and :67 reaches the same isStringList branch.

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Addressed: dropped the duplicate malformedSection row (labels.kind mapping without values) and the tide.missing_labels: [1] row. Merged main.


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

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

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Addressed in 137b926: dropped the second malformedSection row and the tide.missing_labels: [1] row.

CI is green on the new head.


🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5q9t | SHA: 1f7d33c

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

@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.

Asks addressed; verified on current main (aa6a0f8) together with the other approved PRs.

@jeefy

jeefy commented Oct 9, 2026

Copy link
Copy Markdown
Member

/kind cleanup
/lgtm
/approve
/hold cancel

@github-actions github-actions Bot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed hold Indicates that a PR should not merge because someone has issued a /hold command. labels Oct 9, 2026
@mrbobbytables
mrbobbytables deleted the quality/test-config-schema-arms branch October 9, 2026 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged.

Projects

None yet

1 participant