We recently became aware that the API backing Magic Nix Cache’s free CI cache in GitHub Actions will be shut down on February 1st, 2025. This will require most users to change their GitHub Actions workflows.
The TL;DR:
- The free Magic Nix Cache will stop working unless you’re on GitHub Enterprise Server.
- Users can upgrade to
FlakeHub Cache and get one month free using the coupon codeFHC
. - Open source projects can request a free account at support@flakehub.com.
Background
When we set out to build Magic Nix Cache, we studied the code of the GitHub Actions Cache and found that the API for the backend was relatively trivial, consisting of just a few standard HTTP calls. With the help of Attic’s creator, Zhaofeng Li, we created Magic Nix Cache based on that API.
Last September, GitHub published a blog post about shutting down that API. On December 5th, 2024, GitHub merged and released an updated Cache Action using the new API. Unfortunately, we didn’t see either blog post or the updated API until last week, which gives us limited time to respond.
Analysis
Some information we learned when researching this new API:
- GitHub’s new cache API is built on Twirp, a Protocol-Buffers-based RPC framework built by Twitch.
- Their updated client code became available first in September and was merged in late November.
- The new client code is generated from a Protocol Buffers
.proto
file, but the original source.proto
file has not been made available.
Before we released Magic Nix Cache, we contacted GitHub in every way we could to see if it was acceptable. We never heard back, assumed that no news is good news, and moved forward.
Had GitHub released their .proto
files, we would have a clear path forward—but they didn’t.
Whether or not GitHub is even aware of Magic Nix Cache, I believe that GitHub is sending a clear message that they don’t want tools like Magic Nix Cache to integrate with their cache the way that we have.
The only options we have at this point are:
- Rewrite Magic Nix Cache from scratch in TypeScript and use the Actions Toolkit.
- Reverse engineer the
.proto
source to generate a Rust client. - Discontinue Magic Nix Cache’s free GitHub-Actions-based cache.
One of the risks of repurposing an API in an unexpected way is that it can change and break on short notice. And because it is such short notice, I don’t see the first two options working out in the timeline available to us.
The future
I hope that we can bring back Magic Nix Cache’s free cache for GitHub Actions.
It was the most frictionless way to get a free binary cache to make Nix CI faster.
This is not what I hoped for, and I would be happy to see GitHub release their .proto
files, which would enable us to update Magic Nix Cache to use it.
In the future, we may also reimplement it in TypeScript using their official Actions Toolkit.
The present
We are not able to migrate Magic Nix Cache to use their new APIs in the timeline available. Because of that, users of the free version of Magic Nix Cache will start seeing their CI runs fail as soon as GitHub sunsets their v1 cache API.
Any builds still using the Magic Nix Cache Action will begin to fail once GitHub proceeds with decommissioning the v1 cache API. We have opted to fail builds rather than allowing them to proceed quietly without using the cache because we want to prevent those builds from silently using costly build minutes.
GitHub Enterprise Server users can continue to use Magic Nix Cache as before, as GitHub Enterprise Server still has the old v1 cache API available, for now.
If you’d like to continue using a Nix FHC
during checkout.
If you’re a maintainer of an open source project, contact us at support@flakehub.com for a free account.