ci(repo): mock firebase for e2e tests - #2821
Conversation
📝 WalkthroughWalkthroughChangesFirebase E2E builds now use local no-op stubs for Core, Crashlytics, and Messaging through pubspec overrides. Both iOS E2E workflows activate those overrides and run CocoaPods caching after dependency bootstrap. The Xcode CAS composite action and its workflow usage are removed. Firebase E2E CI integration
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
b63b5a8 to
373de71
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2821 +/- ##
=======================================
Coverage 72.77% 72.77%
=======================================
Files 428 428
Lines 27602 27602
=======================================
Hits 20088 20088
Misses 7514 7514 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Should we already do this for android as well? Currently only applied for iOS.
There was a problem hiding this comment.
Android is much faster and the benefit of mocking it there is very low. But this way we at least can receive crash reports from Android as far as i understood.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.github/workflows/e2e_test.yml (1)
26-26: 🔒 Security & Privacy | 🟡 Minor | ⚡ Quick winDisable persisted checkout credentials in
e2e_testworkflows.
actions/checkout@v7persists the GitHub token by default, but these workflows do not need authenticated Git operations after checkout. Addpersist-credentials: falseto all four checkout steps:
.github/workflows/e2e_test.yml#L26.github/workflows/e2e_test.yml#L89.github/workflows/e2e_test_cron.yml#L35.github/workflows/e2e_test_cron.yml#L109🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/e2e_test.yml at line 26, Disable persisted checkout credentials on all four checkout steps: add persist-credentials: false to .github/workflows/e2e_test.yml lines 26 and 89, and .github/workflows/e2e_test_cron.yml lines 35 and 109.Source: Linters/SAST tools
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In @.github/workflows/e2e_test.yml:
- Line 26: Disable persisted checkout credentials on all four checkout steps:
add persist-credentials: false to .github/workflows/e2e_test.yml lines 26 and
89, and .github/workflows/e2e_test_cron.yml lines 35 and 109.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: ddccf41f-07d7-4e7f-b5ad-f06cd9737f85
📒 Files selected for processing (2)
.github/workflows/e2e_test.yml.github/workflows/e2e_test_cron.yml
Resolve https://linear.app/stream/issue/FLU-602
What
Keeps the native Firebase SDK (Core / Crashlytics / Messaging) out of e2e test builds entirely — nothing is downloaded, compiled, linked, or initialized during e2e runs — and cleans up the iOS build caching in the e2e workflows based on measured data.
How the Firebase mock works
sample_app/e2e_stubs/contains three pure-Dart no-op packages namedfirebase_core,firebase_crashlytics, andfirebase_messaging, stubbing exactly the API surfacesample_appuses (Firebase.initializeApp,FirebaseOptions,recordError/recordFlutterFatalError, the messaging streams/token getters, etc.). Permission requests report denied, tokens resolve tonull, message streams never emit.flutter.pluginsection, the Flutter tool registers no plugins for them → no Firebase pods on iOS, no Firebase Gradle deps on Android (although we do not use it on Android on CI right now, but it supports it if we decide to do it on Android as well).sample_app/pubspec_overrides.e2e.yamlwires them in viadependency_overrides. The e2e workflows copy it overpubspec_overrides.yamlbeforemelos bootstrap— melos merges its own managed overrides into the existing file and preserves the stub entries.project.pbxprojchanges are needed: the existingisE2eTestRunguards cover runtime behavior, andpod installregenerates the CocoaPods build phases on the runner to match the resolved plugin set.Also in this PR
pubspec.lock(the lock is gitignored and doesn't exist beforemelos bootstrap— previously that part of the key was always empty and never rotated on dependency changes).cache-xcode-cas). A verbose diagnostic run proved it works end-to-end on CI (1,734replay cache hitremarks, 0 misses) but delivers only ~10% build-time benefit after normalizing for runner speed (the net is roughly zero on a good day and negative on rotation days) — cache replay is IO-bound and the non-cacheable tail (linking, script phases, kernel compile) dominates on the standard 4-vCPU runners — while costing ~12s restore per run, ~25s save on key rotation, and ~1 GB of cache quota. Recoverable from git history if we move to larger runners.Validation
.flutter-plugins-dependencieshas no firebase entries with stubs active,flutter analyzeclean, and melos bootstrap preserves the stub overrides.Test (local)
🤖 Generated with Claude Code
Summary by CodeRabbit
Summary
Bug Fixes
Tests
Chores