Skip to content

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

Merged
github-actions[bot] merged 3 commits into
mainfrom
quality/test-bundle-reopen-retitle-arms
Oct 9, 2026
Merged

github-actions[bot] merged 3 commits into
mainfrom
quality/test-bundle-reopen-retitle-arms

Conversation

@hivecommons-hive

@hivecommons-hive hivecommons-hive Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Test Improvement

Adds __tests__/bundle/collaborationArms.test.ts: three 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), followed by the authorization.close config reads feat(auth): opt-in authorization policy for label, hold, close and review commands #367 added after a refused collaborator check
  • /reopen by the author, PATCH /issues/1 → 500: exit 1, ::error:: includes could not open issue (src/issueComment/reopen.ts L49)
  • /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, auth.ts L98–101 now reached. The remaining lines (reopen.ts 21/36) 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 → 3 passed; npm run test:coverage:e2e → 146 passed.

Review follow-up: the /retitle collaborator-500 case was dropped (collaborationCommands.test.ts:181 covers the non-collaborator /retitle, and retitle.ts L45 was not actually reached), and the suite now runs against current main.

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.

@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

@jeefy jeefy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Drop collaborationArms.test.ts:62–71. auth.ts:98–101 is already reached by :38, and /retitle by 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.

quality added 2 commits October 7, 2026 21:50
…authorization.close reads after a refused /reopen

Signed-off-by: quality <quality@hive.kubestellar.io>
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Addressed: dropped the /retitle collaborator-500 case (and the body's retitle.ts:45 claim with it). The /reopen collaborator-500 case now also expects the authorization.close config reads that #367 added after the collaborator check refuses. Merged main too (it brings #287's meow network fix, which is what build-test was failing on).


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

— hive: agent=quality backend=copilot model=claude-fable-5.1

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Addressed in 14a0932: dropped the /retitle collaborator-500 case; the PR body no longer claims retitle.ts:45.

CI is green on the new head.


🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5q9t | SHA: 1f7d33c

— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88

@jeefy jeefy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Asks addressed; verified on current main (aa6a0f8) together with the other approved PRs.

@jeefy

jeefy commented Oct 9, 2026

Copy link
Copy Markdown
Member

/kind cleanup
/lgtm
/approve
/hold cancel

@github-actions github-actions Bot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed hold Indicates that a PR should not merge because someone has issued a /hold command. labels Oct 9, 2026
@github-actions
github-actions Bot merged commit 9b853b7 into main Oct 9, 2026
16 checks passed
@mrbobbytables
mrbobbytables deleted the quality/test-bundle-reopen-retitle-arms branch October 9, 2026 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent/quality Created by Hive for agent-filed issue provenance kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged.

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

1 participant