Skip to content

test(approve): pin the any-Bot comment and user-token review skips, the require_self_approval continue, approver ordering, label casing and isBot's notifier match - #522

Merged
mrbobbytables merged 1 commit into
mainfrom
quality/test-approve-mutation-survivors
Oct 21, 2026
Merged

mrbobbytables merged 1 commit into
mainfrom
quality/test-approve-mutation-survivors

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Description

Pins ten behaviours of src/plugins/approve.ts that a single-operator mutation probe showed the suite did not assert, although the file is 100 % line-covered in both the unit and the bundle e2e run. Tests only; no src/ or dist/ change.

Files / functions claimed: __tests__/plugins/approve.test.ts (approvalEvents, computeApproval) and __tests__/plugins/approveEvents.test.ts (approveOnPullRequest → syncLabel, upsertNotifier/isBot). Disjoint from the open held PRs #510–#520 (auth, contributing, remove, command/labelMatch, sweep, tide, requireMatchingLabel).

mutant new test
approve.ts:118 ||→&& approvalEvents › with a user token, a bot's APPROVED review and a pending review are still skipped
approve.ts:144 ||→&& (×2) approvalEvents › skips a comment by any Bot user, not only github-actions[bot], and one whose login is empty
approve.ts:172 continue→break computeApproval › require_self_approval: skipping the author's own event does not stop the later events
approve.ts:191 / :213 drop .sort() computeApproval › lists the approvers … alphabetically, whatever order they approved in
approve.ts:396 drop .toLowerCase() approveOnPullRequest › a capitalised Approved label already on the pull request is not added again
approve.ts:430 ===→!== (×2), ||→&& approveOnPullRequest › a notifier posted by another App's bot is edited in place; a human quoting the marker is not mistaken for the notifier

Fixes #521

Testing

  • npx vitest run __tests__/plugins/approve.test.ts __tests__/plugins/approveEvents.test.ts — 60 passed on this branch.
  • Each of the ten mutants re-applied to src/plugins/approve.ts on this branch fails at least one of the new tests (the mutant → test table above is the observed failure set).
  • npx eslint on both test files: clean.

Checklist

  • Commits are signed off (DCO)
  • No src/ change, so dist/ is unchanged and no npm run pack is needed
  • No new dependencies
  • Self-review done

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

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

…equire_self_approval continue, approver ordering, label casing and the isBot notifier match

Ten single-operator mutants of src/plugins/approve.ts survived the full
'vitest related' set although the file is 100% line-covered: the humanLogin
and approvalEvents guards (:118, :144), the require_self_approval continue
(:172), both approver sorts (:191, :213), syncLabel's case fold (:396) and
all three operators of isBot (:430). Each of the ten new assertions fails
under exactly those mutants and passes on main.

Fixes #521

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 19, 2026 12:06
@hivecommons-hive hivecommons-hive Bot added the hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 19, 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.

@github-actions

Copy link
Copy Markdown
Contributor

Please add a kind label with /kind feature, /kind failing-test or /kind cleanup.

@mrbobbytables mrbobbytables 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.

Copilot review performed under the maintainer's explicit authorization to update, review, release reviewed holds, and merge eligible PRs in this cleanup.

The fixtures now distinguish bot/user identities, author-event skipping from terminating the event loop, stable ordering, existing label casing, and bot notifier updates from human marker quotes.

Verified successful build-test, e2e-coverage and DCO results on head b04bdb4. Any folded issue findings remain assigned to the canonical destinations in the updated scope tables.

@mrbobbytables mrbobbytables added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. and removed hold Indicates that a PR should not merge because someone has issued a /hold command. needs-kind labels Oct 21, 2026
@mrbobbytables
mrbobbytables merged commit 457e724 into main Oct 21, 2026
18 checks passed
@mrbobbytables
mrbobbytables deleted the quality/test-approve-mutation-survivors branch October 26, 2026 20:19
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.

Projects

None yet

1 participant