Skip to content

test(issueComment): cover the /check-required-labels sweep dedup and non-Error rejections in handleIssueComment - #196

Merged
mrbobbytables merged 1 commit into
mainfrom
quality/test-issue-comment-sweep-dedup
Sep 28, 2026
Merged

mrbobbytables merged 1 commit into
mainfrom
quality/test-issue-comment-sweep-dedup

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

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 of src/issueComment/handleIssueComment.ts:

  • alreadyChecked true/false (lines 163, 179): with /lgtm /check-required-labels configured, a comment carrying both runs checkRequiredLabels exactly once (the handler, not the sweep); a comment carrying only /lgtm still runs it once via the sweep. tideOnComment runs once in both cases.
  • normalizeError non-Error branch (line 216): a handler rejecting with a string fails the run with error handling issue comment: Error: <string>; a sweep step rejecting with a string fails with Error: <string> and the later sweep step still runs.
  • Command failure and sweep failure are joined with ; into a single core.setFailed call.

Uses the file's existing sweepStubs spies on requireMatchingLabel.checkRequiredLabels / tide.tideOnComment plus a vi.spyOn(lgtm, 'lgtm') stub, so no HTTP handlers are needed.

Coverage (npm run test:coverage, base 187c5e3): handleIssueComment.ts 94.33% → 100% branches; overall branches 94.55% → 94.75%. File: 59 tests green; eslint clean. No src/ or dist/ changes.

Disjoint from #173–#194: none of those PRs touch __tests__/issueCommentTest/handleIssueComment.test.ts or src/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

…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>
@hivecommons-hive
hivecommons-hive Bot requested a review from jpmcb as a code owner September 27, 2026 03:57
@hivecommons-hive hivecommons-hive Bot added the hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 27, 2026
@hivecommons-hive

Copy link
Copy Markdown
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 outreach agent is always held because it publishes project-facing communication.

Hive will automatically remove the hold label once current policy no longer requires a level hold for "quality". If this is an outreach PR, a human must review it and remove the label.

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

/kind cleanup

🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5q9t | SHA: af3c92b

— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hold Indicates that a PR should not merge because someone has issued a /hold command. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[quality] handleIssueComment: the /check-required-labels sweep dedup and the non-Error rejection path have no tests

1 participant