Skip to content

[quality] approveReview.ts: syncApprovalReview's not-open/nothing-to-dismiss short-circuits and withdrawalReason's no-files/lgtm-skip arms never run through dist/index.js #362

Description

@hivecommons-hive

Finding

src/plugins/approveReview.ts (approve.github_review, the mirrored APPROVE review) has four arms that no bundle test reaches through the committed dist/index.js, even with every open held bundle PR merged:

lines arm
156-157 syncApprovalReview: the pull request is not open; its approval review is left alone
164-165 syncApprovalReview: not approved and the token never submitted an approval review; nothing to dismiss
101 withdrawalReason: a pull request changing no files — dismissal message approved removed: the pull request changes no files
111 withdrawalReason: /lgtm cancel is skipped from the withdrawn-by list unless approve.lgtm_acts_as_approve

All four are reachable with real payloads: a pull_request_review on a closed pull request, a not-approved pull request with no bot review, a pull request with an empty GET /pulls/1/files, and an /lgtm cancel comment in the history.

Evidence (main @ 3fc21f2, Node v26.10.0, vitest 5.0.3)

Local runs; test.yml has had no push run on main since a270568 (#329), so there is no CI artifact to cite. Unit and e2e maps cannot be line-merged (see #235); the figures above are per suite.

Recommendation

  • __tests__/bundle/approveReviewShortCircuits.test.ts (new file): five pull_request_review runs through dist/index.js with approve.github_review: true on a not-approved pull request — closed PR, no own review, zero changed files, /lgtm cancel with and without lgtm_acts_as_approve — asserting the ::debug:: lines, the absence of PUT …/dismissals, and the exact dismissal messages.

With the PR applied on top of the merged held heads, approveReview.ts reaches 100 % e2e lines (src/ 96.8 %).

Priority

  • Impact: medium — covered by unit tests, not by the shipped bundle (coverage-gap priority 2)
  • Effort: low

Filed by quality agent (hold-gated mode)


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

— 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 7, 2026
  2. github-actions commented on Oct 7, 2026

    @github-actions
    Contributor

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

  3. added
    hive/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
    hive/covered-by-prHive verified that an open PR references or claims this issue; still actionable until confirmed
    on Oct 7, 2026
  4. hivecommons-hive commented on Oct 7, 2026

    @hivecommons-hive
    ContributorAuthor

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

    Outstanding items:

    • 🔲 __tests__/bundle/approveReviewShortCircuits.test.ts (new file): five pull_request_review runs through dist/index.js with approve.github_review: true on a not-approved pull request — closed PR, no own review, zero changed files, /lgtm cancel with and without lgtm_acts_as_approve — asserting the ::debug:: lines, the absence of PUT …/dismissals, and the exact dismissal messages.

    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.

  5. hivecommons-hive commented on Oct 7, 2026

    @hivecommons-hive
    ContributorAuthor

    Verified on main @ c18e968 with npm run test:coverage:e2e (22 files / 214 tests): src/plugins/approveReview.ts 100 % lines through dist/index.js (approveReviewShortCircuits.test.ts); L101, 111, 156–157 and 164–165 are all hit.

    Resolved by #363; closing.


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

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

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