feat: Cache misses are reported with a reason
When skaffold build or skaffold dev decides to rebuild an artifact, the only
output is:
Checking cache...
- app: Not found. BuildingThat line is the same whether:
- a source file the artifact depends on changed,
- a build arg or the artifact's config changed,
- or nothing changed at all and the previously built image was simply pruned from the local daemon or evicted from the registry.
The last case is the confusing one: nothing the user did caused it, but the output is identical to a real source change. Diagnosing an unexpected rebuild today means building a patched skaffold and printing the hash inputs by hand.
Two things would help, and I have both working locally:
Report the reason on the existing line. The lookup already knows whether the artifact's current hash had an entry in the cache, which separates "the inputs produced a hash we have never built" from "we built this, but the image is gone":
- app: Not found. Building (no cached build for the current inputs) - api: Not found. Building (cached image is no longer available)No new flags, files or I/O — it is derived from state the lookup already has.
Behind an opt-in flag, record the inputs that feed each artifact's hash and diff them against the previous run, so the miss names what changed:
- app: Not found. Building (inputs changed) ~ src/handler.go + src/middleware.go - src/old_handler.go
Source: GoogleContainerTools/skaffold