Repository navigation
[quality] /approve's membership-mode review failures and the no-review cancel in src/issueComment/approve.ts have no end-to-end coverage #354
Description
Finding
When a pull request's repository has no OWNERS files, /approve in src/issueComment/approve.ts falls back to org membership and submits (or, for /approve cancel, dismisses) a GitHub review from the bot. The bundle suite drives the happy paths of that mode (bundle.test.ts, "on a repository without OWNERS files …"), but none of its failure arms:
| line | arm |
|---|---|
| 82 | could not create review — POST …/pulls/1/reviews refused |
| 67 + 160 | could not remove latest review: … could not list reviews for PR 1 — GET …/pulls/1/reviews refused |
| 67 + 173 | no latest review found to cancel — no bot APPROVED review in the listing |
| 67 + 185 | could not dismiss review — PUT …/reviews/<id>/dismissals refused |
| 131 | Could not comment with an auth error — the refusal's POST …/issues/1/comments fails; the original refusal must still fail the run |
Evidence (main @ 3fc21f2, Node v26.10.0, vitest 5.0.3)
- Unit:
npx vitest run --coverage→src/issueComment/approve.ts51/51 lines (100 %); whole suite 100 % lines / 99.81 % branches, 80 files. - End-to-end:
npm run test:coverage:e2e→src/issueComment/approve.ts43/51 lines, 19/26 branches; the eight e2e-missed statements are lines 44, 67, 82, 96, 131, 160, 173, 185. Whole bundle suite: 78.24 % lines (1855/2381). - Both figures come from the same checkout; the unit run and the e2e run are separate reports (per the limitation documented with test(coverage): add test:coverage:e2e to report the bundle suite's coverage of src/ #274), compared here per line.
Of the eight, line 44 (missing issue number guard) is claimed by #343 and line 96 (require_self_approval refusal) by #333. The six remaining are the cluster above — a coverage-gap covered by unit tests but not end-to-end (priority: medium).
Recommendation
- Add a bundle suite (
__tests__/bundle/approveMembershipArms.test.ts) that drives the five arms throughdist/index.jsagainstfakeGithubwithrouteOwners({}, …)and a 204 org-membership read, asserting exit 1, the wrapped error text, and that the post-command sweep still runs.
Priority
- Impact: medium — the only end-to-end suite never exercises how the shipped bundle reports a refused review write or dismissal
- Effort: low
Filed by quality agent (hold-gated mode)
🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5q9t | SHA: ae5ca75
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88
Activity
github-actions commentedon Oct 6, 2026
Please add a kind label with
/kind failing-testor/kind cleanup.hivecommons-hive commentedon Oct 9, 2026
task-list sweep: 0 of 1 items ticked. Not closing yet — outstanding boxes remain.
Outstanding items:
__tests__/bundle/approveMembershipArms.test.ts) that drives the five arms throughdist/index.jsagainstfakeGithubwithrouteOwners({}, …)and a 204 org-membership read, asserting exit 1, the wrapped error text, and that the post-command sweep still runs.Merged PRs referencing this issue so far:
This comment is edited in place by the task-list sweep on every cycle; it is not duplicated.