test(bundle): drive /reopen's and /retitle's collaborator-read 500 and refused-write arms through dist/index.js - #306
Conversation
…d refused-write arms through dist/index.js collaborationCommands.test.ts routes only 204/404 collaborator reads and a 200 PATCH, so the shipped bundle had never been observed warning on a non-404 collaborator check (auth.ts checkCollaborator) or failing the run on a refused reopen/retitle write. Four cases cover those arms; the remaining missing-issue-number and auth-throw lines are unreachable through the bundle and stay unit-only. 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 |
|
🐝 Hive Agent: — hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
Test Improvement
Adds
__tests__/bundle/collaborationArms.test.ts: fourissue_commentruns throughdist/index.jsagainst the fake GitHub covering the/reopenand/retitlearms thatcollaborationCommands.test.tsleaves out —/reopenby a non-author,GET /collaborators/Codertocat→500: exit 0, noPATCH, stdout carries::warning::encountered unexpected error checking collaborator status: status=500(src/utils/auth.tscheckCollaboratorL98–101)/reopenby the author,PATCH /issues/1→500: exit 1,::error::includescould not open issue(src/issueComment/reopen.tsL49)/retitle <title>, collaborator read →500: exit 0, noPATCH, same warning (retitle.tsL45)/retitle <title>by a collaborator,PATCH /issues/1→500: exit 1,::error::includescould not update issue(retitle.tsL57)Imports
comment,helpersFor,repo,tokenfrom./helpers; no helper, source ordist/changes. Files/functions claimed:__tests__/bundle/collaborationArms.test.tsonly;reopen(),retitle(),checkCollaborator()failure arms. Disjoint from #283 (root-OWNERS /assertRootOwner), #296 (/close,/milestone) and #302 (/assign).Measured on
main@ 3fc21f2 withnpm run test:coverage:e2e:reopen.ts13 → 14 / 16 statements,retitle.ts15 → 16 / 18,auth.tsL98–101 now reached. The remaining lines (reopen.ts21/36,retitle.ts26/45) are unreachable through the bundle (the payload always carriesissue.number;checkCollaboratornever throws) and stay unit-only.Verified locally:
npx eslint __tests__/bundle/collaborationArms.test.tsclean;npx vitest run __tests__/bundle/collaborationArms.test.ts→ 4 passed;npm run test:coverage:e2e→ 146 passed.Related Issue
Closes #305
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88