feat: add GOCACHEPROG subprocess and /buildcache HTTP handler#45
Merged
Conversation
- Add `cacheprog` subcommand that speaks the GOCACHEPROG JSON stdin/stdout protocol, with a local disk cache (fast path) and HTTP fallback to the content-cache server - Add protocol/buildcache package with HTTP handler (GET/PUT /buildcache/) and metadb EnvelopeIndex-backed action→blob mapping - Register /buildcache/ routes in server/http.go with 24h default TTL Usage: GOCACHEPROG="content-cache cacheprog --server http://localhost:8080" go build ./...
426855c to
76e49d9
Compare
- Add context propagation to cacheprog HTTP requests, cancel on close - Log writeResponse errors in get/put goroutines instead of discarding - Add actionID hex validation in buildcache HTTP handler - Fix missing Time field in put sidecar metadata - Fix TOCTOU in local cache fast path (read meta first, then verify blob) - Move buildcache routes before goproxy catch-all in route registration - Rename buildcacheHandler to buildcache in Server struct for consistency - Add buildcache case to deriveProtocol fallback - Add comprehensive tests for handler, index, and cacheprog runner
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.
cacheprogsubcommand that speaks the GOCACHEPROG JSON stdin/stdoutprotocol, with a local disk cache (fast path) and HTTP fallback to the
content-cache server
and metadb EnvelopeIndex-backed action→blob mapping
Usage:
GOCACHEPROG="content-cache cacheprog --server http://localhost:8080" go build ./...
See https://pkg.go.dev/cmd/go/internal/cacheprog