Skip to content

test(bundle): drive /assign's refused writes and empty authorized set through dist/index.js - #302

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

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

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Files: __tests__/bundle/assignArms.test.ts (new, bundle e2e). Cluster: src/issueComment/assign.ts failure arms, driven through dist/index.js against the fake GitHub. Disjoint from the held bundle PRs (#242 cron jobs input, #244 /meow, #246 label commands, #283 OWNERS auth, #286 approve.github_review, #289 merge gate labels, #291 blunderbuss, #293 hold/sweep, #296 /close + /milestone, #298 owners-label, #300 fixed labels) — none drives /assign.

Three issue_comment runs with prow-commands: /assign:

  1. /assign by a collaborator whose POST /issues/1/assignees returns 500 → exit 1, could not self assign (assign.ts:42); asserts the three authorization reads then the single write with { assignees: ['Codertocat'] }
  2. /assign @stranger @drifter where every membership / collaborator / comment read says no → exit 1, no authorized users found (assign.ts:66); asserts no POST at all and exactly the six reads (order-free, the users are authorized concurrently)
  3. /assign @octocat where octocat is an org member but the write returns 500 → exit 1, could not add assignees (assign.ts:79)

Out of scope, not reachable through the bundle over HTTP: assign.ts:29 (payload without an issue number) and :61 (the auth helpers each catch their own API errors and return false, so getOrgCollabCommentUsers cannot throw).

Measured with npm run test:coverage:e2e on main @ 3fc21f2: assign.ts 81.48 % → 92.59 % e2e lines. Unit suite unchanged (100 / 99.81 / 100 / 100). npx eslint clean on the new file.

Related Issue

Closes #301


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

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

… through dist/index.js

Adds __tests__/bundle/assignArms.test.ts covering assign.ts lines 42, 66
and 79 (could not self assign / no authorized users found / could not add
assignees) against the fake GitHub. Lines 29 and 61 are not reachable over
HTTP and stay out of scope.

Closes #301

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 12:34
@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] /assign's failure arms are never driven through dist/index.js

0 participants