Skip to content

Remove misleading (N/M cached) fraction from build progress summary #310

@schmitthub

Description

@schmitthub

Problem

Build completion summary prints (N/M cached) where M includes vertices that are structurally incapable of being cached (e.g. exporting to image).

Example clean build output:

✓ Built clawker-clawker:latest (2/52 cached)

51 build steps shown in tree (45 + 4 + 2) + 1 ungrouped exporting to image vertex = 52 in the denominator. But the exporter is emitted via progress.OneOff (util/progress/progress.go:288 in buildkit), which writes only Started/Completed on its Status struct — there's no Cached field on that path. Exporter vertices cannot emit Cached=true. Max achievable ratio is 51/52 regardless of cache state.

Why this is wrong

The fraction's denominator is "all visible non-[internal] vertices," not "all cacheable vertices." That makes the ratio meaningless as a cache-hit-rate.

Upstream precedent

Docker/buildx/buildkit do not show any aggregate cached count:

  • buildkit/util/progress/progressui/display.go:856-858 — per-vertex "CACHED " name prefix in TTY mode
  • buildkit/util/progress/progressui/printer.go:190 — per-vertex #N CACHED line in plain mode
  • No countCached field anywhere; countCompleted only flips status to FINISHED

clawker invented this fraction; there's no reference shape to match.

Proposed fix

Drop the fraction entirely. Match upstream behavior: cached vertices are already labeled per-step inside the stage tree. Aggregate ratio adds no signal.

internal/tui/progress.go:1067-1082 — remove cachedCount/visibleCount loop and the (%d/%d cached) suffix on the summary line.

Out of scope

Not doing this now — filing for future cleanup.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions