Repository navigation
chore(coverage): v8-ignore the bundle-unreachable fallback arms in run.ts:40, command.ts:23 and config.ts:657 - #544
Conversation
…n.ts, command.ts and config.ts The e2e coverage run reports three fallback arms at zero hits that no input to dist/index.js can reach: - run.ts: the String(error) arm of run()'s catch. Every handler folds its rejections into an Error (runEventHandlers, normalizeError, the jobs .catch), and the only throw that reaches this catch from the bundle is a built-in TypeError. - command.ts: getLineArgs's ?? '' fallback. Its callers (/milestone, /retitle) run only after hasCommand matched the same pattern. - config.ts: the non-Error arm in normalizeSweep; parseDuration throws only Error. Mark them with /* v8 ignore next */, the form config.ts already uses for its test-only hooks. The hint sits on the alternate of the ?: so the Error arms stay measured; for the ?? it has to sit on the statement because the coverage mapper does not honour a hint on one operand of a logical expression. No behaviour change; the unit tests that drive the arms stay. dist/ repacked. Refs #523 Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
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. Agent PRs are held at ACMM L3–L5; an Hive will keep the |
|
Please add a kind label with |
mrbobbytables
left a comment
There was a problem hiding this comment.
Copilot review performed under the maintainer's explicit authorization to update, review, release reviewed holds, and merge eligible PRs in this cleanup.
Reviewed the guarded getLineArgs callers and wrapped run/config failures. The annotations preserve defensive behavior; ternary ignores target only the fallback and the documented logical-expression limitation accounts for the statement-level command hint.
Verified successful build-test, e2e-coverage and DCO results on head fae60ed. Any folded issue findings remain assigned to the canonical destinations in the updated scope tables.
…overage work landed (#556) Measured npm run test:coverage:e2e on main@e3119ad with #528, #537, #544, #548 and #549 merged: 100 / 99.46 / 100 / 100 (1686/1695 branches). The 97 floor set at 1062ce7 (97.96 measured) now sits 2.46 pp under main; 98 keeps the same just-under-main convention. 99 was considered and not taken: it would leave 8 branches of slack, two of which are already consumed by the negative-count await artifacts at approve.ts:504 and auth.ts:220 that no test can recover. Closes #551 Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com> Co-authored-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Coverage annotation
npm run test:coverage:e2eonmain@ 88241f4 reports three fallback arms at zero hits that no input todist/index.jscan reach. This marks each with/* v8 ignore next -- … */, the formsrc/utils/config.ts:219already uses and #510 / #537 apply to the same class of arm. No behaviour changes; the unit tests that drive the arms stay.dist/repacked (comment lines only).src/run.tsBRDA:40,2,1,0run()'scatch: theString(error)armErrorbeforerun()sees them (runEventHandlersatevents.ts:50,normalizeErrorathandleIssueComment.ts:217, thejobs.catchinhandlePullReq.ts:76/handleCronJob.ts:69). The one throw that does reach thiscatchfrom the bundle — found by instrumenting the coverage bundle locally — isTypeError: body.replace is not a functionfromsplitLineson a non-string comment body: a built-in, so anError.src/utils/command.tsBRDA:23,0,1,0getLineArgs's.at(-1) ?? ''/milestone(milestone.ts:43) and/retitle(retitle.ts:31), run only afterhandleIssueCommentmatched the body withhasCommandfor the samecommandPattern, and neither has an alias incommandAliases, sofindCommandArgsis never empty here.src/utils/config.tsBRDA:657,83,1,0normalizeSweep'se instanceof Error ? e.message : e, the non-ErrorarmparseDuration(duration.ts:26) throws onlynew Error(...).Placement: the hint sits on the alternate of the
?:inrun.tsandconfig.ts, so theirErrorarms stay measured (run.tsBRF 6 → 5 in the unit lane, the hit arm kept).@vitest/coverage-v8's AST mapper does not honour a hint on one operand of a??(verified with a scratch file: inline hints before/inside the logical expression change nothing), so forcommand.tsit sits on thereturnstatement, as #537 did forlgtm.ts.Files / functions claimed:
src/run.ts(run, thecatch),src/utils/command.ts(getLineArgs),src/utils/config.ts(normalizeSweep, thecatchafterparseDuration),dist/index.js. Disjoint insrc/from every open held PR: #510 isauth.ts, #537 islgtm.ts, #528 drivesevents.ts:50/handleIssueComment.ts:217/labelSync.ts:107for real and touches only__tests__/bundle/.dist/index.jsis shared with #510 and #537;git merge-tree --write-tree HEAD pr-510|pr-537|pr-528exits 0 for each (no textual conflict).Verification (this branch, local)
npm run build && npm run lint && npm run pack: clean (the onejsdoc/check-param-nameswarning incc.ts:81is present onmain);dist/index.jsdiff is the comment linesnpm run test:coverage:e2e: 83 files / 502 tests pass;coverage-e2e/lcov.infono longer carriesBRDA:40(run.ts),BRDA:23(command.ts) orBRDA:657(config.ts) at zero hits; branches 1636/1656 (98.79 %) → 1635/1652 (98.97 %), zero-hit records 18 → 15, every remaining one is named by an open held PRnpm run test:coverage: 163 files / 2206 tests pass, 100 % lines / 99.75 % branches (unchanged), thresholds metRelated Issue
Refs #523 — the hive consolidated this finding onto that tracker (
already_existed: true, consolidated: true). This PR is the complete fix for the foldedrun.ts:40/config.ts:657/command.ts:23v8 ignoreentries it names; the issue's owntrigger.tsboxes are #524's, so #524 is what closes it.Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88