You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
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
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
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 through dist/index.js against fakeGithub with routeOwners({}, …) 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
Finding
When a pull request's repository has no OWNERS files,
/approveinsrc/issueComment/approve.tsfalls 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:could not create review—POST …/pulls/1/reviewsrefusedcould not remove latest review: … could not list reviews for PR 1—GET …/pulls/1/reviewsrefusedno latest review found to cancel— no botAPPROVEDreview in the listingcould not dismiss review—PUT …/reviews/<id>/dismissalsrefusedCould not comment with an auth error— the refusal'sPOST …/issues/1/commentsfails; the original refusal must still fail the runEvidence (
main@ 3fc21f2, Node v26.10.0, vitest 5.0.3)npx vitest run --coverage→src/issueComment/approve.ts51/51 lines (100 %); whole suite 100 % lines / 99.81 % branches, 80 files.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).Of the eight, line 44 (missing issue number guard) is claimed by #343 and line 96 (
require_self_approvalrefusal) by #333. The six remaining are the cluster above — acoverage-gapcovered by unit tests but not end-to-end (priority: medium).Recommendation
__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
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