Skip to content

test(approveReview): pin the user-token-not-author submit, withdrawalReason's five-file bound, lgtm skip, user casing and withdrawer order - #527

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

mrbobbytables merged 1 commit into
mainfrom
quality/test-approve-review-pins

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds five cases to __tests__/plugins/approveReview.test.ts, one per non-equivalent mutant of src/plugins/approveReview.ts that survived the full related suite (46 files / 920 tests) despite 100 % line coverage:

line mutant new case
188 identity.login !== undefined && identity.login === owners.author → || approve.github_review: approved › a user token (GET /user → Prow-Bot) on a pull request by some-author submits the review: calls = ['label', 'notifier', 'review'], no warning
105 uncoveredFiles.length > reasonFiles → >= withdrawalReason › exactly five files → no approver covers a, b, c, d, e
111 continue → break withdrawalReason › carol lgtm-cancel then bob cancel with lgtm_acts_as_approve: false → withdrawn by bob (/approve cancel)
113 event.user.toLowerCase() → event.user withdrawalReason › bob cancel then Bob approve → no withdrawal; Bob approve then BOB cancel → withdrawn by bob
118 .sort() removed withdrawalReason › dave, bob, carol acting in that order → listed bob (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 clean main the file passes 43/43 and eslint is clean.

Test-only: no src/ or dist/ change. Files/functions claimed: __tests__/plugins/approveReview.test.ts (approve.github_review: approved, withdrawalReason describes) — disjoint from held PRs #510–#525 (#522 touches approve.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

…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>
@hivecommons-hive
hivecommons-hive Bot requested a review from jpmcb as a code owner October 19, 2026 17:33
@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 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.

@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 129134f into main Oct 21, 2026
15 checks passed
@mrbobbytables
mrbobbytables deleted the quality/test-approve-review-pins 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