GoogleContainerTools / GoogleContainerTools/skaffold
feat: Cache misses are reported with a reason
- Dominant language
- Go
- Stars
- 15.9k
- Forks
- 1.7k
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 10
Description
When `skaffold build` or `skaffold dev` decides to rebuild an artifact, the only
output is:
```
Checking cache...
- app: Not found. Building
```
That 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:
1. 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.
2. 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
```
Contributor guide
Research direction
Reproduce the cache miss with `skaffold build` or `skaffold dev`, then start at the cache lookup that already distinguishes the current hash from cache availability. Done means the existing build message explains those two miss reasons, and an opt-in mode reports changed hash inputs between runs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, go
- Domain
- cli, devtools
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100