Repository navigation
test(approveReview): pin the user-token-not-author submit, withdrawalReason's five-file bound, lgtm skip, user casing and withdrawer order - #527
Conversation
…Reason's five-file bound, lgtm skip, user casing and withdrawer order Five single-operator mutants of src/plugins/approveReview.ts survived the full related suite (46 files / 920 tests) despite 100% line coverage: - :188 '&&' -> '||': a PAT whose login is not the author would warn about self-approval and never POST the review - :105 '>' -> '>=': exactly five uncovered files would print 'and 0 more' - :111 continue -> break: an ignored lgtm event would drop every later cancel - :113 user .toLowerCase() removed: Bob and bob would be two people - :118 .sort() removed: withdrawers listed in action order Each new case fails exactly one of those mutants. Test-only. 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 non-author PAT case observes the review write, and the withdrawal cases distinguish the five-file boundary, case-insensitive identity, lgtm skipping and sorted names.
Verified successful build-test, e2e-coverage and DCO results on head 28def9c. Any folded issue findings remain assigned to the canonical destinations in the updated scope tables.
Test Improvement
Adds five cases to
__tests__/plugins/approveReview.test.ts, one per non-equivalent mutant ofsrc/plugins/approveReview.tsthat survived the full related suite (46 files / 920 tests) despite 100 % line coverage:identity.login !== undefined && identity.login === owners.author→||approve.github_review: approved› a user token (GET /user→Prow-Bot) on a pull request bysome-authorsubmits the review:calls=['label', 'notifier', 'review'], no warninguncoveredFiles.length > reasonFiles→>=withdrawalReason› exactly five files →no approver covers a, b, c, d, econtinue→breakwithdrawalReason›carol lgtm-cancelthenbob cancelwithlgtm_acts_as_approve: false→withdrawn by bob (/approve cancel)event.user.toLowerCase()→event.userwithdrawalReason›bob cancelthenBob approve→ no withdrawal;Bob approvethenBOB cancel→withdrawn by bob.sort()removedwithdrawalReason›dave, bob, carolacting in that order → listedbob (changes requested), carol (/approve cancel), dave (/approve cancel)Verified by re-applying each mutant with the new file: every one now fails exactly one test (
npx vitest run __tests__/plugins/approveReview.test.ts→ 1 failed / 42 passed); on cleanmainthe file passes 43/43 andeslintis clean.Test-only: no
src/ordist/change. Files/functions claimed:__tests__/plugins/approveReview.test.ts(approve.github_review: approved,withdrawalReasondescribes) — disjoint from held PRs #510–#525 (#522 touchesapprove.test.ts/approveEvents.test.ts, not this file).Related Issue
Closes #526
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88