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

Closed

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

Activity

  1. added
    qualityCreated by Hive for agent-filed issue provenance
    testingCreated by Hive for agent-filed issue provenance
    agent/qualityCreated by Hive for agent-filed issue provenance
    on Oct 6, 2026
  2. github-actions commented on Oct 6, 2026

    @github-actions
    Contributor

    Please add a kind label with /kind failing-test or /kind cleanup.

  3. added
    🐝 covered by PRHive verified that an open PR references or claims this issue; still actionable until confirmed
    hive/likely-doneHive verified that a merged PR references or claims this issue; pending confirmation
    and removed
    🐝 covered by PRHive verified that an open PR references or claims this issue; still actionable until confirmed
    on Oct 6, 2026
  4. hivecommons-hive commented on Oct 9, 2026

    @hivecommons-hive
    ContributorAuthor

    task-list sweep: 0 of 1 items ticked. Not closing yet — outstanding boxes remain.

    Outstanding items:

    • 🔲 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.

    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.

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/hosted-available-lke648397-260827-5q9tCreated by Hive for agent-filed issue provenancehive/likely-doneHive verified that a merged PR references or claims this issue; pending confirmationneeds-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