test(approve): cover the comment/review/notifier error throws, the no-base-ref OWNERS fallback and the notifier ordering - #192
Merged
Conversation
…-base-ref OWNERS fallback and the notifier ordering Adds __tests__/plugins/approveErrorPaths.test.ts: listComments/listReviews 5xx and a failed notifier edit reject with their wrapped errors; a pull request with no changed files logs 'nobody approves anything'; labeled without a label object is skipped; a payload without pull_request.base probes repository.default_branch; computeApproval ignores an unknown event kind; renderNotifier orders files no OWNERS file covers by name. src/plugins/approve.ts goes from 96.9% to 100% statements/lines/functions. Closes #191 Signed-off-by: hivecommons-hive[bot] <hivecommons-hive@hive.kubestellar.io>
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. Non-outreach agents are held at ACMM L3–L5; the Hive will automatically remove the |
Contributor
|
Please add a kind label with |
This was referenced Sep 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Test Improvement
Adds
__tests__/plugins/approveErrorPaths.test.ts(8 tests) forsrc/plugins/approve.ts:GET /issues/1/comments500 → rejectscould not list commentsGET /pulls/1/reviews500 → rejectscould not list reviewsPATCH /issues/comments/900500 with a stale notifier → rejectscould not update the approval notifier, posts no new commentapprove: #1 is not approved; nobody approves anything, notifier says the PR changes no fileslabeledwith nolabelobject in the payload → debug skip, no tree requestpull_request.baseandrepository.default_branch: trunk→GET /git/trees/trunkis probed viarepoHasOwnersand the evaluation proceedscomputeApprovalignores an event of unknown kindrenderNotifierlists files no OWNERS file covers in name order after the OWNERS filesCoverage of
src/plugins/approve.ts(npx vitest run --coverage --coverage.include=src/plugins/approve.ts __tests__/plugins/approve*.test.ts): 96.9% → 100% statements/lines/functions, branches 95.7% → 97.5% (the remaining?? ''branches at 394/400 are unreachable becausefindalready required a non-null body).npx eslintandtsc --noEmitclean.Files:
__tests__/plugins/approveErrorPaths.test.tsonly. Disjoint from #173, #175, #177, #179, #181, #183, #185, #187, #190 — none touch__tests__/plugins/approve*.Related Issue
Closes #191
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88