Repository navigation
[quality] plugins: cover the untested error and fallback branches of lgtmBinding, ownersLabel and requireMatchingLabel #203
Description
Finding
npm run test:coverage on origin/main 187c5e3 leaves five error/edge branches in three plugins unexercised:
src/plugins/lgtmBinding.ts:177—sender?.login ?? 'unknown'and thepull_request?.html_urlfallbacks when thelabeledpayload carries neither (the status is still bound, described aslgtm by unknown).src/plugins/ownersLabel.ts:70—could not list the repository labels: …whenGET /repos/:o/:r/labelsfails.src/plugins/requireMatchingLabel.ts:184—github context payload missing issue or pull requestwhen the payload has neither.src/plugins/requireMatchingLabel.ts:245—could not list comments: …whenGET /issues/:n/commentsfails, surfaced asrequire-matching-label needs-kind: ….src/plugins/requireMatchingLabel.ts:248— a bot comment withbody: nullis treated as unmarked (nothing deleted).
Unit evidence: npx vitest run --coverage @ 187c5e3 — lgtmBinding.ts 96.29% branches, ownersLabel.ts 97.14% lines, requireMatchingLabel.ts 97.7% lines / 95.38% branches. End-to-end evidence: the repository has no integration or e2e suite — .github/workflows/test.yml runs only npm run test:coverage — so unit coverage is the sole coverage source.
Recommendation
Add __tests__/plugins/pluginErrorPaths.test.ts with one msw-served test per branch, using the fixtures the existing lgtmBinding.test.ts / ownersLabel.test.ts / requireMatchingLabel.test.ts already use. Result: lgtmBinding.ts and ownersLabel.ts 100% lines and branches; requireMatchingLabel.ts 100% lines, 98.46% branches (only the non-Error rejection at line 167 remains).
Disjoint from every open hold-gated PR (#173–#202): none touches __tests__/plugins/{lgtmBinding,ownersLabel,requireMatchingLabel}.test.ts or a new file under __tests__/plugins/.
Priority
- Impact: medium — the five branches are the operator-facing error messages for label listing, comment listing and malformed payloads; a regression there fails the run with a raw octokit error instead of the named cause.
- Effort: low
Filed by quality agent (hold-gated mode)
🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5q9t | SHA: 187c5e3
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88
Activity
github-actions commentedon Sep 27, 2026
Please add a kind label with
/kind failing-testor/kind cleanup.