test(plugins): cover the error and fallback branches of lgtmBinding, ownersLabel and requireMatchingLabel - #204
Merged
Conversation
…ownersLabel and requireMatchingLabel Adds __tests__/plugins/pluginErrorPaths.test.ts (5 tests): - lgtmOnPullRequest binds as 'unknown' with no target_url when the labeled payload has no sender and no html_url (lgtmBinding.ts:177) - ownersLabel fails with 'could not list the repository labels' when GET /labels returns 500 (ownersLabel.ts:70) - requireMatchingLabel fails without an issue or pull request in the payload (requireMatchingLabel.ts:184) - requireMatchingLabel names the rule when GET /issues/:n/comments returns 500 (requireMatchingLabel.ts:245) - a bot comment with body: null is treated as unmarked (requireMatchingLabel.ts:248) lgtmBinding.ts and ownersLabel.ts reach 100% lines and branches; requireMatchingLabel.ts 100% lines, 98.46% branches. Signed-off-by: hivecommons-hive[bot] <hivecommons-hive[bot]@users.noreply.github.com>
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/pluginErrorPaths.test.ts(5 tests) — the only file this PR touches. Covers the five previously unexercised branches insrc/plugins/{lgtmBinding,ownersLabel,requireMatchingLabel}.ts:lgtmOnPullRequestbinds the label aslgtm by unknownand posts notarget_urlwhen thelabeledpayload has neithersendernorpull_request.html_url(lgtmBinding.ts:177).ownersLabelrejects withcould not list the repository labels: …whenGET /repos/:o/:r/labelsreturns 500 (ownersLabel.ts:70).requireMatchingLabelrejects withgithub context payload missing issue or pull requestwhen the payload has neither (requireMatchingLabel.ts:184).requireMatchingLabelrejects withrequire-matching-label needs-kind: could not list comments: …whenGET /issues/:n/commentsreturns 500 (requireMatchingLabel.ts:245).body: nullis treated as unmarked, so nothing is deleted on the remove path (requireMatchingLabel.ts:248).Coverage (
npm run test:coverage,origin/main187c5e3 + this commit):lgtmBinding.tsandownersLabel.ts100% lines/branches (were 96.29% branches and 97.14% lines);requireMatchingLabel.ts100% lines, 98.46% branches (was 97.7% / 95.38%; only the non-Errorrejection at line 167 remains). Overall lines 96.16% → 96.29%, branches 94.55% → 94.75%. Full suite 59 files green;eslintclean. Nosrc/ordist/changes.Disjoint from #173–#202: none of those PRs touch
__tests__/plugins/{lgtmBinding,ownersLabel,requireMatchingLabel}.test.tsor add a file under__tests__/plugins/other thanapproveErrorPaths,tideandtideMergeQueue.Related Issue
Closes #203
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88