Skip to content

test(bundle): drive /cc /uncc /unassign /retitle /lock /reopen through dist/index.js - #238

Merged
github-actions[bot] merged 1 commit into
mainfrom
quality/test-bundle-collab-commands
Oct 2, 2026
Merged

github-actions[bot] merged 1 commit into
mainfrom
quality/test-bundle-collab-commands

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds __tests__/bundle/collaborationCommands.test.ts — a new file only. It reuses fakeGithub.ts and runBundle.ts to spawn the committed dist/index.js and drives the six issue_comment handlers the bundle e2e suite had never exercised: /cc, /uncc, /unassign, /retitle, /lock, /reopen (src/issueComment/{cc,uncc,unassign,retitle,lock,reopen}.ts).

21 cases, one describe per command:

  • /cc — self-review by a collaborator (POST pulls/1/requested_reviewers {reviewers:['Codertocat']}); non-collaborator self → no write; @octocat @stranger keeps the org member and drops the stranger (six unordered membership reads, then one POST); no authorized users → exit 1, no authorized users found.
  • /uncc — self (DELETE pulls/1/requested_reviewers); org-member commenter removes argument users in order; unauthorized commenter → three reads, no write.
  • /unassign — self with no authorization read; argument user after the commenter's prior comment authorizes; refused DELETE → exit 1, could not remove assignee.
  • /retitle — collaborator PATCH issues/1 with the rest of the line as title; non-collaborator → no write; empty title → zero API calls.
  • /lock — bare PUT issues/1/lock with no body; too-heated → lock_reason: 'too heated'; unknown reason → exit 1 before locking; non-collaborator → exit 1, commenter is not a collaborator user.
  • /reopen — author reopens without a collaborator read; non-author collaborator reopens after it; non-collaborator non-author → no write.
  • one body carrying /retitle and /lock runs both.

Verified on main @ c48bd6d, Node v26.10.0:

  • npx vitest run __tests__/bundle → 2 files / 109 tests pass (88 existing + 21 new)
  • npx eslint __tests__/bundle/collaborationCommands.test.ts clean
  • unit coverage unchanged (All files 99.83 | 98.35 | 100 | 99.82); this adds e2e coverage only

Disjoint from every open hold-gated PR: #236 edits one line of bundle.test.ts; none of #217, #219, #221, #223, #225, #227, #229, #230, #232, #234 touch __tests__/bundle/. This PR creates a new file and edits nothing existing.

Related Issue

Closes #237


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

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

…h dist/index.js

The bundle e2e suite never exercised these six issue_comment handlers.
Add a separate file so it stays disjoint from the pending edit to
bundle.test.ts, covering for each command the authorized path with the
recorded REST request and body, the unauthorized path with no write, and
the failing path where the handler error reaches core.setFailed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: quality <quality@hive.kubestellar.io>
@hivecommons-hive
hivecommons-hive Bot requested a review from jpmcb as a code owner September 30, 2026 04:28
@hivecommons-hive hivecommons-hive Bot added the hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 30, 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 automatically remove the hold label once current policy no longer requires a level hold for "quality". If this is an outreach PR, a human must review it and remove the label.

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

/kind cleanup


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

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

@github-actions github-actions Bot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. and removed needs-kind labels Sep 30, 2026
This was referenced Sep 30, 2026
@jeefy

jeefy commented Oct 2, 2026

Copy link
Copy Markdown
Member

/kind cleanup
/lgtm
/approve
/hold cancel

@github-actions github-actions Bot removed the hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 2, 2026
@github-actions github-actions Bot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 2, 2026
@github-actions
github-actions Bot merged commit 10036c4 into main Oct 2, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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] bundle e2e suite never drives /cc /uncc /unassign /retitle /lock /reopen through dist/index.js

1 participant