Skip to content

feat(covgate): report build-cache pre-warm duration#35

Merged
ben-miru merged 1 commit into
mainfrom
perf/covgate-prewarm-visibility
Jun 24, 2026
Merged

feat(covgate): report build-cache pre-warm duration#35
ben-miru merged 1 commit into
mainfrom
perf/covgate-prewarm-visibility

Conversation

@ben-miru

Copy link
Copy Markdown
Contributor

What

Make the covgate build-cache pre-warm pass observable: announce it and report its wall time.

Pre-warming build cache (197 packages)...
Pre-warm complete in 1m46s

Running 197 packages with parallelism=8; progress:
...
Total time: 2m01s

Why

The pre-warm pass (added in #34) is a large slice of a covgate run but was invisible: it's deliberately excluded from "Total time" (which times only the parallel coverage phase) and emitted no output. So you couldn't see how long it took, or tell whether it was helping — which is exactly the situation that prompted this: a downstream run where the pre-warm appeared to underperform, with no way to confirm from the logs.

Change

  • Time the pre-warm and print Pre-warming build cache (N packages)... before it and Pre-warm complete in X after, to the same writer as the rest of the output.
  • Reorder so the pre-warm log sits above the "Running N packages..." progress header (clean ordering).
  • Extract the warm block into prewarmCache(...) so run() stays within the repo's function-length limit.

No behavior change to coverage measurement, thresholds, exclude handling, gating (parallelism > 1 && len(pkgs) > 1), or "Total time" — purely additive observability.

Tests

  • Extended TestRun_Prewarm_InvokedOnce_WhenParallelAndMultiPkg to assert both new lines appear.
  • Extended TestRun_Prewarm_Skipped_WhenSinglePackageOrSerial to assert they do not appear when the pass is gated off.
  • Build, vet, repo lint (custom ruleset), and the covgate self-gate (100%) all pass.

Context

This is the diagnostic prerequisite for an observed regression: when a downstream repo (backend) switched from a CI-side pre-warm step to covgate's internal self-warm, the combined warm + coverage time looked worse than the external step. With this output we can measure the pre-warm and coverage phases separately on a clean run and confirm the cause before changing the warm logic.

🤖 Generated with Claude Code

The pre-warm pass before the parallel coverage runs was invisible: it is
excluded from "Total time" (which times only the parallel phase) and emitted
no output, so its cost could not be observed or compared run-to-run.

Announce the pass ("Pre-warming build cache (N packages)...") and report its
wall time on completion ("Pre-warm complete in X"). Extract the warm logic
into prewarmCache so run() stays within the function-length limit.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ben-miru ben-miru merged commit 6a0cc47 into main Jun 24, 2026
3 checks passed
@ben-miru ben-miru deleted the perf/covgate-prewarm-visibility branch June 24, 2026 23:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant