Repository navigation
BUILD-11555 Emit cache metrics JSON on all platforms; restrict size measurement to Linux - #83
Conversation
f6f9997 to
b85bf0e
Compare
…easurement to Linux Remove the process.platform !== 'linux' early-return guards from the cache-metrics main and post steps. The JSON record (cache_hit, key, backend, restore_key_hit, saved, timestamps) is now written on every platform. Size fields (size_bytes_restored, size_bytes_at_end) are null on non-Linux where GNU du is unavailable; cache-size-bytes output is only set on Linux. Update action.yml output description, README, and tests accordingly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
3045ea8 to
623b1e3
Compare
|
|
Code Review ✅ Approved 1 resolved / 1 findingsEnables cross-platform cache metrics by decoupling JSON record writing from Linux-specific size measurement. The gate step logic has been updated to support non-Linux execution, resolving the unreachable metrics finding. ✅ 1 resolved✅ Bug: Cross-platform metrics unreachable: gate step is Linux-only
OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |



Summary
The
process.platform !== 'linux'guards incache-metrics-mainandcache-metrics-postwere blocking all metrics functionality on macOS and Windows — including the entirely cross-platform JSON writing. OnlymeasureCacheBytes()genuinely requires Linux (GNUdu -sb).What changes:
cache_hit,key,backend,restore_key_hit,saved, timestamps) are now written on all platformssize_bytes_restored,size_bytes_at_end) remainnullon non-Linuxcache-size-bytesoutput is only set on Linux (unchanged from today)metricsFile,path,cacheHit,lookupOnly) is now saved on all platforms so the post step can update the recordWhat does NOT change:
CI_METRICS_ENABLED) — the runner pre-job hook only runs on Linux today, so macOS/Windows users would needenv: CI_METRICS_ENABLED: 'true'to opt in explicitlygithub-runners-infra,ci-ami-images,ci-github-actions— no changesTest plan
test-s3-cache-windowsCI job implicitly verifies JSON is written without crashing on Windows