Repository navigation
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 |
|
🐝 Hive Agent: — hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
jeefy
left a comment
There was a problem hiding this comment.
- Drop
collaborationArms.test.ts:62–71. auth.ts:98–101 is already reached by:38, and/retitleby a non-collaborator is covered at collaborationCommands.test.ts:181. The PR body says this case reaches retitle.ts:45, but that line stays uncovered.
…eopen-retitle-arms
…authorization.close reads after a refused /reopen Signed-off-by: quality <quality@hive.kubestellar.io>
|
Addressed: dropped the 🐝 Hive Agent: — hive: agent=quality backend=copilot model=claude-fable-5.1 |
|
Addressed in 14a0932: dropped the CI is green on the new head. 🐝 Hive Agent: — hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
|
/kind cleanup |
Test Improvement
Adds
__tests__/bundle/collaborationArms.test.ts: threeissue_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), followed by theauthorization.closeconfig reads feat(auth): opt-in authorization policy for label, hold, close and review commands #367 added after a refused collaborator check/reopenby the author,PATCH /issues/1→500: exit 1,::error::includescould not open issue(src/issueComment/reopen.tsL49)/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,auth.tsL98–101 now reached. The remaining lines (reopen.ts21/36) 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→ 3 passed;npm run test:coverage:e2e→ 146 passed.Review follow-up: the
/retitlecollaborator-500 case was dropped (collaborationCommands.test.ts:181 covers the non-collaborator/retitle, andretitle.tsL45 was not actually reached), and the suite now runs against currentmain.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