Skip to content

ci: save caches only from main and keep the iOS release archive recoverable - #563

Merged
cunoe merged 4 commits into
mainfrom
ci/main-only-caches
Nov 13, 2026
Merged

cunoe merged 4 commits into
mainfrom
ci/main-only-caches

Conversation

@cunoe

@cunoe cunoe commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Problem

The repository's Actions cache holds 11.56 GB in 19 entries, above the 10 GB limit, so GitHub keeps evicting the least recently used entries. Measured 2026-11-13:

Ref Size Restorable by
main (9 entries) ~5.5 GB every ref
fix/update-release-discovery (manual CI for #562) ~3.5 GB that branch only
fix/iphone-lan-message-delivery ~1.06 GB that branch only
fix/release-desktop-arm64-oom (#561) 0.48 GB that branch only
tag v0.0.1-nightly.20261112.2 0.44 GB that tag only

A cache saved on a branch or tag is restorable only by that same ref. Those entries serve almost nothing, but they push out main's caches, so main and every branch fall back to cold or partial builds.

Causes:

  • 9 Swatinem/rust-cache steps saved on github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch'. That covers any manual run on any branch or tag, including the release runs the Nightly coordinator dispatches on tags.
  • 8 more rust-cache steps (release, mobile, GPUI feature check, native diagnostics) and the Chromium actions/cache had no save condition, so release tags, merge-queue refs and branches all wrote.
  • The iOS simulator app cache saved on any ref.

Separately, the iOS device archive was the only producer artifact with retention-days: 14; the repository default for all the others is 90. Publisher recovery needs every original producer artifact, so a failed product release left for two weeks could never be recovered. The Nightly coordinator would keep selecting it until an abandonment landed on main.

Still true on 2026-11-13 after #569: 18 entries, 11.2 GB.

Change

  • All 12 Swatinem/rust-cache steps in the remaining workflows use save-if: ${{ github.ref == 'refs/heads/main' }}. These are in ci.yml, _ci-crypto.yml and the release producers (release.yml, release-native.yml, release-desktop.yml, release-ios.yml, release-apps.yml). Other refs, including release tags and manual branch runs, still restore main's caches by key prefix but never write their own.
  • release-ios.yml drops the 14-day override, so the iOS device archive gets the default retention like every other producer artifact. This is a separate commit.

Updated onto main after #568 (e2e removed from Actions) and #569 (non-core workflows removed):

  • The changes to the deleted ci-desktop.yml, ci-windows-native.yml, ci-native-diagnostics.yml and mobile.yml are dropped.
  • So are the Chromium restore/save steps, since the e2e step they served no longer exists.
  • No combined actions/cache remains.

Trade-offs

  • setup-node with cache: pnpm is unchanged. It writes only on a lockfile miss (about 200 MB) and has no save condition.
  • Existing branch and tag entries are not deleted here. They are no longer read, so LRU eviction and GitHub's 7-day expiry of unused entries remove them first.

Validation

  • A scripted check confirms that all 12 rust-cache steps carry the main-only condition and that no combined actions/cache remains.
  • These pass on the updated head: python3 scripts/ci.py --self-test, python3 -B scripts/check-release-workflow.py --self-test and the real check, scripts/release.py self-test, and scripts/hourly.py --self-test.
  • The earlier CI / Core run failed only at macOS notarization (Apple 403: an agreement was missing or expired). That is unrelated to this change, and notarization has passed again since 13:17Z. CI / Core is dispatched on the updated head for actionlint in "Workflow and source checks".

The repository's Actions cache holds 11.56 GB in 19 entries against the
10 GB limit, so GitHub keeps evicting the least recently used entries.
Only 5.5 GB belongs to main. The rest was written by manual runs on
development branches (3.5, 1.06 and 0.48 GB this week) and by a release
tag (0.44 GB). A cache saved on a branch or tag can only be restored by
that same ref, so those entries serve almost nothing while they push out
main's caches, and every branch then starts from a cold or partial build.

Nine rust-cache steps saved on main or any workflow_dispatch, including
release dispatches on tags. Eight rust-cache steps and the Chromium cache
had no save condition, so release tags, the merge queue and branches all
wrote. The simulator app cache saved on any ref.

Every rust-cache step now saves only on refs/heads/main; other refs keep
restoring main's caches. Chromium uses restore plus a main-only save, and
the simulator app saves only on main. Manual-only workflows now start from
main's caches, and are cold until they have run on main once.
…ifact

Recovering a failed product release reruns its publishers from the original
producer artifacts, and the Nightly coordinator refuses a recovery once any
of them has expired. Every producer artifact uses the repository's 90-day
retention except the iOS device archive, which set 14 days. A failed
release left alone for two weeks could then never be recovered, and the
coordinator keeps selecting it until an abandonment lands on main. Use the
default retention for the iOS archive as well.
# Conflicts:
#	.github/workflows/release-desktop.yml
@cunoe
cunoe merged commit 4ed9b16 into main Nov 13, 2026
7 of 16 checks passed
@cunoe
cunoe deleted the ci/main-only-caches branch November 13, 2026 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant