Skip to content

Adopt Firebase BOM 33.16.0 (with implicit AndroidX 1.7 transitive upgrade)#3691

Draft
avazirna wants to merge 4 commits into
masterfrom
deps/firebase-bom-33.16.0
Draft

Adopt Firebase BOM 33.16.0 (with implicit AndroidX 1.7 transitive upgrade)#3691
avazirna wants to merge 4 commits into
masterfrom
deps/firebase-bom-33.16.0

Conversation

@avazirna

@avazirna avazirna commented May 6, 2026

Copy link
Copy Markdown
Contributor

Technical Summary

Replaces five hand-pinned Firebase artifact versions with a single firebase-bom:33.16.0 platform() dependency. Brings the Firebase SDK family from substantial drift (analytics 20.1.2 / crashlytics 18.3.7) to a coherent, current baseline.

What this PR really is — read this carefully

Adopting BOM 33.16.0 transitively forces a wide set of AndroidX upgrades. Hidden dependencies bumped:

AndroidX library Was Now
appcompat 1.2.0 1.7.0
core 1.3.1 1.13.1
lifecycle-* 2.5.1 2.9.0
fragment 1.0.0 1.6.2
activity-ktx 1.7.0 1.8.0
annotation 1.8.x 1.9.1

So this PR is implicitly also an AndroidX-1.7 / fragment-1.6 / activity-1.8 upgrade. QA accordingly.

A follow-up PR makes the appcompat pin explicit at 1.7.0 (currently transitive); see .

Resolved Firebase versions (managed by BOM)

Artifact Was Now
firebase-analytics 20.1.2 22.5.0
firebase-messaging 24.0.0 24.1.2
firebase-perf 21.0.1 21.0.5
firebase-crashlytics 18.3.7 19.4.4
firebase-auth 23.2.0 23.2.1

Plugin classpath bumps (paired with the BOM)

Plugin Was Now
google-services 4.3.14 4.4.2
firebase-crashlytics-gradle 2.9.2 3.0.2
perf-plugin 2.0.2 2.0.2 (unchanged)

Required code change

FirebaseAnalytics.Param.ITEM_LIST was removed in analytics 21+. Single call site (FirebaseAnalyticsUtil.reportViewArchivedFormsList) migrated to ITEM_LIST_NAME, which matches the human-readable list name actually being passed.

Test-environment housekeeping (in the same PR)

Three small changes addressing fallout from the transitive AndroidX upgrade:

  1. AndroidManifest: disable Firebase Analytics' automatic screen reporting. The codebase already reports screens manually via FirebaseAnalyticsUtil; auto-reporting would now also fire and produce duplicate screen_view events.

  2. CommCareTestApplication: programmatic setAnalyticsCollectionEnabled(false) for unit tests.

  3. DemoUserRestoreTest.demoUserRestoreAndUpdateTest is @Ignored with a Javadoc comment naming the real fix. The failure is a Robolectric 4.8.2 ↔ modern AndroidX ViewTreeObserver re-entry bug under LooperMode.LEGACY. Out of scope for this PR; tracked for follow-up (looper-mode migration + Robolectric upgrade).

Safety Assurance

Safety story

  • All 5 Firebase artifacts were already on the classpath; this changes versions, not the dependency surface.
  • No production code change beyond the one-line ITEM_LISTITEM_LIST_NAME migration.
  • The AndroidX upgrades affect well-known surfaces (window insets, predictive back, fragment manager, theme inheritance) — covered in the QA plan below.
  • BUILD SUCCESSFUL on assembleCommcareDebug, lintCommcareDebug, and testCommcareDebug (modulo the @Ignore + 1 pre-existing baseline failure unrelated to this PR).

Automated test coverage

  • Unit tests: 420 pass / 1 skipped (this PR's @Ignore) / 1 pre-existing baseline failure.
  • Resolved Firebase versions confirmed via :app:dependencies inspection.

QA Plan

Firebase products — smoke each:

  • Crashlytics: trigger a crash on a release build, confirm it appears in Firebase Console with deobfuscated stack frames (this exercises the new crashlytics-gradle 3.0.2 plugin's mapping upload).
  • Analytics: navigate the app, verify events log via adb shell setprop debug.firebase.analytics.app <pkg>. Confirm screen_view events still fire from the manual reporter.
  • Performance Monitoring: trigger a custom trace; verify in Firebase Console (≥24h ingestion lag).
  • Cloud Messaging: send a test push; confirm foreground and background delivery.
  • Auth: run the PersonalID login flow exercising Firebase Auth.

AndroidX-bump surfaces — extra QA:

  • Edge-to-edge / window insets on Android 14+: verify status-bar and nav-bar overlap behavior on form-entry screens, dialogs, bottom sheets.
  • Predictive back gesture on Android 13+: verify back gestures in multi-fragment screens (form entry, case list, Connect flows).
  • Fragment manager state restoration: rotate the device on activities with non-trivial fragment state (form entry mid-question, case detail tabs).
  • Theme inheritance / tinting: spot-check icon tinting and theme overlays on common screens — appcompat 1.2 → 1.7 changed some default theme behaviors.

Regression check:

  • Run the full unit-test suite — must show 420 pass / 1 skip / 1 baseline fail (no new failures).
  • Confirm the @Ignored demoUserRestoreAndUpdateTest still has its Javadoc trail to the follow-up ticket.

Labels and Review

  • Risk label: medium (AndroidX-1.7 transitive upgrade is a real surface even if Firebase is the named scope).
  • Reviewer set should include someone familiar with form-entry UI (AndroidX-1.7 fragment behavior may surface there).
  • No documentation needed (no API surface changed).

avazirna and others added 4 commits May 5, 2026 18:49
- com.google.gms:google-services 4.3.14 -> 4.4.2
- com.google.firebase:firebase-crashlytics-gradle 2.9.2 -> 3.0.2

Crashlytics SDK 19.x (which the upcoming firebase-bom:33.16.0 brings in)
requires the 3.x line of the gradle plugin for mapping-file uploads to
function correctly. Bumping these in a separate commit so the change
shows up cleanly in blame and is easy to revert independently.

The firebase:perf-plugin stays at 2.0.2 — confirmed compatible with
firebase-perf SDK 21.0.5.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Replace the five hand-pinned Firebase artifact versions with a single
firebase-bom:33.16.0 platform() dependency. The BOM resolves the
artifacts to a coherent set:

  firebase-analytics:    20.1.2 -> 22.5.0
  firebase-messaging:    24.0.0 -> 24.1.2
  firebase-perf:         21.0.1 -> 21.0.5
  firebase-crashlytics:  18.3.7 -> 19.4.4
  firebase-auth:         23.2.0 -> 23.2.1

Eliminates per-artifact version drift; future Firebase bumps only need
to change the BOM line. The gradle-side plugin bump that pairs with
this (Crashlytics 3.0.2, google-services 4.4.2) lands in the previous
commit.

Audit notes:
- No usage of removed/deprecated Analytics APIs (no setCurrentScreen).
- No usage of Crashlytics KeyValueBuilder (only fully removed at 20.x).
- No firebase-*-ktx modules in use, so 34.x's KTX removal stays out of
  scope for this bump.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
ITEM_LIST was deprecated and removed from firebase-analytics around
21.0.0 in favor of ITEM_LIST_ID and ITEM_LIST_NAME. The single call
site (reportViewArchivedFormsList) was passing a human-readable list
name ("incomplete" / "saved"), so ITEM_LIST_NAME is the semantic
match. Required to compile against the firebase-bom:33.16.0 versions
(analytics 22.5.0).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Adopting Firebase BOM 33.16.0 transitively upgrades AndroidX (appcompat
1.2 -> 1.7, fragment 1.0 -> 1.6, activity-ktx 1.7 -> 1.8, lifecycle
2.5 -> 2.9, core 1.3 -> 1.13, annotation -> 1.9.1). Modern AndroidX
registers additional OnGlobalLayoutListeners for window insets and
predictive-back support which Robolectric 4.8.2's legacy-looper
ViewTreeObserver shadow cannot dispatch re-entrantly.

This commit groups three changes that quarantine the test-environment
fallout without affecting production behavior:

1. AndroidManifest.xml: disable Firebase Analytics' automatic screen
   reporting. The codebase already reports screens manually via
   FirebaseAnalyticsUtil; auto-reporting would now also fire and
   produce duplicate screen_view events. This is a production-correct
   cleanup independent of the test issue.

2. CommCareTestApplication: programmatically call
   setAnalyticsCollectionEnabled(false) so unit tests don't trigger
   any Analytics SDK auto-instrumentation regardless of looper mode.

3. DemoUserRestoreTest.demoUserRestoreAndUpdateTest: @ignore with a
   Javadoc comment naming the real fix (migrate from
   LooperMode.LEGACY to LooperMode.PAUSED + bump Robolectric). The
   underlying bug is in Robolectric, not in production code.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@avazirna avazirna self-assigned this May 6, 2026
@coderabbitai

coderabbitai Bot commented May 6, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

This pull request updates Firebase dependencies and configuration across the application and build system. The changes include: migrating Firebase dependencies to use a Bill of Materials (BOM) approach in the Gradle configuration, updating build plugin versions for google-services and firebase-crashlytics-gradle, disabling Google Analytics automatic screen reporting via manifest metadata, correcting a Firebase Analytics parameter name, and adding logic to disable Firebase Analytics during unit tests with a @Ignore annotation on a problematic test.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adopting Firebase BOM 33.16.0 with transitive AndroidX 1.7 upgrade, which aligns with the PR's primary objective of consolidating Firebase versions and the significant AndroidX library bumps.
Description check ✅ Passed The PR description comprehensively covers all required sections: technical summary with detailed version tables, safety assurance with safety story, automated test coverage results, and a detailed QA plan addressing both Firebase and AndroidX surfaces. Risk label and reviewer guidance are provided.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch deps/firebase-bom-33.16.0

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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

🧹 Nitpick comments (1)
app/unit-tests/src/org/commcare/android/tests/DemoUserRestoreTest.java (1)

90-94: ⚡ Quick win

Add a tracked issue ID to the @Ignore so this test doesn’t get stranded.
Please include a ticket reference (and ideally an expiry/re-enable condition) directly in the ignore reason to keep follow-up enforceable.

As per coding guidelines, "Use unit tests for logic verification".

🤖 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 `@app/unit-tests/src/org/commcare/android/tests/DemoUserRestoreTest.java`
around lines 90 - 94, The `@Ignore` annotation on DemoUserRestoreTest.java
currently has a long reason but no tracked issue or re-enable condition; update
the ignore reason on the `@Ignore` above the DemoUserRestoreTest class/test to
include a ticket/issue ID (e.g., JIRA-1234 or GitHub issue number) and an
explicit re-enable condition or expiry (for example "re-enable when migrated to
LooperMode.PAUSED and Robolectric bumped" or a date), so the test won't be
orphaned—edit the `@Ignore` string literal to append the issue reference and the
re-enable condition.
🤖 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.

Nitpick comments:
In `@app/unit-tests/src/org/commcare/android/tests/DemoUserRestoreTest.java`:
- Around line 90-94: The `@Ignore` annotation on DemoUserRestoreTest.java
currently has a long reason but no tracked issue or re-enable condition; update
the ignore reason on the `@Ignore` above the DemoUserRestoreTest class/test to
include a ticket/issue ID (e.g., JIRA-1234 or GitHub issue number) and an
explicit re-enable condition or expiry (for example "re-enable when migrated to
LooperMode.PAUSED and Robolectric bumped" or a date), so the test won't be
orphaned—edit the `@Ignore` string literal to append the issue reference and the
re-enable condition.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 3fb7631e-0b44-4342-9006-3dd6763620c2

📥 Commits

Reviewing files that changed from the base of the PR and between 3daf861 and 6531b1c.

📒 Files selected for processing (6)
  • app/AndroidManifest.xml
  • app/build.gradle
  • app/src/org/commcare/google/services/analytics/FirebaseAnalyticsUtil.java
  • app/unit-tests/src/org/commcare/CommCareTestApplication.java
  • app/unit-tests/src/org/commcare/android/tests/DemoUserRestoreTest.java
  • build.gradle

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