MotirBuilding in public
MOTIR · moooon
onMotir
You’re viewing a public project. Anyone can view it — no account needed. Sign in to submit, upvote, or comment on requests.View-only — you can’t edit work items
MOTIR-138

2.6.4 Extend coverage gating to the Epic-2 workflow modules + re-verify thresholds

Done
Description

Estimate: 30m · Depends on: 2.6.2, 2.6.3

Close the coverage-gating gap (gap #4). The coverage.include in vitest.config.ts currently lists ONLY the four Story-1.4 work-item-model files (added by 1.4.7); Epic-2’s workflow layer is ungated, and workItemsService grew across Stories 2.3–2.5 (detail / tree / list / pagination) after the 1.4.7 numbers were measured. This subtask brings the Epic-2 modules under the same per-file ≥90% gate and re-verifies the existing ones still hold.

Steps:

  • Add lib/services/workflowsService.ts and lib/repositories/workflowsRepository.ts to coverage.include, and add per-file thresholds entries for each at { branches: 90, functions: 90, lines: 90 } — matching the existing gate shape (each file gates independently so a regression in one fails the run, not a blended average).
  • Run pnpm test:coverage and FILL any shortfall the new conformance/lifecycle suites leave on those two modules with targeted, non-duplicative tests (prefer extending the existing tests/workflows/* files; mark genuinely-unreachable defensive branches with an inline /* istanbul ignore … -- <reason> */, the same way 1.4.7 handled the SQLSTATE parser fallbacks — do not lower the threshold).
  • Re-verify the four work-item modules still pass ≥90% after Epic-2 growth; if 2.3–2.5 added an under-covered branch to workItemsService, add the missing case (in the appropriate existing test file).
  • Update the coverage-numbers table in tests/EPIC2_COVERAGE.md (2.6.1) with the final figures for all six gated modules.

CI already runs pnpm test:coverage in the test job (1.4.7), so the new thresholds gate every future PR automatically — no workflow-file change needed. Depends on 2.6.2 + 2.6.3 so their new tests count toward coverage before the gate tightens.

Acceptance criteria

  • vitest.config.ts coverage.include includes the two workflow modules; coverage.thresholds has per-file ≥90% (branches/functions/lines) entries for both.
  • pnpm test:coverage passes with all SIX modules (4 work-item + 2 workflow) at ≥90% on every metric.
  • Any unreachable defensive branch excluded via an inline istanbul ignore with a stated reason — the threshold is NOT lowered.
  • The four pre-existing work-item modules still meet the gate after Epic-2 growth (any newly-uncovered branch from 2.3–2.5 is filled).
  • tests/EPIC2_COVERAGE.md numbers table updated to the final run.

Context refs

  • vitest.config.ts — the coverage block (provider v8, include, per-file thresholds) to extend
  • lib/services/workflowsService.ts, lib/repositories/workflowsRepository.ts — the newly-gated modules
  • tests/workflows/*.test.ts — where to add fill cases
  • tests/integration/work-items/TEST_COVERAGE.md — the 1.4.7 precedent (istanbul-ignore convention + numbers table)
  • .github/workflows/ci.yml — the test job already runs test:coverage (gates automatically)