Repository navigation
feat(ci): add refresh-cache input to rebuild layers without reading cache - #850
Merged
Merged
Conversation
…ache Adds a refresh-cache boolean input to bakery-build-native.yml that passes --no-cache to bakery build while keeping --cache-registry, so BuildKit skips cache reads but still exports fresh layers (cache-to, mode=max) to the cache registry. Mirrored in bakery-build.yml for the --load build step. Part of #847
ianpittwood
marked this pull request as ready for review
October 21, 2026 15:06
bschwedler
approved these changes
Oct 21, 2026
This was referenced Oct 21, 2026
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.
Part of #847 (epic #849, eMudhra intermediate CA compromise).
Summary
Adds a
refresh-cacheboolean input (defaultfalse) tobakery-build-native.yml. When it istrue, the build-test job runsbakery build --no-cache --cache-registry <reg> --push. BuildKit then ignores cached layers but still exports fresh layers to the registry cache (cache-to,mode=max), so later scheduled and push builds reuse the patched layers instead of the staleapt-get upgrade/ca-certificateslayer.The existing
cacheinput is unchanged.cache: falsestill drops--cache-registryentirely, which turns off both reads and writes.bakery-build.ymlmirrors the input on its--loadbuild step only. Its push step reuses the local layers and never writes the registry cache.Why
--no-cachestill writes the cache--no-cacheto the frontend attrno-cache=""(build/opt.go).llb.IgnoreCache, which skips cache lookup (dockerui/config.go, dockerfile2llb/convert.go).runCacheExportersregardless ofIgnoreCache(solver/llbsolver/solver.go).Testing
actionlint1.7.12 and the pre-commit hooks (actionlint, zizmor, check-yaml) pass.refresh-cache: true: the logs should show noCACHEDsteps, the GHCR cache tag should get a new digest, and a follow-up normal build should show the apt-upgrade stepCACHEDfrom the new entry.v0tag after merge.Downstream follow-up
This needs separate PRs once this one merges and
v0is updated. Add arefresh-cachebooleanworkflow_dispatchinput (defaultfalse) and pass it to every shared-workflow call:|| falsematters:inputs.*is null onscheduleandpushevents.images-connect:production.yml,content.ymlimages-package-manager:production.ymlimages-workbench:production.yml,session.yml(bothuses:calls)images-specializedwgcw.yml: add the dispatch input and append--no-cacheto the--loadstep only (env var plus bash array, likeCACHE_FLAGS). Leave the--pushstep alone so it reuses the tested local layers. That workflow reads the registry cache but never writes it, so a separate question is what refreshes its cache.