Originally created by: Akarsh-Hegde
Every staging build has been compiling the workspace cold. Run 29734394528 logged No cache found. on both arches:
| step | aarch64 | x86_64 |
|---|---|---|
| rust-cache restore | 0m (miss) | 0m (miss) |
| Build daemon | 7.8m | 4.8m |
| Compile tray | 19.3m | 13.7m |
The build jobs are restore-only (save-if: "false") against a cache key scoped to ${{ matrix.target }} - a key nothing in the repo ever writes. Restore-only against a key nobody saves is a permanent miss, not a saving. It paid the lookup on every run and got nothing back.
This was my call in [#494] and it was wrong. The comment justified it as staying under the repo's 10GB cache quota, which was a real constraint - but restore-only does not economise on a cache that does not exist. The two options were "save and use the quota" or "drop the cache step"; what shipped was the cost of both with the benefit of neither.
The repo sits at 9.8 GB of 10 GB, and the two largest entries are:
2.4GB refs/heads/main v0-rust-macos-universal-Darwin-arm64-...
2.4GB refs/heads/pre-main v0-rust-macos-universal-Darwin-arm64-...
Those are the caches of the sequential staging build - the one [#494] replaced. Nothing writes or reads them anymore. That is ~4.8 GB of dead weight, roughly exactly the room two per-arch caches need. GitHub evicts LRU once over quota, so they age out without intervention; I have not deleted them by hand.
save-if: ${{ github.ref == 'refs/heads/pre-main' }}
Scoped to pre-main rather than unconditional: GitHub isolates caches per branch on read but not on write eviction, and only pre-main ever cuts a staging release - a feature branch has no business evicting the release cache.
The first run after merge still compiles cold and populates the cache; the benefit starts on the second. A warm Rust cache typically avoids recompiling unchanged dependencies, which is most of that 19m - but I would rather report the measured number after two runs than promise one here.
Splitting the daemon into its own job (it costs 4.8-7.8m ahead of the tray compile, and tauri-build only stats bundle.resources at compile time, so the tray could start against a placeholder). That is a real further win but a bigger restructure with a real risk - shipping a bundle whose nested daemon is the placeholder. Worth measuring against a warm cache first; the daemon build may be cheap enough afterwards that the moving parts are not worth it.
🤖 Generated with Claude Code
Originally posted by: coderabbitai[bot]
✨ Finishing Touches
🧪 Generate unit tests (beta)
- [ ] Create PR with unit tests - [ ] Commit unit tests in branch `ci/warm-the-staging-cache`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.
❤️ Share
- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)Comment
@coderabbitai helpto get the list of available commands.Ticket changed by: Akarsh-Hegde