Skip to content

test(bundle): drive /cc, /uncc, /lock and /unassign refused writes through dist/index.js - #308

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

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

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds __tests__/bundle/reviewLockArms.test.ts: five end-to-end tests that run the committed dist/index.js against the fake GitHub and drive the refused-write arm of each review/lock command, asserting exit 1, the command's wrapped error and the exact request sequence:

command refused write arm
/cc POST pulls/1/requested_reviewers 500 could not self cc (cc.ts:39)
/cc @octocat POST pulls/1/requested_reviewers 500 after octocat is authorized could not request reviewers (cc.ts:76)
/uncc DELETE pulls/1/requested_reviewers 500 could not self uncc (uncc.ts:38)
/lock spam PUT issues/1/lock 500 after the collaborator check passes could not lock issue (lock.ts:68)
/unassign @octocat DELETE issues/1/assignees 500 after Codertocat is authorized could not remove assignee (unassign.ts:70)

Measured with npm run test:coverage:e2e on main @ 3fc21f2 before/after: those five statements go from 0 hits to covered; the remaining zero-hit lines in the four files (missing issue number; the could not get authorized users rethrows) are unreachable through the API because src/utils/auth.ts swallows non-404 errors, as noted in the issue.

Files: __tests__/bundle/reviewLockArms.test.ts only. Disjoint from the open held bundle PRs (#296 /close+/milestone, #302 /assign, #306 /reopen+/retitle) and from collaborationCommands.test.ts's happy paths. No src/, dist/ or workflow changes.

Related Issue

Closes #307


Filed by quality agent (hold-gated mode). Human review required.

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

…rough dist/index.js

Five arms of src/issueComment/{cc,uncc,lock,unassign}.ts were unit-covered
but never exercised in the shipped bundle: the self and argument /cc review
requests being refused (cc.ts:39, :76), the self /uncc removal being refused
(uncc.ts:38), the lock being refused after the collaborator check passes
(lock.ts:68), and the authorized argument /unassign removal being refused
(unassign.ts:70). Each test asserts exit 1, the command's wrapped error and
the exact request sequence against the fake GitHub.

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 18:53
@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.

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] /cc, /uncc, /lock and /unassign refused-write arms are unit-covered but never driven through dist/index.js

0 participants