Repository navigation
test(bundle): drive the prow-commands alias canonicalization and unsupported-command arms through dist/index.js - #357
Conversation
…pported-command arms through dist/index.js Adds __tests__/bundle/commandCanonicalization.test.ts: three issue_comment runs of the committed bundle against fakeGithub reach handleIssueComment.ts L86 (a configured /remove-help runs the /help module; duplicates collapse to one run) and L150 (a configured /foo_bar fails the run naming it, no api call). e2e lines 93.90 -> 96.34 %, branches 86.27 -> 90.19 %. Closes #356 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: quality <quality@hive.kubestellar.io>
|
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 Hive will keep the |
jeefy
left a comment
There was a problem hiding this comment.
L39 reaches handleIssueComment.ts:86 and L63 reaches :150. L52 only reaches :86 again, because the Set dedup has no branch of its own.
- Drop
commandCanonicalization.test.ts:52–61. :67–69: usetoHaveLength(1)+toContain('could not execute /foo_bar')instead of comparing the whole::error::string withtoEqual, which also locks in theTypeError:wrapper.
…nsupported-command error by fragment Signed-off-by: quality <quality@hive.kubestellar.io>
|
Addressed: dropped the 🐝 Hive Agent: — hive: agent=quality backend=copilot model=claude-fable-5.1 |
|
Addressed in f821b7e: dropped the alias-collapse case and the unsupported-command check uses CI is green on the new head. 🐝 Hive Agent: — hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
|
/kind cleanup |
Test Improvement
Adds
__tests__/bundle/commandCanonicalization.test.ts(new file only; importscomment,helpersFor,repo,tokenfrom./helpers,startfrom./fakeGithub,runBundlefrom./runBundle; nosrc/,dist/,helpers.tsor config change). Threeissue_commentruns of the committeddist/index.jsagainstfakeGithubreach the twoprow-commandsinput arms ofsrc/issueComment/handleIssueComment.tsno bundle suite drove:prow-commands: /remove-help, comment/helpcanonicalCommandalias arm L86GET labels→POST issues/1/labels {help wanted}, then the configuration readsprow-commands: /help /remove-help /HELP, comment/helpSetdedup at L109prow-commands: /foo_bar, comment/foo_bar::error::TypeError: error handling issue comment: Error: could not execute /foo_bar. May not be supported - please refer to docs, zero api callsEvidence (
main@ 3fc21f2, Node v26.10.0, vitest 5.0.3, @vitest/coverage-v8,npm run test:coverage:e2e):src/issueComment/handleIssueComment.tse2e lines 93.90 % → 96.34 %, statements 94.04 % → 96.42 %, branches 86.27 % → 90.19 %. Remaining lines 45 (/meow, held test(bundle): drive /meow through dist/index.js against a stubbed cat api #244), 188 (held test(bundle): drive the configured hold and sweep sections through dist/index.js #293) and 207 (removeFixedLabels, held test(bundle): drive removeFixedLabels' no-op and failed-labels-read arms through dist/index.js #300) are each already claimed.Disjoint from every open hold-gated bundle PR: #246 (
/remove-helpin the comment with/helpconfigured, built-in/lifecycle), #343 (missing issue/pull number guards), #324 (command.tsMarkdown guards), #242 (cronjobsinput). None of them puts an alias or an unsupported name in theprow-commandsinput.Verified locally:
npx vitest run __tests__/bundle/commandCanonicalization.test.ts→ 3 passed against the committeddist/index.js;npx eslint __tests__/bundle/commandCanonicalization.test.tsandnpx tsc --noEmitclean.Related Issue
Closes #356
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88