Repository navigation
ci: key the integration test caches on their inputs - #2902
Draft
bitsandfoxes wants to merge 7 commits into
Draft
bitsandfoxes wants to merge 7 commits into
bitsandfoxes wants to merge 7 commits into
Conversation
bitsandfoxes
force-pushed
the
ci/cache-content-keys
branch
from
October 25, 2026 13:43
d04bbf2 to
023a17d
Compare
bitsandfoxes
force-pushed
the
ci/cache-content-keys
branch
from
October 25, 2026 19:05
9f35536 to
023a17d
Compare
bitsandfoxes
force-pushed
the
ci/android-launch-recovery
branch
from
October 26, 2026 05:05
898ef9c to
84e7754
Compare
bitsandfoxes
force-pushed
the
ci/cache-content-keys
branch
from
October 26, 2026 05:38
023a17d to
a8bef03
Compare
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.
The integration test caches are now keyed on what goes into them, instead of on the run that wrote them, so a push to
mainno longer writes a fresh copy of every Unity Library.The repo sat at 10.67 GB of its 10 GB cache quota. 7.49 GB of that was 16
it-library-*entries, all from a single run, because the keys end in-${{ github.run_id }}: every push tomainsaves a new set and evicts whatever was least recently used. What gets evicted are the caches that actually save time. There's nosdk=entry onmainleft (all 74 of them sit on PR refs, 25 distinct keys saved over and over), and only 13 of the 35build-nosentry-*entries survive. That's why "Build without Sentry SDK" misses 50–80% of the time onmain, the native SDKBuildmisses ~70%, and "Compile Xcode project without Sentry" misses ~95%. Over the last 60 days that's roughly 9,500, 2,840 (on the critical path) and 870 macOS minutes, and every "Build without Sentry" miss is also an extra Unity editor launch and license acquisition.How it works now:
it-library-<os>-<major>keys end in a hash of the downloaded IntegrationTest project'sProjectSettings/ProjectVersion.txt(the full editor version and changeset), itsPackages/manifest.jsonand the parts oftest/Scripts.Integration.Testthat get copied into the project (Editor/,Scenes/,Scripts/,DependencyConflictPackage/, pluscreate-project.ps1andadd-sentry.ps1). A change to one of the other harness scripts doesn't touch the Library, so it doesn't re-save ~7 GB either. Both project files come out the same for every run of the same editor version. The key gets computed before Sentry is added to the manifest, and the save step reuses it (cache-primary-key) and only runs on a miss. Therestore-keysprefix is unchanged, so a changed input still starts from the newest Library and Unity reimports what changed. The restore-only ubuntu jobs (WebGL, Android, iOS) use the same key, so they get the Linux job's Library as an exact hit.build-nosentry-*keys include the full Unity version as well (the sameProjectVersion.txthash, so bumping one Unity version only rebuilds that version), and the compiled iOS one reads its version fromscripts/unity-versions.json, since there's no project in that job yet when it restores. Until now a Unity patch bump kept serving the build-size baseline from the old patch.IntegrationTest-Projectcache intest-create.ymlis gone. It had no entry when we looked (it gets evicted like everything else), creating the project takes ~0.5 min, and its key didn't include the full Unity version either.Library-unity-of-bugs(548 MB) is only saved onmain, like the others. Every PR whose run found it evicted saved its own copy.sdk.ymlonly checks out the submodules on a cache miss (~1 min per job, ~1,900 min over 60 days). Nothing after a hit uses them, and the key is built fromgit submodule status --cached, which reads the index, so it doesn't change.Existing entries don't match the new keys, so the first
mainrun after merging misses everything once and saves a single set; the old-<run_id>entries can be deleted or left to age out.What it doesn't fix: if every entry is kept, the steady state is still about 11 GB (Libraries ~8 GB, a full set of 35
build-nosentry-*~2.4 GB,Library-unity-of-bugs0.55 GB,sdk=~0.07 GB per key set), so LRU will keep evicting about 1 GB. PR runs only use 2021.3 and 6000.6, so what goes are the entries onlymainuses (2022.3, 6000.0, 6000.3), and they get saved again on the nextmainpush: about 1 GB per push instead of 7.5 GB, and thesdk=and PR-version caches stay. Getting below 10 GB for good needs one more cut, e.g. leavingLibrary/Beeout of the Library caches (about two thirds of a Library locally) or dropping the macOS Library cache (2.74 GB), after an A/B on build time.Measured, with a throwaway commit (since dropped) that let this PR branch save caches like
maindoes:pwshcrash in the SDK build): every content key missed and was saved once, 8it-library-*(3.1 GB) and 14build-nosentry-*. Android, iOS and WebGL share theit-library-ubuntu-*entries with Linux.Library-unity-of-bugswas an exact hit, so it wasn't saved again.sdkjobs.gh api repos/getsentry/sentry-unity/actions/cache/usage: before 10.20 GB / 126 entries. During the two runs it peaked at 11.10 GB, since the PR's own set sat next tomain's old-<run_id>entries. The old entries stop being restored and age out.Rebased onto #2907: run 40275305182 failed Build WebGL 6000.6 on a stale
Library/burst.pid(fixed in #2911), then passed on a rerun of the failed jobs.🤖 Generated with Claude Code