Skip to content

ci(flutter): Align CI with stable SwiftPM defaults#3710

Merged
buenaflor merged 17 commits into
mainfrom
fix/flutter-spm-default-stable-ci
May 19, 2026
Merged

ci(flutter): Align CI with stable SwiftPM defaults#3710
buenaflor merged 17 commits into
mainfrom
fix/flutter-spm-default-stable-ci

Conversation

@buenaflor

@buenaflor buenaflor commented May 19, 2026

Copy link
Copy Markdown
Contributor

Align Flutter CI with stable Flutter enabling Swift Package Manager by default for iOS and macOS builds. The dedicated main-channel SPM job is removed, while the regular build and native integration workflows now carry the SwiftPM setup needed on macOS runners.

SwiftPM CI Setup

The iOS and macOS CI paths now select the expected Xcode version, clear SwiftPM and Xcode package caches around package resolution, and rename the local Flutter package for macOS so SwiftPM sees the sentry_flutter package identity.

Cocoa Integration Tests

The cocoa integration workflow no longer runs an explicit pod install before Flutter tests. Stable Flutter resolves this path through SwiftPM, and macOS tests run from the renamed packages/sentry_flutter/example directory.

Related PR

The newer Dart analyzer export fix was split out into #3711 so this PR stays scoped to SPM CI changes.

@github-actions

github-actions Bot commented May 19, 2026

Copy link
Copy Markdown
Contributor

Semver Impact of This PR

None (no version bump detected)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


Fixes

Dart

  • Make sentryOnError synchronous in runZonedGuarded by theprantadutta in #3697
  • Route SDK diagnostic logs to browser console on web by theprantadutta in #3698

Other

  • (flutter) Release replay JNI refs by buenaflor in #3699

Internal Changes

  • (flutter) Align CI with stable SwiftPM defaults by buenaflor in #3710

🤖 This preview updates automatically when you update the PR.

@codecov

codecov Bot commented May 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.91%. Comparing base (d8f332d) to head (99e88f4).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3710      +/-   ##
==========================================
+ Coverage   86.96%   91.91%   +4.95%     
==========================================
  Files         336      105     -231     
  Lines       11979     3734    -8245     
==========================================
- Hits        10417     3432    -6985     
+ Misses       1562      302    -1260     
Flag Coverage Δ
sentry ?
sentry_dio ?
sentry_drift ?
sentry_file ?
sentry_firebase_remote_config 100.00% <ø> (ø)
sentry_flutter 91.52% <ø> (ø)
sentry_hive ?
sentry_isar ?
sentry_link ?
sentry_logging ?
sentry_sqflite ?
sentry_supabase 97.27% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@github-actions

github-actions Bot commented May 19, 2026

Copy link
Copy Markdown
Contributor

iOS Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1264.35 ms 1266.06 ms 1.71 ms
Size 5.83 MiB 6.28 MiB 462.26 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
c58ce03 1245.18 ms 1247.00 ms 1.82 ms
101a9c7 1225.80 ms 1236.04 ms 10.25 ms
67de70c 1260.09 ms 1266.79 ms 6.71 ms
ea06d23 1254.02 ms 1252.60 ms -1.42 ms
29e8ebe 1260.46 ms 1262.60 ms 2.14 ms
93b7728 1247.23 ms 1264.87 ms 17.64 ms
cdf371b 1246.24 ms 1251.10 ms 4.86 ms
2cb90b9 1272.90 ms 1285.55 ms 12.66 ms
6b69699 1254.80 ms 1273.31 ms 18.52 ms
e5ae2a6 1240.48 ms 1253.26 ms 12.78 ms

App size

Revision Plain With Sentry Diff
c58ce03 5.73 MiB 6.17 MiB 455.86 KiB
101a9c7 5.73 MiB 6.17 MiB 455.47 KiB
67de70c 5.73 MiB 6.17 MiB 455.45 KiB
ea06d23 5.53 MiB 5.96 MiB 443.26 KiB
29e8ebe 5.53 MiB 6.01 MiB 488.12 KiB
93b7728 7.86 MiB 9.44 MiB 1.58 MiB
cdf371b 5.53 MiB 6.02 MiB 501.23 KiB
2cb90b9 7.86 MiB 9.54 MiB 1.69 MiB
6b69699 7.86 MiB 9.44 MiB 1.58 MiB
e5ae2a6 5.65 MiB 6.09 MiB 446.96 KiB

Previous results on branch: fix/flutter-spm-default-stable-ci

Startup times

Revision Plain With Sentry Diff
9e1d11a 1249.75 ms 1245.81 ms -3.94 ms

App size

Revision Plain With Sentry Diff
9e1d11a 5.83 MiB 6.28 MiB 462.27 KiB

@github-actions

Copy link
Copy Markdown
Contributor

🚨 Detected changes in high risk code 🚨

High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:

  • packages/flutter/lib/src/screenshot/recorder.dart

@buenaflor buenaflor changed the title ci(flutter): Remove redundant SPM workflow ci(flutter): Align CI with stable SwiftPM defaults May 19, 2026
@buenaflor
buenaflor changed the base branch from main to fix/flutter-hide-internal-widget-keys May 19, 2026 11:47
@buenaflor
buenaflor force-pushed the fix/flutter-spm-default-stable-ci branch from 8d6aa54 to a4e45ae Compare May 19, 2026 11:47
buenaflor and others added 11 commits May 19, 2026 13:48
Flutter stable now enables Swift Package Manager by default, so the
main-channel SPM job duplicates the regular iOS and macOS builds. Drop
the job and align the native context expectation with the SPM package
source.

Co-Authored-By: GPT-5.5 <[email protected]>
Co-authored-by: Cursor <[email protected]>
SwiftPM can fail Sentry Cocoa binary target downloads when stale artifact
paths already exist on macOS runners. Clear the SwiftPM artifact cache
before iOS and macOS example builds resolve packages.

Co-Authored-By: GPT-5.5 <[email protected]>
Co-authored-by: Cursor <[email protected]>
Run the Xcode selection, SwiftPM package rename, and artifact cache
cleanup before the shared Flutter test action. Stable Flutter resolves
SwiftPM during macOS tests, so the package path must already match the
sentry_flutter package identity.

Co-Authored-By: GPT-5.5 <[email protected]>
Co-authored-by: Cursor <[email protected]>
Stable Flutter resolves SwiftPM during cocoa integration tests. Apply the
same macOS package rename and SwiftPM artifact cleanup before pub get,
pod install, and test execution in the integration workflow.

Co-Authored-By: GPT-5.5 <[email protected]>
Co-authored-by: Cursor <[email protected]>
Stable Flutter now resolves the iOS and macOS integration tests through
SwiftPM by default. Remove the explicit pod install from the cocoa test
workflow so it does not force the old CocoaPods setup before tests.

Co-Authored-By: GPT-5.5 <[email protected]>
Co-authored-by: Cursor <[email protected]>
SwiftPM can recreate stale artifact paths during the same macOS runner
job. Clear the artifact cache again immediately before the iOS and macOS
example builds resolve package dependencies.

Co-Authored-By: GPT-5.5 <[email protected]>
Co-authored-by: Cursor <[email protected]>
Stable Flutter can resolve SwiftPM dependencies during both the shared test
action and the later example build. Clear stale SwiftPM binary artifacts
immediately before each iOS and macOS resolution path.

Co-Authored-By: GPT-5.5 <[email protected]>
Co-authored-by: Cursor <[email protected]>
Keep SwiftPM artifact cleanup at the package resolution boundaries and
remove redundant copies from the main Flutter workflow.

Co-Authored-By: GPT-5.5 <[email protected]>
Co-authored-by: Cursor <[email protected]>
SwiftPM binary artifact downloads can fail when stale package cache state
survives between resolution attempts. Centralize the cache reset and clear
both SwiftPM caches and Xcode SourcePackages before Apple package resolves.

Co-Authored-By: GPT-5.5 <[email protected]>
Co-authored-by: Cursor <[email protected]>
SwiftPM can create a bad binary artifact cache during an iOS or macOS
build resolution even after starting from a clean cache. Reuse the cache
reset script and retry Apple builds once after a failed resolve.

Co-Authored-By: GPT-5.5 <[email protected]>
Co-authored-by: Cursor <[email protected]>
Remove the composite wrapper around the SwiftPM cache reset script. The
workflows now invoke the shared shell script directly at the existing
package resolution points.

Co-Authored-By: GPT-5.5 <[email protected]>
Co-authored-by: Cursor <[email protected]>
@buenaflor
buenaflor changed the base branch from fix/flutter-hide-internal-widget-keys to main May 19, 2026 11:48
@buenaflor
buenaflor force-pushed the fix/flutter-spm-default-stable-ci branch from a4e45ae to 9e1d11a Compare May 19, 2026 11:48
Move the SwiftPM cache reset helper out of GitHub Actions and into the
CI scripts directory. Add context for why the cleanup is needed on macOS
runners.

Co-Authored-By: GPT-5.5 <[email protected]>
Co-authored-by: Cursor <[email protected]>
@github-actions

github-actions Bot commented May 19, 2026

Copy link
Copy Markdown
Contributor

Android Performance metrics 🚀

  Plain With Sentry Diff
Startup time 388.76 ms 414.17 ms 25.41 ms
Size 14.55 MiB 15.87 MiB 1.31 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
c5cf749 379.18 ms 360.60 ms -18.58 ms
3ddf010 431.14 ms 438.10 ms 6.96 ms
6e7d494 397.35 ms 378.91 ms -18.43 ms
dbd526b 504.88 ms 569.02 ms 64.15 ms
753d4ac 426.28 ms 423.45 ms -2.83 ms
575ebaa 478.00 ms 585.76 ms 107.76 ms
f3771ea 379.02 ms 363.91 ms -15.11 ms
c58ce03 469.42 ms 472.40 ms 2.98 ms
38a22c2 418.68 ms 436.54 ms 17.86 ms
c1e775e 482.36 ms 608.98 ms 126.62 ms

App size

Revision Plain With Sentry Diff
c5cf749 14.31 MiB 15.49 MiB 1.19 MiB
3ddf010 13.93 MiB 15.18 MiB 1.25 MiB
6e7d494 13.93 MiB 15.06 MiB 1.13 MiB
dbd526b 6.54 MiB 7.69 MiB 1.15 MiB
753d4ac 14.31 MiB 15.49 MiB 1.19 MiB
575ebaa 6.54 MiB 7.69 MiB 1.15 MiB
f3771ea 14.31 MiB 15.49 MiB 1.19 MiB
c58ce03 14.31 MiB 15.49 MiB 1.19 MiB
38a22c2 14.31 MiB 15.49 MiB 1.19 MiB
c1e775e 6.54 MiB 7.70 MiB 1.17 MiB

Previous results on branch: fix/flutter-spm-default-stable-ci

Startup times

Revision Plain With Sentry Diff
9e1d11a 382.00 ms 374.20 ms -7.80 ms

App size

Revision Plain With Sentry Diff
9e1d11a 14.55 MiB 15.87 MiB 1.31 MiB

buenaflor and others added 3 commits May 19, 2026 14:02
The shared Flutter test action is used by multiple package workflows, so
keep the SPM cache workaround in the Flutter workflow that performs the
sentry_flutter package rename.

Co-Authored-By: GPT-5.5 <[email protected]>
Co-authored-by: Cursor <[email protected]>
Avoid clearing SwiftPM caches on the successful build path. Keep the
cleanup for macOS tests and for the Apple build retry after SwiftPM has
actually failed.

Co-Authored-By: GPT-5.5 <[email protected]>
Co-authored-by: Cursor <[email protected]>
Avoid clearing SwiftPM caches before the shared Flutter test step. Keep the
cache reset only for the Apple build retry and the separate cocoa
integration workflow.

Co-Authored-By: GPT-5.5 <[email protected]>
Co-authored-by: Cursor <[email protected]>
@buenaflor
buenaflor marked this pull request as ready for review May 19, 2026 13:23
@buenaflor
buenaflor requested a review from denrase as a code owner May 19, 2026 13:23
Copilot AI review requested due to automatic review settings May 19, 2026 13:23
Comment on lines +115 to +118
flutter build macos || {
clear_swiftpm_cache
flutter build macos
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

if it fails, try to clear cache then retry

Copilot AI 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.

Pull request overview

This PR updates the Flutter CI workflows to reflect stable Flutter’s default Swift Package Manager (SwiftPM) behavior for iOS/macOS, removing the now-redundant main-channel-only SPM job and adjusting build/test steps accordingly.

Changes:

  • Update iOS native SDK identifier expectation in integration tests from CocoaPods to SwiftPM.
  • Update Flutter CI workflows to select Xcode 16.4 on macOS runners, handle SwiftPM cache cleanup, and rename the local plugin directory for macOS SwiftPM identity resolution.
  • Remove the dedicated “SPM (main channel)” CI job and stop running explicit pod install in the Cocoa integration workflow.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
packages/flutter/example/integration_test/integration_test.dart Align expected native SDK package name with SwiftPM-based Sentry Cocoa integration.
.github/workflows/flutter.yml Fold SwiftPM/Xcode setup into the main Flutter build matrix and remove the separate SPM job.
.github/workflows/flutter_test.yml Update cocoa integration workflow to use SwiftPM cache clearing + correct working directories (incl. macOS rename path) and drop explicit pod install.
.github/scripts/clear-swiftpm-cache.sh Add a helper script to clear SwiftPM/Xcode package caches on macOS runners.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@denrase denrase 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.

Just 2 things

Comment thread .github/workflows/flutter.yml
Comment thread .github/workflows/flutter.yml
Add a stable Apple build smoke test with SwiftPM explicitly disabled so
CI still validates CocoaPods compatibility while the main Apple jobs use
Flutter's SwiftPM defaults.

Co-Authored-By: GPT-5.5 <[email protected]>
Co-authored-by: Cursor <[email protected]>
@buenaflor
buenaflor marked this pull request as draft May 19, 2026 16:37
@buenaflor
buenaflor marked this pull request as ready for review May 19, 2026 16:37
@buenaflor
buenaflor changed the base branch from main to fix/aps-env May 19, 2026 16:38
@buenaflor
buenaflor changed the base branch from fix/aps-env to main May 19, 2026 16:38
@buenaflor
buenaflor merged commit 2e4277e into main May 19, 2026
87 of 92 checks passed
@buenaflor
buenaflor deleted the fix/flutter-spm-default-stable-ci branch May 19, 2026 20:41
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.

3 participants