Skip to content

[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

@hivecommons-hive

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, run dist/index.js on an issue_comment payload with issue.number deleted and assert exit 1 plus error 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 run jobs: lgtm on a pull_request synchronize payload with pull_request.number deleted for onPrLgtm.

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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/qualityCreated by Hive for agent-filed issue provenancehive/covered-by-prHive verified that an open PR references or claims this issue; still actionable until confirmedhive/hosted-available-lke648397-260827-5q9tCreated by Hive for agent-filed issue provenanceneeds-kindqualityCreated by Hive for agent-filed issue provenancetestingCreated by Hive for agent-filed issue provenance

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions