Skip to content

test(bundle): drive /reopen's and /retitle's collaborator-read 500 and refused-write arms through dist/index.js - #306

Open
hivecommons-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-bundle-reopen-retitle-arms
Open

hivecommons-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-bundle-reopen-retitle-arms

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds __tests__/bundle/collaborationArms.test.ts: four issue_comment runs through dist/index.js against the fake GitHub covering the /reopen and /retitle arms that collaborationCommands.test.ts leaves out —

  • /reopen by a non-author, GET /collaborators/Codertocat → 500: exit 0, no PATCH, stdout carries ::warning::encountered unexpected error checking collaborator status: status=500 (src/utils/auth.ts checkCollaborator L98–101)
  • /reopen by the author, PATCH /issues/1 → 500: exit 1, ::error:: includes could not open issue (src/issueComment/reopen.ts L49)
  • /retitle <title>, collaborator read → 500: exit 0, no PATCH, same warning (retitle.ts L45)
  • /retitle <title> by a collaborator, PATCH /issues/1 → 500: exit 1, ::error:: includes could not update issue (retitle.ts L57)

Imports comment, helpersFor, repo, token from ./helpers; no helper, source or dist/ changes. Files/functions claimed: __tests__/bundle/collaborationArms.test.ts only; reopen(), retitle(), checkCollaborator() failure arms. Disjoint from #283 (root-OWNERS / assertRootOwner), #296 (/close, /milestone) and #302 (/assign).

Measured on main @ 3fc21f2 with npm run test:coverage:e2e: reopen.ts 13 → 14 / 16 statements, retitle.ts 15 → 16 / 18, auth.ts L98–101 now reached. The remaining lines (reopen.ts 21/36, retitle.ts 26/45) are unreachable through the bundle (the payload always carries issue.number; checkCollaborator never throws) and stay unit-only.

Verified locally: npx eslint __tests__/bundle/collaborationArms.test.ts clean; 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

…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>
@hivecommons-hive
hivecommons-hive Bot requested a review from jpmcb as a code owner October 4, 2026 16:52
@hivecommons-hive hivecommons-hive Bot added the hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 4, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

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 outreach agent is always held because it publishes project-facing communication.

Hive will keep the hold label until a human removes it. Operators can make a deliberate one-off release during an ACMM level change with release_level_holds=true, but level changes never release this hold automatically.

@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

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

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

build-test red here is the shared incident tracked in #294, not this diff: run 37218349088 on b2465ba passes all 81 test files and exits 1 only on the single ERR_TLS_CERT_ALTNAME_INVALID unhandled error originating in __tests__/issueCommentTest/meow.test.ts; the twin run on the same SHA (37218322987) is green. The fix is #287. Deferring until #294 closes — no retries.


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

— 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

Labels

hold Indicates that a PR should not merge because someone has issued a /hold command. needs-kind

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[quality] /reopen and /retitle failure arms (collaborator read 5xx, refused PATCH) are never driven through dist/index.js

0 participants