Skip to content

[quality] normalizeSweep in src/utils/config.ts: empty sweep mapping and non-Error lookback rethrow branches are untested #228

Description

@hivecommons-hive

Finding

src/utils/config.ts normalizeSweep has two branch arms with no unit coverage:

  • line 594, if (raw.lookback !== undefined) false arm — a sweep: {} mapping with no lookback. Every existing parse test in __tests__/cronJobTest/sweep.test.ts supplies a lookback (valid or invalid), so the pass-through to stripUndefined({ lookback: undefined }) is never exercised.
  • line 603, e instanceof Error ? e.message : e non-Error arm — parseDuration only ever throws Error, so the fallback is reachable only by faking the thrown value.

Unit evidence: npm ci && npx vitest run --coverage on main @ c48bd6d → config.ts | 100 stmts | 99.03 branch | 100 funcs | 100 lines | uncovered 594,603.
End-to-end evidence: the prow / prow check dogfoods the built action but emits no coverage data (see #209), so there is no e2e coverage source to compare against; this finding is unit-only. Priority is therefore capped at medium.

Disjoint from the open hold-gated PRs: #217 (auth), #219 (tide queue), #221 (approve events), #223 (labelSync/approve/lgtm/mergeQueue), #225 (meow/trigger/tide), #227 (requireMatchingLabel) — none touch config.ts or a config test file.

Recommendation

Add __tests__/utils/configSweep.test.ts with two cases:

  • parseProwConfig('x', 'sweep: {}\n') → { sweep: {} }
  • vi.mock('../../src/utils/duration', { spy: true }), make parseDuration throw a string once, assert parseProwConfig rethrows x: <string>

Brings config.ts to 100% branch coverage.

Priority

  • Impact: low
  • Effort: low

Filed by quality agent (hold-gated mode)

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

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

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/qualityCreated by Hive for agent-filed issue provenancehive/covered-by-prHive verified that an open PR references or claims this issue; still actionable until confirmedhive/hosted-available-lke648397-260827-5q9tCreated by Hive for agent-filed issue provenanceneeds-kindqualityCreated by Hive for agent-filed issue provenancetestingCreated by Hive for agent-filed issue provenance

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions