Repository navigation
feat(cache): cache-preset umbrella + thin-default for build-cache-mode (#251) - #252
Merged
Merged
Conversation
#251) Two cache-policy refinements after the v0.9.12+ default trim arc (#219, #225, #231, #232, #236): **Proposal A — `build-cache-mode: thin` as the resolved default when `target-cache` is opted in.** Empty + `target-cache: true` now resolves to `thin` (the bounded dep-artifact shape) instead of `once` (the heavier rust-plan bundle). One input enables the bounded variant instead of having to set both. The heavier `once` and unbounded `full` remain available as explicit opt-ins. When `target-cache` is off the resolved mode stays `once` to preserve the env-visible `SETUP_SOLDR_BUILD_CACHE_MODE` value for downstream tools. **Proposal B — `cache-preset` umbrella input.** One-line policy intent that fills any cache-affecting input the consumer leaves unset; explicit fine-grained inputs always win. - `minimal` → build-cache=false, target-cache=false, cargo-registry-cache=false, prebuild-deps=soldr-cook - `foundation` → today's default (no behavior change) - `full` → build-cache=true, target-cache=true, cargo-registry-cache=true, prebuild-deps=soldr-cook, build-cache-mode=thin Resolution mutates `inputs` near the top of `resolveSetupInputs` so downstream code reads a single source of truth. Empty `cache-preset` (the default) leaves every input untouched, so consumers who never set it see no behavior change. The resolved preset is surfaced via the new `cache-preset-effective` output. Also adds `enabled: boolean` to `BuildCachePlan` for parity with `TargetCachePlan.enabled` and `CargoRegistryCachePlan.enabled`, which makes the build-cache layer's resolved on/off state observable. Empirical motivation (FastLED/fbuild#280, merged 2026-05-29): when the foundation defaults are paired with coarse cache keys, the setup-soldr cache footprint dropped from ~6.7 GB to ~437 MiB on a 72-board CI matrix with warm wall-clock 5 min → 2 m 23 s. This issue makes that policy expressible in one line. Co-Authored-By: Claude Opus 4.7 <[email protected]>
#251) Update the Python action.yml contract test fixture to reflect the new input/output added by the cache-preset umbrella PR. Co-Authored-By: Claude Opus 4.7 <[email protected]>
This was referenced May 30, 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.
Implements #251 — both proposals.
Proposal A —
build-cache-mode: thinas the resolved default whentarget-cacheis opted innormalizeBuildCacheModeinsrc/lib/cache-keys.tsnow returns"thin"(was"once") when the caller signals target-cache requested + no explicitbuild-cache-mode. Whentarget-cacheis off, the resolved mode stays"once"to preserve the env-visibleSETUP_SOLDR_BUILD_CACHE_MODEvalue for downstream tools.Proposal B —
cache-presetumbrella inputNew input + output:
cache-preset: minimal | foundation | full(default"").cache-preset-effectiveoutput (the resolved value, or"").Resolution mutates
inputsnear the top ofresolveSetupInputsso downstream code (main.ts,cook-cache.ts) reads a single source of truth. Explicit fine-grained inputs always win — the preset only fills unset inputs. Emptycache-preset(the default) leaves every input untouched, so consumers who never set it see no behavior change.build-cachetarget-cachecargo-registry-cacheprebuild-depsbuild-cache-modeminimalfalsefalsefalsesoldr-cookonceenv-visible)foundation(= today's default)truefalsefalsesoldr-cookonceenv-visible)fulltruetruetruesoldr-cookthinTo make the preset's mappings actually take effect, the action.yml defaults for
build-cache,target-cache, andcargo-registry-cachewere flipped from explicit literals ("true"/"false") to"". The existing downstreaminputs.X.trim() || "<historical default>"fall-through patterns preserve identical behavior when no preset is set.prebuild-depsdefault stays"soldr-cook"(all three presets agree on cook=on, same as the historical default).Other
enabled: booleantoBuildCachePlan(parity withTargetCachePlan.enabled/CargoRegistryCachePlan.enabled).Test plan
__tests__/resolve-setup.test.tscover: each preset's mapping (minimal/foundation/full), explicit-wins precedence, no-preset default (no mutation), invalid value rejection,cache-preset-effectiveoutput, the thin-default flip, and the explicit-build-cache-mode override.__tests__/cache-keys.test.tsto assert the newnormalizeBuildCacheMode("", "", true) → "thin"contract + added a case forallowLegacyTranslation=false → "once"(target-cache off env-visible compatibility).dist/main.js+dist/post.jsrebuilt vianpm run build.Closes #251.
🤖 Generated with Claude Code