feat(covgate): report build-cache pre-warm duration#35
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Make the covgate build-cache pre-warm pass observable: announce it and report its wall time.
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
Pre-warming build cache (N packages)...before it andPre-warm complete in Xafter, to the same writer as the rest of the output.prewarmCache(...)sorun()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
TestRun_Prewarm_InvokedOnce_WhenParallelAndMultiPkgto assert both new lines appear.TestRun_Prewarm_Skipped_WhenSinglePackageOrSerialto assert they do not appear when the pass is gated off.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