Repository navigation
test(bundle): drive require-matching-label's no-rule, already-correct, grace-period and comment-failure arms through dist/index.js - #316
Conversation
…, grace-period and comment-failure arms through dist/index.js Adds __tests__/bundle/requireMatchingLabelArms.test.ts: eight issues / issue_comment runs of the committed bundle against fakeGithub that reach the arms of src/plugins/requireMatchingLabel.ts no bundle test drove: a rule for the other object kind, a labeled label no rule concerns, the already-correct verdict, grace_period_duration, an already-posted missing_comment, /check-required-labels on a closed issue, and the listComments and deleteComment failures that fail the run. e2e lines on src/plugins/requireMatchingLabel.ts: 81.6% -> 98.85%. Closes #315 Signed-off-by: quality <quality@hive.kubestellar.io>
|
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 keep the |
|
Deferring until #287 (the fix) merges; no retries or pushes for this failure. 🐝 Hive Agent: — hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
|
/kind cleanup |
|
/lgtm |
Test Improvement
Adds
__tests__/bundle/requireMatchingLabelArms.test.ts(new file only; importscomment,configReads,helpersFor,repo,tokenfrom./helpers,startfrom./fakeGithub,runBundlefrom./runBundle). Eight runs of the committeddist/index.jsagainstfakeGithubreach the arms ofsrc/plugins/requireMatchingLabel.tsthatbundle.test.ts'sissues require-matching-labelblock does not:labeled area/sdk, rule^kind/applicableRules→ none (L62 false, L149–150)openedon an issue, ruleprs: truelabeled kind/bug, noneeds-kindevaluate→none(L83, L208)GET issues/1only, no writesopened,grace_period_duration: 500msPOST labels {needs-kind}opened, bot marker comment already presentpostMissingCommentearly return (L220–221)POST commentsopened,GET issues/1/comments→ 500could not list comments→ per-rule aggregation → throw (L245, L167, L172)::error::error handling issues event: require-matching-label needs-kind: could not list comments: HttpError: Server Errorlabeled kind/bug+needs-kind,DELETE issues/comments/11→ 500could not delete comment 11→ aggregation → throw (L233, L167, L172)::error::,needs-kindalready removedissue_comment /check-required-labels,issue.state: closedcheckRequiredLabelsearly return (L115–116)Measured with
npm run test:coverage:e2eonmain@ 3fc21f2:src/plugins/requireMatchingLabel.tse2e lines 81.6 % (71/87) → 98.85 % (86/87), branches 77.04 % → 96.72 %; repository e2e total 77.9 % → 78.53 %. The one remaining line, 184 (subject()throwing on a payload with neitherissuenorpull_request), is unreachable throughrun.ts'sissues/issue_commentdispatch and stays unit-only.Verification:
npx vitest run __tests__/bundle/requireMatchingLabelArms.test.ts→ 8 pass against the committeddist/index.js;npx eslint __tests__/bundle/requireMatchingLabelArms.test.tsclean;npx tsc --noEmitclean.Disjoint from every open hold-gated PR: none of #230–#314 touches
requireMatchingLabel/require_matching_label(checked each diff); the nearest, #289, is tide'smissing_labelsgate andlabelMatchwildcards inmergeGateLabels.test.ts.Related Issue
Closes #315
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88