Skip to content

test(bundle): drive plain /close, its write failure and the /milestone refusals through dist/index.js - #296

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

github-actions[bot] merged 3 commits into
mainfrom
quality/test-bundle-close-milestone

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Files: __tests__/bundle/closeMilestone.test.ts only (new; no src/, dist/, helper or config change). Cluster: the end-to-end arms of src/issueComment/close.ts and src/issueComment/milestone.ts — disjoint from every open hold-gated bundle PR (#242 cron jobs input, #244 /meow, #246 fixed/prefixed labels, #283 OWNERS, #286 approve review, #289 tide, #291 blunderbuss, #293 hold/sweep).

Five tests, same shape as collaborationCommands.test.ts (start() a fake GitHub, comment() / helpersFor() / repo / token from ./helpers, exact request lists):

  • /close by the issue author: no collaborator read, one PATCH /issues/1 with { state: 'closed' } and no state_reason (close.ts 33 → 56-60, never reached from dist/ before)
  • /close whose PATCH returns 500: run fails, errors names could not close issue (line 64)
  • /milestone v9 against v1.0, Sprint 2: fails with milestone "v9" not found. Available milestones: v1.0, Sprint 2; no PATCH (lines 71-73)
  • /milestone with no argument: fails with please provide a milestone to add after only the collaborator read (line 52)
  • /milestone v1.0 by a non-collaborator: fails with commenter is not authorized to set a milestone before any milestones read (line 44)

Verified on main @ 3fc21f2: npx vitest run __tests__/bundle/closeMilestone.test.ts 5/5 against the committed dist/index.js; npx eslint clean; npm run test:coverage:e2e now leaves only the HTTP-unreachable lines in both files (close.ts 24/39, milestone.ts 28/40 — missing issue number and a rejecting checkCollaborator, which swallows non-404s).

Related Issue

Closes #295


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

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

…e refusals through dist/index.js

bundle.test.ts only reaches /close via the non-collaborator no-op and
/close not-planned, and /milestone via a matching title and clear. Add
__tests__/bundle/closeMilestone.test.ts for the arms the bundle never
exercised: the author's plain /close (no collaborator read, no
state_reason), a failing issue update, an unknown milestone title, a
missing argument and a non-collaborator commenter.

Closes #295

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 06:23
@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

/kind cleanup


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

— 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 closeMilestone.test.ts:34–43. close.ts:56 is also reached by :45. Move its { state: 'closed' } body check (:42) into the :45 case.

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Addressed: dropped the author /close case and moved its { state: 'closed' } body check into the failed-update case. 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 fcecd4a: dropped the author-closes case and moved its { state: 'closed' } body check into the failed-update case.

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 removed the hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 9, 2026
@github-actions github-actions Bot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 9, 2026
@github-actions
github-actions Bot merged commit 2efe6b2 into main Oct 9, 2026
10 checks passed
@mrbobbytables
mrbobbytables deleted the quality/test-bundle-close-milestone branch October 9, 2026 17:31
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 never drives plain /close or the /milestone refusals through dist/index.js

1 participant