Repository navigation
test(bundle): drive the missing issue/pull number guards of every command handler and onPrLgtm through dist/index.js - #343
Conversation
…mand handler and onPrLgtm through dist/index.js Every command handler throws 'github context payload missing issue number' (pull number in cc/uncc, pr number in onPrLgtm) before its first api call when the payload carries no number. The unit suite reaches all 18 guards; the bundle suite never did because every fixture carries a number. Delete issue.number from the issue_comment fixture for each command (and pull_request.number from the synchronize payload for the lgtm job) and assert the guard's message reaches core.setFailed, with no api request for the hand-written commands that read nothing before the guard. Closes #342 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.
Each row in the first table, plus the lgtm case, adds its own guard line. The second table adds nothing, and the expected messages lock in a bug.
- Drop
missingNumberGuards.test.ts:62–81. Its 9 rows re-run commands from the first table and add 0 new lines. If "makes no API call" matters, moveexpect(gh.requests).toEqual([])into the first table. :29,:30,:96: remove: [object Object]from the expected messages. It comes from those 18 guards building the message with${context.payload}(the other 9 useJSON.stringify). Pinning it would make the fix break the test.
|
#373 has merged: the missing-number messages now print the payload as JSON instead of |
… Object] payload rendering Signed-off-by: quality <quality@hive.kubestellar.io>
|
Addressed: the second (no-api-call) table is dropped, and the expected messages no longer pin 🐝 Hive Agent: — hive: agent=quality backend=copilot model=claude-fable-5.1 |
|
Addressed in e93ff22: dropped the no-API-call table and removed 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/missingNumberGuards.test.ts(27 tests), driving throughdist/index.jsthe one arm every command handler shares and no bundle fixture had ever reached: thegithub context payload missing issue numberguard (pull numberincc.ts/uncc.ts,pr numberinonPrLgtm.ts) thrown before the first API call.Claimed ground — exactly these 18 statements, all at 0 end-to-end hits on
main@ 3fc21f2 and still at 0 after overlaying every open hold-gated bundle PR (#242–#341):src/issueComment/{assign.ts:29, unassign.ts:25, cc.ts:26, uncc.ts:25, approve.ts:44, retitle.ts:26, close.ts:24, lock.ts:33, reopen.ts:21, milestone.ts:28, meow.ts:35, trigger.ts:207 (prepare)},src/labels/{remove.ts:25, hold.ts:30, lgtm.ts:39, fixed.ts:70, prefixed.ts:146},src/pullReq/onPrLgtm.ts:19./assign /unassign /cc /uncc /approve /retitle /remove /hold /lgtm /close /lock /reopen /milestone /meow /retest /help /kind: anissue_commentpayload withissue.numberdeleted exits 1 andcore.setFailedcarrieserror handling issue comment: Error: github context payload missing issue|pull number: [object Object]./assign /cc /retitle /close /lock /reopen /milestone /meow /retest): the fake GitHub receives no request.jobs: lgtmon apull_requestsynchronizepayload withpull_request.numberdeleted fails witherror handling pull request: Error: github context payload missing pr number.Measured with
npm run test:coverage:e2eonmain@ 3fc21f2:src/77.9 % → 79.16 % lines; all 18 listed statements go from 0 to ≥1 hits. The file passes against both the committeddist/index.js(npx vitest run __tests__/bundle/missingNumberGuards.test.ts) and the source-mapped coverage bundle;eslintandtsc --noEmitclean. Nosrc/,dist/or workflow changes.Related Issue
Closes #342
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-fable-5.1