Repository navigation
test(bundle): drive /approve's membership-mode review failures and no-review cancel through dist/index.js - #355
hivecommons-hive[bot] wants to merge 3 commits into
Conversation
…-review cancel through dist/index.js Adds __tests__/bundle/approveMembershipArms.test.ts: five issue_comment runs on a pull request whose repository has no OWNERS files, where /approve falls back to org membership and a GitHub review from the bot. Covers the refused APPROVE review, the failed review listing, the cancel with no bot APPROVED review, the refused dismissal, and the refusal whose comment write fails (src/issueComment/approve.ts lines 67, 82, 131, 160, 173, 185). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: quality <quality@hive.kubestellar.io>
|
Important Held for human review by the hive's ACMM level gate. This PR was opened by the "quality" agent while Hive policy required a human checkpoint for that agent. Non-outreach agents are held at ACMM L3–L5; the Hive will keep the |
|
Please add a kind label with |
jeefy
left a comment
There was a problem hiding this comment.
All five cases add coverage, but one pins three whole error strings.
approveMembershipArms.test.ts:120–124: usetoHaveLength(3)plus fragments (is not a org member or collaborator,Could not comment with an auth error) instead oftoEqualon strings that containHttpError: boomand theTypeError:wrapper.
…t the authorization.review reads Signed-off-by: quality <quality@hive.kubestellar.io>
|
Addressed: the three error lines are now 🐝 Hive Agent: — hive: agent=quality backend=copilot model=claude-fable-5.1 |
Test Improvement
Adds
__tests__/bundle/approveMembershipArms.test.ts(new file only;helpers.ts,bundle.test.ts,fakeGithub.ts, source anddist/untouched). Fiveissue_commentruns through the committeddist/index.jsagainst the fake GitHub, on a pull request whose repository has no OWNERS files so/approvefalls back to org membership and a bot GitHub review — the failure arms ofsrc/issueComment/approve.tsthe bundle suite never reached:/approveby an org memberPOST …/pulls/1/reviews500could not create review(L82); body{event:'APPROVE', comments:[]}/approve cancelGET …/pulls/1/reviews500could not remove latest review: Error: could not list reviews for PR 1(L67, L160)/approve cancelAPPROVEDreview (user review, botDISMISSED, botCOMMENTED)no latest review found to cancel(L173), no dismissal/approve cancelPUT …/reviews/12/dismissals500could not dismiss review(L185); dismissal message names the commenter/approveby a stranger (members 404, collaborator 404)POST …/issues/1/comments500::error::lines in order: the refusal,Could not comment with an auth error: Error: could not add comment: HttpError: boom(L131), and the dispatcher's wrap of the refusalEach test asserts the exact request sequence via
expectCommandThenConfig: the OWNERS/membership reads, the command's own calls, then the post-command sweep (config reads,GET pulls/1, base-branch OWNERS probe, merge-queue query), which still runs after the failure.Cluster:
src/issueComment/approve.tsL67, 82, 131, 160, 173, 185. Disjoint from the held bundle PRs — #343 claims L44 (missing issue number) and #333 claims L96 (require_self_approval); #286 drivesapprove.github_review, which is the OWNERS-mode mirror, not this path.Evidence (
main@ 3fc21f2, Node v26.10.0, vitest 5.0.3)issueComment/approve.tslinesnpx vitest run --coverage)npm run test:coverage:e2e)Remaining e2e-missed: L44 (#343) and L96 (#333). Whole-bundle e2e: 77.90 % → 78.24 % lines.
npx eslintclean; 5/5 pass in ~1.3 s.Related Issue
Closes #354
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88