Repository navigation
[quality] the 18 missing-issue/pull-number guards across the command handlers and onPrLgtm have no end-to-end coverage through dist/index.js #342
Description
Finding
Every command handler opens with the same guard — github context payload missing issue number (or pull number in cc.ts/uncc.ts, pr number in onPrLgtm.ts) — thrown before the first API call when the event payload carries no number. The unit suite reaches all of them, but the end-to-end suite (npm run test:coverage:e2e, which runs dist/index.js against the fake GitHub) never does: every bundle fixture carries issue.number / pull_request.number, so no bundle test has ever observed the guard's message surface through handleIssueComment's error collection into core.setFailed.
Evidence on main @ 3fc21f2:
- Unit:
npx vitest run --coverage— 100 % lines; every guard line hit. - End-to-end:
npm run test:coverage:e2e— 77.9 % lines overall; these 18 statements have 0 hits:
| file | line | message |
|---|---|---|
src/issueComment/assign.ts |
29 | missing issue number |
src/issueComment/unassign.ts |
25 | missing issue number |
src/issueComment/cc.ts |
26 | missing pull number |
src/issueComment/uncc.ts |
25 | missing pull number |
src/issueComment/approve.ts |
44 | missing issue number |
src/issueComment/retitle.ts |
26 | missing issue number |
src/issueComment/close.ts |
24 | missing issue number |
src/issueComment/lock.ts |
33 | missing issue number |
src/issueComment/reopen.ts |
21 | missing issue number |
src/issueComment/milestone.ts |
28 | missing issue number |
src/issueComment/meow.ts |
35 | missing issue number |
src/issueComment/trigger.ts |
207 (prepare, shared by /retest, /test, /ok-to-test) |
missing issue number |
src/labels/remove.ts |
25 | missing issue number |
src/labels/hold.ts |
30 | missing issue number |
src/labels/lgtm.ts |
39 | missing issue number |
src/labels/fixed.ts |
70 (requireIssueNumber) |
missing issue number |
src/labels/prefixed.ts |
146 (requireIssueNumber) |
missing issue number |
src/pullReq/onPrLgtm.ts |
19 | missing pr number |
Overlap check: overlaying the test files of all 31 open hold-gated bundle PRs (#242–#341) onto main and re-running test:coverage:e2e leaves every one of these 18 lines at 0 hits, so no open PR claims this ground.
Recommendation
- Add
__tests__/bundle/missingNumberGuards.test.ts: for each command in the table, rundist/index.json anissue_commentpayload withissue.numberdeleted and assert exit 1 pluserror handling issue comment: Error: github context payload missing issue|pull number: [object Object]; for the hand-written commands that read nothing before the guard (/assign,/cc,/retitle,/close,/lock,/reopen,/milestone,/meow,/retest) also assert the fake GitHub received no request; and runjobs: lgtmon apull_requestsynchronizepayload withpull_request.numberdeleted foronPrLgtm.
Priority
- Impact: medium — covered by unit tests but not end-to-end (18 lines across 18 files; e2e 77.9 % → 79.16 % lines)
- Effort: low
Filed by quality agent (hold-gated mode)
🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5q9t | SHA: 3fc21f2
— hive: agent=quality backend=copilot model=claude-fable-5.1
Activity
github-actions commentedon Oct 6, 2026
Please add a kind label with
/kind failing-testor/kind cleanup.