Finding
npx vitest run --coverage (v8) on main @ c48bd6d reports src/plugins/approve.ts at 100% lines but 97.51% branches, with these reachable branches uncovered:
evaluateOnOwnersRepo (L480): the repoHasOwners(...) fallback taken when context.payload.pull_request has no base.ref. Every existing test uses the pullReqOpenedEvent fixture, whose base ref is master, so only branchHasOwners is exercised.
upsertNotifier (L394): (comment.body ?? '') when a bot comment has body: null — the notifier lookup must skip it rather than throw or match it.
effectiveKind (L225): lgtm-cancel with lgtm_acts_as_approve unset returns 'ignore'; existing tests only cover /lgtm under lgtm_acts_as_approve: true.
Remaining branches at L225 default: (exhaustive union) and L400 (existing.body ?? '' after .includes() proved it non-null) are unreachable and are not part of this finding.
End-to-end evidence: the repository defines no integration/e2e suite — .github/workflows/test.yml runs npm run test:coverage (vitest unit tests) only — so there is no second coverage source to combine.
Recommendation
Add three cases to __tests__/plugins/approveEvents.test.ts under describe('approveOnPullRequest') using the existing serve()/prEvent() harness:
Priority
- Impact: low — approve is the merge gate's approval source, but these are edge branches with existing 100% line coverage
- Effort: low
Filed by quality agent (hold-gated mode)
🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5q9t | SHA: c48bd6d
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88
Finding
npx vitest run --coverage(v8) onmain@ c48bd6d reportssrc/plugins/approve.tsat 100% lines but 97.51% branches, with these reachable branches uncovered:evaluateOnOwnersRepo(L480): therepoHasOwners(...)fallback taken whencontext.payload.pull_requesthas nobase.ref. Every existing test uses thepullReqOpenedEventfixture, whose base ref ismaster, so onlybranchHasOwnersis exercised.upsertNotifier(L394):(comment.body ?? '')when a bot comment hasbody: null— the notifier lookup must skip it rather than throw or match it.effectiveKind(L225):lgtm-cancelwithlgtm_acts_as_approveunset returns'ignore'; existing tests only cover/lgtmunderlgtm_acts_as_approve: true.Remaining branches at L225
default:(exhaustive union) and L400 (existing.body ?? ''after.includes()proved it non-null) are unreachable and are not part of this finding.End-to-end evidence: the repository defines no integration/e2e suite —
.github/workflows/test.ymlrunsnpm run test:coverage(vitest unit tests) only — so there is no second coverage source to combine.Recommendation
Add three cases to
__tests__/plugins/approveEvents.test.tsunderdescribe('approveOnPullRequest')using the existingserve()/prEvent()harness:pull_requestpayload withoutbase→defaultBranchTree(master) is probed,pulls/1is not fetched, debug logsapprove: the base branch has no OWNERS filesbody: nullahead of/approve→ a new notifier is posted, nothing is patched/approveby bob and carol followed by/lgtm cancelby bob with default settings →approvedis still added and both remain listed as approversPriority
Filed by quality agent (hold-gated mode)
🐝 Hive Agent:
quality| Instance:hosted-available-lke648397-260827-5q9t| SHA:c48bd6d— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88