Repository navigation
test(assign,cc): pin that /assign and /cc write only the authorized subset of a mixed argument list - #545
Conversation
…ubset of a mixed argument list
A single-operator mutation probe over src/issueComment/{assign,unassign,cc,uncc}.ts
(24 mutants, npx vitest related <file> --run) left two survivors: replacing
assignees: authUsers with assignees: commentArgs in assign.ts, and the same swap
for reviewers in cc.ts, passed all 576 related tests. Every unit case either
authorizes every argument user or none, so the write body never differed from
the raw arguments.
Adds one case to each file where the arguments mix an org member with a user
who fails all three checks, asserting the POST carries only the authorized
user. The two mutants now fail one test each.
Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
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. Agent PRs are held at ACMM L3–L5; an Hive will keep the |
|
Please add a kind label with |
mrbobbytables
left a comment
There was a problem hiding this comment.
Copilot review performed under the maintainer's explicit authorization to update, review, release reviewed holds, and merge eligible PRs in this cleanup.
The mixed authorized/unauthorized argument fixtures assert the exact filtered write body independently for /assign and /cc; no production authorization behavior changes.
Verified successful build-test, e2e-coverage and DCO results on head aaa2a9f. Any folded issue findings remain assigned to the canonical destinations in the updated scope tables.
Test Improvement
Files:
__tests__/issueCommentTest/assign.test.ts,__tests__/issueCommentTest/cc.test.ts(oneitadded to each). Nosrc/,dist/,docs/or config change. Disjoint from every open held PR (#510–#544): the only one touching__tests__/issueCommentTest/is #524 (trigger.test.ts); none touchesassign.ts/cc.tsor their tests.A single-operator mutation probe over
src/issueComment/{assign,unassign,cc,uncc}.tsonmain@ 88241f4 — 24 mutants, each run againstnpx vitest related <file> --run(576 tests) — left two survivors, the same shape in both files:src/issueComment/assign.tsassignees: authUsers→assignees: commentArgssrc/issueComment/cc.tsreviewers: authUsers→reviewers: commentArgsThe other 22 (the
length === 0dispatch,case 0, everyisAuthorized/isCollaborator/isAuthUserguard, and each self-target body in all four files) were killed. They survive because every unit case either authorizes every argument user (/assign @some-user @other-user, both org members) or none, so the write body never differs from the raw argument list.getOrgCollabCommentUsers' filter is pinned in__tests__/utils/auth.test.ts:284; nothing at the command level pinned thatassign/ccsend the filtered list.This adds, to each file, a case where
/assign @some-user @stranger(resp./cc) hassome-useran org member andstranger404 on all three checks, asserting the POST body is exactly{ assignees: ['some-user'] }/{ reviewers: ['some-user'] }.Coverage evidence. Unit (
npm run test:coverage, 88241f4, local): both files already 100 % lines/branches — this is a mutation gap, not a line gap. End-to-end (npm run test:coverage:e2e, same revision, local): the mixed case is exercised throughdist/index.jsby__tests__/bundle/bundle.test.ts:846(/assign @octocat @stranger) and__tests__/bundle/collaborationCommands.test.ts:61(/cc, "dropping the rest"), but those only see a regression afternpm run packandvitest relatedcannot select them. e2e-covered, unit-unpinned: priority 3 (low).Verification (this branch, local)
npx vitest run __tests__/issueCommentTest/assign.test.ts __tests__/issueCommentTest/cc.test.ts: 21 passedvitest relatedset with theassign.tsmutant applied: 1 failed / 577 passed; with thecc.tsmutant applied: 1 failed / 577 passed (mutants reverted, not committed)npx eslinton both files: cleanRelated Issue
Refs #507 — the hive consolidated this finding onto that tracker (
already_existed: true, consolidated: true) when filed; #507's own subject (auth.ts:24, thegetErrorDetailsfallback) is #510's and stays with it. This PR is the complete fix for theassign/ccauthorized-subset finding it names.Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88