Skip to content

ci: Share the Cocoa SDK cache restore and save it from one job - #5963

Open
ric-oliv wants to merge 1 commit into
ci/ios-trim-analysisfrom
ci/shared-cocoa-cache
Open

ric-oliv wants to merge 1 commit into
ci/ios-trim-analysisfrom
ci/shared-cocoa-cache

Conversation

@ric-oliv

Copy link
Copy Markdown
Member

Stacked on #5961.

Seven jobs in build.yml, device-tests-ios.yml and warm-cocoa-cache.yml repeated the same two steps to compute the Cocoa SDK cache key and restore the cache. They now call one composite action, restore-cocoa-sdk, which replaces cocoa-cache-key. It skips the restore on release branches by default, because the Cocoa SDK ships in Sentry.Bindings.Cocoa and release builds build it from source. The device tests and the cache-warming workflow still restore there, through restore-on-release.

Only .NET (macos) and the cache-warming workflow save the cache now. After a cache miss, every macOS job builds the Cocoa SDK at the same time, and only the first save stores anything. On the push that merged #5949, five jobs saved, and gh cache list shows a single main entry, from the first job to finish. .NET (macos) runs on every PR that runs the build and always builds the Cocoa SDK on a miss, so one save there covers the others.

Two things change. If .NET (macos) fails before its Cocoa build finishes, nothing saves the cache in that run, so the next run builds it again. The device tests on release branches no longer save a cache of their own, so they use main's.

actionlint reports nothing new, and it catches a misspelled input or output on the new action. The build and the iOS device tests run on this PR, so they cover every caller except warm-cocoa-cache, which only runs on pushes to the version branches.

#skip-changelog

Seven jobs repeated the steps that compute the Cocoa SDK cache key and restore the cache. They
now call restore-cocoa-sdk, which replaces cocoa-cache-key and keeps the release-branch rule in one
place. The device tests and warm-cocoa-cache still restore on release branches.

After a cache miss every macOS job builds the Cocoa SDK at once, and only the first save stores
anything: on the #5949 merge push five jobs saved and one main entry was created. Only build-sentry,
which always builds the Cocoa SDK on a miss, and warm-cocoa-cache save the cache now.

Refs #3852

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@sentry-junior sentry-junior Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to approve, with optional comments

This PR has no linked issue. It fixes the cause, several jobs racing to save the same key. Every caller runs on xcode-27, and build-sentry-cocoa.sh builds the same SDKs whatever the job env, so one save from .NET (macos) produces the key that all of them restore.

  • Optional: device-tests-ios.yml: on release/* pushes, build.yml doesn't save, so nothing saves a release-scoped cache now. If a release branch's modules/sentry-cocoa differs from main's, both device-test jobs rebuild Cocoa (~15 min each) on every push to it. The description accepts this trade-off. If it gets costly, one device-test job could keep a save gated on startsWith(github.ref_name, 'release/').
  • Optional: warm-cocoa-cache.yml is the only caller this PR's CI doesn't run. It has workflow_dispatch, so one manual run on this branch would cover the restore-on-release + lookup-only path, where the save key now comes from the composite's key output.

This is an automated preliminary review.

@codecov

codecov Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.69%. Comparing base (d61ea70) to head (58ccebf).

Additional details and impacted files
@@                   Coverage Diff                    @@
##           ci/ios-trim-analysis    #5963      +/-   ##
========================================================
- Coverage                 77.70%   77.69%   -0.02%     
========================================================
  Files                       535      535              
  Lines                     19731    19731              
  Branches                   3934     3934              
========================================================
- Hits                      15332    15330       -2     
- Misses                     3544     3545       +1     
- Partials                    855      856       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ric-oliv
ric-oliv marked this pull request as ready for review November 18, 2026 20:10
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Nov 18, 2026

@jamescrosswell jamescrosswell left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants