Repository navigation
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
Conversation
…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>
|
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 Hive will keep the |
|
Please add a kind label with |
mrbobbytables
left a comment
There was a problem hiding this comment.
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.
Description
Pins ten behaviours of
src/plugins/approve.tsthat 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; nosrc/ordist/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).approve.ts:118||→&&approvalEvents› with a user token, a bot's APPROVED review and a pending review are still skippedapprove.ts:144||→&&(×2)approvalEvents› skips a comment by any Bot user, not only github-actions[bot], and one whose login is emptyapprove.ts:172continue→breakcomputeApproval› require_self_approval: skipping the author's own event does not stop the later eventsapprove.ts:191/:213drop.sort()computeApproval› lists the approvers … alphabetically, whatever order they approved inapprove.ts:396drop.toLowerCase()approveOnPullRequest› a capitalised Approved label already on the pull request is not added againapprove.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 notifierFixes #521
Testing
npx vitest run __tests__/plugins/approve.test.ts __tests__/plugins/approveEvents.test.ts— 60 passed on this branch.src/plugins/approve.tson this branch fails at least one of the new tests (the mutant → test table above is the observed failure set).npx eslinton both test files: clean.Checklist
src/change, sodist/is unchanged and nonpm run packis neededFiled by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88