chore(build): pin bun + CI cache hygiene#332
Conversation
Fixes non-deterministic lockfile regeneration caused by version drift between local bun (1.2.2) and CI's unpinned oven-sh/setup-bun@v2 (latest 1.3+). Added packageManager field to package.json (Corepack-compatible), pinned bun@1.3.0 in both CI workflows, and changed bun install to --frozen-lockfile to catch future mismatches. Regenerated bun.lockb with bun v1.3.13. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
📝 WalkthroughWalkthroughBun package manager is pinned to version 1.3.0 across the project configuration. The version is declared in ChangesBun Version Pinning
🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Replace fixed bun@1.3.0 version pin with latest. The --frozen-lockfile flag already added to CI will catch any lockfile-version drift loudly. Removed packageManager field since fixed pin would create churn against latest CI bun. engines.bun floor (>=1.3) remains the safety net. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Removed Tier 3 (public/ + hugo_stats.json) — wasted I/O since --cleanDestinationDir wipes public/ and Hugo regenerates hugo_stats.json on every build. Dropped HUGO_CACHEDIR (/tmp/hugo_cache) — unused by Hugo config. Split Tier 2 into: Tier 2a (image cache, key on assets + content images only — survives CSS/HTML edits) + Tier 2b (asset compilation cache, key on themes/layouts/config — updates on build-affecting changes). Result: 177 processed images now retain across CSS edits; ~5-10s faster warm cache builds. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Bun Version Pinning
Why: Local bun (v1.2.2) diverged from CI's unpinned
oven-sh/setup-bun@v2action (installs latest), causing non-deterministic lockfile regeneration.Strategy: Use
bun-version: latestin CI workflows +--frozen-lockfileflag to detect drift loudly.engines.bun: ">=1.3"floor documents minimum version; if lockfile drifts, CI fails, dev rebuilds it.Changes:
.github/workflows/_hugo.yml+.github/actions/setup-hugo/action.yml: Pinbun-versiontolatestpackageManagerfield (would cause churn against latest CI bun)--frozen-lockfileto enforce lockfile immutabilityCI Cache Hygiene
Why: PR #332 build logs (run 25633387289) showed all 3 cache tiers hit primary keys but build still took 84s with full cache restoration → wasted I/O.
Changes:
Dropped Tier 3 entirely (public/ + hugo_stats.json caching)
--cleanDestinationDirwipes public/ on every buildSplit Tier 2 into two caches for image retention across CSS/HTML edits
resources/_gen/images, key on assets + content images onlyresources/_gen/assets, key on themes/layouts/configRemoved unused HUGO_CACHEDIR
/tmp/hugo_cacheis not used by Hugo config (no remote data fetches, no HTTP caching needed)Verification:
ENVIRONMENT=production bin/hugo-buildsucceeds locally (1012 pages, ~35s)Expected improvement: Warm cache builds <2m00s (baseline 2m16s from prior run)