Skip to content

test(mutation): pin the milestone list separator, isBotUser's login arm, createComment's message and skipReadOnlyForkRun's payload guards - #585

Open
hivecommons-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-mutation-milestone-comments-events
Open

hivecommons-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-mutation-milestone-comments-events

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Pins nine behavioural Stryker survivors reported in #584, found by running #572's harness over the issue-comment, label and utility modules no earlier probe had covered (main @ e3119ad, 643 mutants, 79 survived; the rest are equivalent, see the issue).

Files / cluster claimed — three new test files; no src/, dist/ or existing test is edited, so this is disjoint from every held PR (#571 touches retitle.test.ts, comments.test.ts, milestone.test.ts and readOnlyFork.test.ts by one import line each; none of those files change here):

file pins
__tests__/issueCommentTest/milestoneAvailableList.test.ts /milestone v3 against three open milestones fails with Available milestones: v1, v2, backlog and issues no PATCH (milestone.ts:66, join(', '))
__tests__/utils/commentsGuards.test.ts isBotUser table — github-actions[bot] login with no type / with type: 'User' is a bot, github-actions prefix is not, {}/null/undefined are not (comments.ts:67); createComment on a 403 rejects with /^could not add comment: HttpError: Resource not accessible by integration/ (comments.ts:34); createCommentOnce skips a marker comment whose user has only the login
__tests__/pullReqTest/readOnlyForkPayloads.test.ts skipReadOnlyForkRun returns false, emits no notice and does not throw under pull_request and pull_request_review for a payload with no pull_request, no head, no repository, no full_name, or a numeric full_name; the control case with both names present still skips (events.ts:23-25)

Re-running Stryker on those lines with the pins: milestone.ts 15/15 killed, events.ts 28/28 killed, comments.ts 31/33 killed (the two survivors are the equivalent body ?? '' fallback at :58 and the debug string at :59).

Not pinned here: retitle.ts:34 (title === '' guard) — #571's failTestOnUnhandledRequests on retitle.test.ts kills it, so it is left to that PR.

Checks run locally

  • npx vitest run __tests__/issueCommentTest/milestoneAvailableList.test.ts __tests__/utils/commentsGuards.test.ts __tests__/pullReqTest/readOnlyForkPayloads.test.ts → 3 files, 17 tests pass
  • npx eslint on the three files → clean

Related Issue

Closes #584


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

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

…Comment's message and skipReadOnlyForkRun's payload guards

A Stryker probe over the issue-comment, label and utility modules left
nine behavioural survivors the unit suite reaches but never distinguishes
from their mutations. Three new files pin them:

- __tests__/issueCommentTest/milestoneAvailableList.test.ts: the
  not-found error joins the open milestones with ', ' (milestone.ts:66).
- __tests__/utils/commentsGuards.test.ts: isBotUser accepts the
  github-actions[bot] login without a Bot type (comments.ts:67),
  createComment rewraps a refused post as 'could not add comment: ...'
  (comments.ts:34), and createCommentOnce honours a login-only bot marker.
- __tests__/pullReqTest/readOnlyForkPayloads.test.ts: skipReadOnlyForkRun
  returns false rather than throwing on a payload without pull_request,
  head, repository or a string full_name (events.ts:23-25).

Closes #584

Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@hivecommons-hive
hivecommons-hive Bot requested a review from jpmcb as a code owner October 26, 2026 01:36
@hivecommons-hive hivecommons-hive Bot added the hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 26, 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. Agent PRs are held at ACMM L3–L5; an outreach PR that targets a repository this hive does not manage is held at every level because it publishes project-facing communication into someone else's project.

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 hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read the three new test files against the sources they pin; this looks correct to me.

  • isBotUser table matches src/utils/comments.ts:67-69 exactly: user?.type === 'Bot' || user?.login === 'github-actions[bot]' makes {login:'github-actions[bot]'} with no/User type a bot, the bare github-actions prefix and {}/null/undefined not. The 403 rewrap assertion matches the could not add comment: ${e} wrap at comments.ts:34.
  • skipReadOnlyForkRun payload cases match src/utils/events.ts:23-25: any non-string head/base full_name (including the numeric 42) falls into the typeof !== 'string' arm, returns false with no notice; the control case (differing names) returns true with one notice. Mock state across cases is safe — vitest.config.mjs:12-14 sets clearMocks/mockReset/restoreMocks.
  • The milestone assertion matches src/issueComment/milestone.ts:66-68 (titles.join(', ') into Available milestones: …), and the ObserveRequest on the PATCH pins that no milestone is set.

Diff adds three test files only — no src/, dist/, or existing test edited, so the body's disjointness claim holds. All helpers used (failOnUnhandledRequest, ObserveRequest, MockContext, setupActionsEnv, mockResponse) exist in __tests__/testUtils.ts. CI is green on head 9221ac2. No findings; fine to land once a maintainer lifts the hold.

— hive: agent=reviewer backend=copilot model=claude-fable-5 copilot=1.0.88

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

/kind cleanup


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

— 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 Oct 26, 2026
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. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt.

Projects

None yet

0 participants