fix(builder): skip cache_from/cache_to entries that render empty#8
Merged
Conversation
Cache flags were passed to buildx unconditionally, so an env-templated
entry like "{{ .Env.STEVEDORE_CACHE_TO }}" rendered to "" outside CI and
broke local builds (--cache-to "" is a buildx error). Skip empty entries
after template rendering: configs can now gate layer caching on
environment presence — active on CI runners that export the cache env,
inert on a laptop.
Motivation: pinpredict/.github#39 — one shared type=gha scope for
pinpredict/trading's build-once Dockerfile.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
blairham
force-pushed
the
fix/skip-empty-cache-entries
branch
from
July 5, 2026 20:33
5015e76 to
cdf6486
Compare
blairham
added a commit
to pinpredict/.github
that referenced
this pull request
Jul 5, 2026
blairham/stevedore#8 merged and released: empty-rendering cache_from/cache_to entries are skipped, so cache-wired configs (pinpredict/trading#1969) build locally without the CI cache env. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
blairham
added a commit
to pinpredict/.github
that referenced
this pull request
Jul 5, 2026
- Export STEVEDORE_CACHE_FROM/STEVEDORE_CACHE_TO (one type=gha scope per
calling repo) and re-export the GitHub runtime env via
crazy-max/ghaction-github-runtime so stevedore's shelled-out buildx can
reach the gha cache backend. Configs opt in per image with
'{{ index .Env "STEVEDORE_CACHE_FROM" }}' entries that render empty
outside CI (skipped by stevedore >= v0.0.5, blairham/stevedore#8).
- Bump the action pin + default binary to v0.0.4 (plan/matrix mode).
- Document the single-job-by-design decision (#39):
one runner + one BuildKit means a build-once Dockerfile (trading#1967)
compiles once for all images, even with --parallel; a per-image matrix
fan-out would cold-cache every runner and re-run the shared stage N
times.
Still a draft (no-push defaults true): the remaining publish gap is the
Dispatch notification (blairham/stevedore#6).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
blairham
added a commit
to pinpredict/.github
that referenced
this pull request
Jul 5, 2026
blairham/stevedore#8 merged and released: empty-rendering cache_from/cache_to entries are skipped, so cache-wired configs (pinpredict/trading#1969) build locally without the CI cache env. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
blairham
added a commit
to pinpredict/.github
that referenced
this pull request
Jul 5, 2026
…re (#40) * feat(stevedore-release): add draft reusable stevedore release workflow Reusable image build/release via stevedore v0.0.3. The caller passes no service matrix: stevedore reads the repo's .stevedore.yaml, resolves per-service ECR versions, does change detection against per-image refs/releases/image/<id> marker refs (the same ref family docker-release.yml advances; contents: write so it can push them), and groups identical build specs into a single build. Draft: defaults to --no-push; remaining gap vs docker-release.yml is the Dispatch publish notification. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * feat(stevedore-release): wire gha layer cache + bump stevedore v0.0.4 - Export STEVEDORE_CACHE_FROM/STEVEDORE_CACHE_TO (one type=gha scope per calling repo) and re-export the GitHub runtime env via crazy-max/ghaction-github-runtime so stevedore's shelled-out buildx can reach the gha cache backend. Configs opt in per image with '{{ index .Env "STEVEDORE_CACHE_FROM" }}' entries that render empty outside CI (skipped by stevedore >= v0.0.5, blairham/stevedore#8). - Bump the action pin + default binary to v0.0.4 (plan/matrix mode). - Document the single-job-by-design decision (#39): one runner + one BuildKit means a build-once Dockerfile (trading#1967) compiles once for all images, even with --parallel; a per-image matrix fan-out would cold-cache every runner and re-run the shared stage N times. Still a draft (no-push defaults true): the remaining publish gap is the Dispatch notification (blairham/stevedore#6). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * feat(stevedore-release): bump stevedore to v0.0.5 blairham/stevedore#8 merged and released: empty-rendering cache_from/cache_to entries are skipped, so cache-wired configs (pinpredict/trading#1969) build locally without the CI cache env. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * feat(docker-release)!: replace the matrix implementation with stevedore The matrix implementation lives on the frozen pre-stevedore tag that every existing caller is pinned to — this replacement breaks the workflow_call contract (no matrix input) for @main only, which is exactly what the pin was minted for. Repos migrate by adding a .stevedore.yaml, dropping the matrix wiring from ci.yml, and pointing uses: back to @main. Carries the draft stevedore workflow's shape: single job by design (#39 — one BuildKit instance so a build-once Dockerfile compiles once for all images, even with --parallel), gha layer cache env (STEVEDORE_CACHE_FROM/TO, one scope per repo, opt-in per config via index-form templates skipped when empty by stevedore >= v0.0.5), and no-push defaulting true until the Dispatch notification gap (blairham/stevedore#6) closes. README + AGENTS.md updated: consumer contract, migration steps, the pre-stevedore exception wording, and the statements that only apply to the frozen matrix implementation (per-service push roles, notify-dispatch, matrix-shape playbook). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <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.
Cache flags were passed to buildx unconditionally, so an env-templated entry like
{{ .Env.STEVEDORE_CACHE_TO }}renders to""outside CI and fails the build. With this change, entries that render to an empty string are skipped after template resolution — configs can gate layer caching on environment presence: active on CI runners that exportSTEVEDORE_CACHE_FROM/STEVEDORE_CACHE_TO, inert on a laptop.Motivation: pinpredict/.github#39 — pinpredict/trading's build-once Dockerfile wants a single shared
type=ghacache scope wired in CI, whilestevedore buildmust keep working locally with no GHA cache backend available.internal/builder: skip emptyCacheFrom/CacheToentries (+ dry-run test asserting the empty entries are omitted and non-empty ones survive)internal/config+ README: document the skip rule and the env-gating patternmake checkgreen.🤖 Generated with Claude Code