Skip to content

test(config): pin normalizeBlunderbuss' non-Error parseDuration arm and v8-ignore it for the bundle - #563

Open
hivecommons-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-config-blunderbuss-delay-non-error
Open

hivecommons-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-config-blunderbuss-delay-non-error

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Description

normalizeBlunderbuss in src/utils/config.ts rewraps a parseDuration failure for blunderbuss.delay as `${source}: ${e instanceof Error ? e.message : e}` (line 618 at main@e3119ad). parseDuration only ever throws Error, so the non-Error alternate was the single unit-uncovered branch left in config.ts and the bundle run listed the same line. The sibling sweep.lookback arm (config.ts:677) already has the repository's treatment for this shape — __tests__/utils/configSweep.test.ts drives it, and it carries a v8 ignore next hint for the bundle (#549). This PR gives the blunderbuss.delay arm, added in #530, the same two things.

Files/functions claimed:

file change
__tests__/utils/configBlunderbussDelay.test.ts (new) spies parseDuration (vi.mock('../../src/utils/duration', { spy: true })) to throw the string clock skew; asserts parseProwConfig('x', 'blunderbuss:\n delay: 1h\n') throws x: clock skew
src/utils/config.ts comment-only: // parseDuration throws only Error and the /* v8 ignore next -- non-Error arm unreachable from dist/index.js; configBlunderbussDelay.test.ts drives it */ hint on the alternate, byte-for-byte the form used at the sweep.lookback arm
dist/index.js npm run pack after the comment change (the hint lands in the bundle exactly as #549's did)

Source behaviour is unchanged. The live Error arm (x: invalid blunderbuss.delay 'later': …) stays asserted by __tests__/cronJobTest/sweep.test.ts and __tests__/bundle/blunderbussDelay.test.ts; this PR does not touch either file.

Disjoint from every open held PR: #553 (auth.ts arms), #555 / #559 (__tests__/bundle/blunderbussDelay.test.ts), #556 (e2e floor), #557 (tide.test.ts), #558 (sweep.test.ts), #561 / #562 (new sweep* test files). None of them edit __tests__/utils/, src/utils/config.ts or dist/index.js.

Refs #560 — lands the folded config.ts:618 variant the hive attached to that tracker; the tracker's original sweep.ts:80 finding is delivered by #561 and the sweep.ts:208 variant by #562, so #560 stays open until those merge.

Coverage evidence

  • Unit, npm run test:coverage on main@e3119ad (2330 tests, 99.92 % lines / 99.35 % branches): config.ts 100 / 99.61, uncovered 618; coverage/lcov.info has BRDA:618,76,1,0. With this PR the alternate is driven (DA:619,1 from the new test) and the hint removes its BRDA record, as at config.ts:677.
  • End-to-end, npm run test:coverage:e2e on main@e3119ad (528 tests, 100 % lines / 99.46 % branches): config.ts 100 / 99.61, uncovered 618 — unreachable from the bundle by construction, hence the hint rather than a scenario.
  • The two runs are read separately on purpose (docs/contributing.md: their maps come from different transforms and do not combine). This is a plain zero-hit arm, not one of the four documented negative-count phantoms.

Testing

  • npx vitest run __tests__/utils/configBlunderbussDelay.test.ts → 1 passed
  • npx vitest run __tests__/utils --coverage --coverage.include=src/utils/config.ts → 504 passed; line 619 (the catch) hit, no BRDA for the ignored alternate
  • npx eslint src/utils/config.ts __tests__/utils/configBlunderbussDelay.test.ts → clean
  • npm run build && npm run pack → dist/index.js committed

Checklist

  • I ran npm run build, npm run lint on the touched files and npm run pack
  • I ran npm run pack and committed dist/
  • Commits are signed off (DCO)
  • No new dependencies
  • Self-review done
  • Comment explains the hint
  • Documentation unchanged (nothing to update)
  • No new warnings

Filed by quality agent (hold-gated mode). Human review required.

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

…nd v8-ignore it for the bundle

parseDuration throws only Error, so the non-Error alternate of the
blunderbuss.delay catch in normalizeBlunderbuss is unreachable from
dist/index.js. Drive it from a unit test that spies parseDuration to
throw a string, exactly as configSweep.test.ts does for sweep.lookback,
and give the alternate the same v8 ignore hint that arm carries.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@hivecommons-hive
hivecommons-hive Bot requested a review from jpmcb as a code owner October 22, 2026 05:36
@hivecommons-hive hivecommons-hive Bot added the hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 22, 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. Agent PRs are held at ACMM L3–L5; an outreach PR that targets a repository this hive does not manage is held at every level because it publishes project-facing communication into someone else's project.

Hive will keep the hold label until a human removes it. Operators can make a deliberate one-off release during an ACMM level change with release_level_holds=true, but level changes never release this hold automatically.

@github-actions

Copy link
Copy Markdown
Contributor

Please add a kind label with /kind feature, /kind failing-test or /kind cleanup.

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. needs-kind

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants