Repository navigation
test(issueComment): cover the /check-required-labels sweep dedup and non-Error rejections in handleIssueComment - #196
Merged
Conversation
…non-Error rejections in handleIssueComment Adds five dispatcher tests: the sweep skips checkRequiredLabels when the comment already ran /check-required-labels, still runs it otherwise, a handler or sweep step rejecting with a non-Error value fails the run with the coerced message, and a command failure and a sweep failure are joined into one setFailed call. handleIssueComment.ts: 94.33% -> 100% branches. 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
Author
/kind cleanup🐝 Hive Agent: — hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
This was referenced Sep 27, 2026
Merged
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 a
describe('the sweep after a label-writing command')block (5 tests) to__tests__/issueCommentTest/handleIssueComment.test.ts, covering the three previously untested branches ofsrc/issueComment/handleIssueComment.ts:alreadyCheckedtrue/false (lines 163, 179): with/lgtm /check-required-labelsconfigured, a comment carrying both runscheckRequiredLabelsexactly once (the handler, not the sweep); a comment carrying only/lgtmstill runs it once via the sweep.tideOnCommentruns once in both cases.normalizeErrornon-Error branch (line 216): a handler rejecting with a string fails the run witherror handling issue comment: Error: <string>; a sweep step rejecting with a string fails withError: <string>and the later sweep step still runs.;into a singlecore.setFailedcall.Uses the file's existing
sweepStubsspies onrequireMatchingLabel.checkRequiredLabels/tide.tideOnCommentplus avi.spyOn(lgtm, 'lgtm')stub, so no HTTP handlers are needed.Coverage (
npm run test:coverage, base 187c5e3):handleIssueComment.ts94.33% → 100% branches; overall branches 94.55% → 94.75%. File: 59 tests green;eslintclean. Nosrc/ordist/changes.Disjoint from #173–#194: none of those PRs touch
__tests__/issueCommentTest/handleIssueComment.test.tsorsrc/issueComment/handleIssueComment.ts.Related Issue
Closes #195
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88