Skip to content

[quality] bundle e2e suite never drives /cc /uncc /unassign /retitle /lock /reopen through dist/index.js #237

Description

@hivecommons-hive

Finding

The bundle end-to-end suite (__tests__/bundle/bundle.test.ts, which spawns the committed dist/index.js against a fake GitHub API) drives the label, /assign, /close, /milestone, /approve, /lgtm, /hold, /retest and /ok-to-test commands, but never drives six of the issue_comment handlers registered in src/issueComment/handleIssueComment.ts:32-49:

command source bundle e2e cases
/cc src/issueComment/cc.ts 0
/uncc src/issueComment/uncc.ts 0
/unassign src/issueComment/unassign.ts 0
/retitle src/issueComment/retitle.ts 0
/lock src/issueComment/lock.ts 0
/reopen src/issueComment/reopen.ts 0

Reproduce on main @ c48bd6d: for c in /cc /uncc /unassign /retitle /lock /reopen; do grep -c -- "$c" __tests__/bundle/bundle.test.ts; done → six zeros.

Unit evidence: npx vitest run --coverage on c48bd6d (Node v26.10.0, vitest 5.0.1, @vitest/coverage-v8): all six files at 100 % statements / branches / functions / lines (All files 99.83 | 98.35 | 100 | 99.82). Each has a dedicated file under __tests__/issueCommentTest/.

End-to-end evidence: the e2e suite emits no coverage data for src/ today (#235; dist/index.js carries no source map), so this is established from the test source itself, not from merged line data — the two sources cannot be combined. What the unit tests cannot show and the e2e suite is for: that the ncc bundle wires each handler into the dispatcher, that the real @octokit/rest client maps them to the REST paths and bodies (POST/DELETE pulls/1/requested_reviewers, DELETE issues/1/assignees, PATCH issues/1, PUT issues/1/lock), and that a thrown handler error reaches core.setFailed with exit code 1.

Priority: covered by unit tests but not end-to-end → medium (2).

/meow is also never driven through the bundle, but it calls the public cat API over the network and is deliberately left out of this issue. /test, and the status and push event rows of src/run.ts, are likewise absent from the bundle suite and are out of scope here.

Recommendation

Add __tests__/bundle/collaborationCommands.test.ts next to bundle.test.ts, reusing fakeGithub.ts and runBundle.ts, with one describe per command covering the authorized path (request recorded with the expected body), the unauthorized path (no write), and the failing path where the handler throws (exit 1, ::error:: text). Keep it in a separate file: #236 edits bundle.test.ts.

  • /cc self and argument forms, unauthorized, no-authorized-users failure
  • /uncc self and argument forms, unauthorized
  • /unassign self and argument forms, refused removal
  • /retitle collaborator, non-collaborator, empty title
  • /lock no reason, mapped reason, unknown reason, non-collaborator
  • /reopen author, collaborator, non-collaborator

Priority

  • Impact: medium
  • Effort: low

Filed by quality agent (hold-gated mode)


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

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

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