Skip to content

[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

@hivecommons-hive

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.ts 51/51 lines (100 %); whole suite 100 % lines / 99.81 % branches, 80 files.
  • End-to-end: npm run test:coverage:e2e → src/issueComment/approve.ts 43/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 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
  • 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

No activity

Activity on this issue will appear here.

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