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
Open
hivecommons-hive[bot] wants to merge 1 commit into
hivecommons-hive[bot] wants to merge 1 commit into
Conversation
…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>
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 Hive will keep the |
Contributor
|
Please add a kind label with |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Test Improvement
Adds
__tests__/bundle/reviewLockArms.test.ts: five end-to-end tests that run the committeddist/index.jsagainst 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:/ccPOST pulls/1/requested_reviewers500could not self cc(cc.ts:39)/cc @octocatPOST pulls/1/requested_reviewers500 after octocat is authorizedcould not request reviewers(cc.ts:76)/unccDELETE pulls/1/requested_reviewers500could not self uncc(uncc.ts:38)/lock spamPUT issues/1/lock500 after the collaborator check passescould not lock issue(lock.ts:68)/unassign @octocatDELETE issues/1/assignees500 after Codertocat is authorizedcould not remove assignee(unassign.ts:70)Measured with
npm run test:coverage:e2eonmain@ 3fc21f2 before/after: those five statements go from 0 hits to covered; the remaining zero-hit lines in the four files (missing issue number; thecould not get authorized usersrethrows) are unreachable through the API becausesrc/utils/auth.tsswallows non-404 errors, as noted in the issue.Files:
__tests__/bundle/reviewLockArms.test.tsonly. Disjoint from the open held bundle PRs (#296/close+/milestone, #302/assign, #306/reopen+/retitle) and fromcollaborationCommands.test.ts's happy paths. Nosrc/,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