Skip to content

Conversation

@paulb777
Copy link
Member

@paulb777 paulb777 commented Jan 7, 2026

Remove unnecessary ML Model Downloader telemetry along with the expensive swift-protobuf dependency.

Fix #15649

@gemini-code-assist
Copy link
Contributor

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

@paulb777
Copy link
Member Author

paulb777 commented Jan 7, 2026

/gemini review

@paulb777 paulb777 force-pushed the pb-mlkit-telemetry branch from 9f0d41f to 4d8be64 Compare January 7, 2026 04:09
@paulb777 paulb777 requested a review from a team as a code owner January 7, 2026 04:09
gemini-code-assist[bot]

This comment was marked as outdated.

@danger-firebase-ios
Copy link

1 Warning
⚠️ Did you forget to add a changelog entry? (Add #no-changelog to the PR description to silence this warning.)

Generated by 🚫 Danger

@paulb777
Copy link
Member Author

paulb777 commented Jan 7, 2026

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request successfully removes the legacy telemetry and the swift-protobuf dependency, which simplifies the codebase. The changes are mostly correct, but I've found a critical issue where a completion handler is no longer called in an error path, which could leave consumers of the API waiting indefinitely. Please see the specific comment for details.

@paulb777
Copy link
Member Author

paulb777 commented Jan 7, 2026

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request effectively removes the legacy telemetry from the ML Model Downloader. The changes are clean and focused, successfully eliminating the TelemetryLogger and all related calls across ModelDownloadTask, ModelDownloader, and ModelInfoRetriever. The removal of the swift-protobuf and GoogleDataTransport dependencies from the FirebaseMLModelDownloader target is a great improvement, as it reduces complexity and the overall binary size. The code modifications are straightforward and correctly implemented. Overall, this is a solid cleanup effort.

@paulb777
Copy link
Member Author

paulb777 commented Jan 7, 2026

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request effectively removes the legacy telemetry functionality from the ML Model Downloader, successfully eliminating the swift-protobuf and GoogleDataTransport dependencies. The changes are clean and consistent across all modified files, including ModelDownloadTask.swift, ModelDownloader.swift, and ModelInfoRetriever.swift. The removal of the TelemetryLogger.swift and associated protobuf files, along with the updates to Package.swift, completes the cleanup. This is a solid improvement that simplifies the codebase and reduces its dependency footprint.

@paulb777
Copy link
Member Author

paulb777 commented Jan 7, 2026

/gemini summarize

@gemini-code-assist
Copy link
Contributor

Summary of Changes

This pull request focuses on streamlining the ML Model Downloader by eradicating its outdated telemetry infrastructure. The primary goal is to reduce the project's dependency footprint and simplify the underlying code by removing unnecessary logging mechanisms and the swift-protobuf library that supported them. This change directly addresses an identified issue regarding superfluous telemetry.

Highlights

  • Telemetry Removal: The legacy telemetry logging system has been completely removed from the ML Model Downloader component, simplifying the codebase.
  • Dependency Reduction: The swift-protobuf dependency, which was previously used for telemetry, has been eliminated from the project.
  • Code Cleanup: Telemetry-related properties and method calls have been removed from ModelDownloadTask.swift, ModelDownloader.swift, and ModelInfoRetriever.swift.
  • File Deletion: Several files associated with the old telemetry system, including TelemetryLogger.swift and the protobuf definition files, have been deleted.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • FirebaseMLModelDownloader/Sources/ModelDownloadTask.swift
    • Removed the telemetryLogger property.
    • Eliminated all calls to telemetryLogger?.logModelDownloadEvent.
  • FirebaseMLModelDownloader/Sources/ModelDownloader.swift
    • Removed the telemetryLogger property.
    • Eliminated all calls to telemetryLogger?.logModelDownloadEvent and telemetryLogger?.logModelDeletedEvent.
  • FirebaseMLModelDownloader/Sources/ModelInfoRetriever.swift
    • Removed the telemetryLogger property.
    • Eliminated all calls to self.telemetryLogger?.logModelInfoRetrievalEvent.
  • FirebaseMLModelDownloader/Sources/TelemetryLogger.swift
    • File removed as part of telemetry system deprecation.
  • FirebaseMLModelDownloader/Sources/proto/firebase_ml_log_sdk.pb.swift
    • File removed, as it was a generated SwiftProtobuf file for telemetry.
  • FirebaseMLModelDownloader/Sources/proto/firebase_ml_log_sdk.proto
    • File removed, as it was the Protocol Buffer definition for telemetry.
  • Package.swift
    • Removed the swift-protobuf package dependency.
Activity
  • A bot comment was posted providing guidance on using Gemini Code Assist.
  • The author, paulb777, requested a review multiple times using the /gemini review command.
  • The danger-firebase-ios[bot] posted a warning about a potentially missing changelog entry.
  • Gemini Code Assist identified a critical issue: usages of TelemetryLogger in ModelDownloader.swift were not fully removed, specifically the telemetryLogger property and its calls.
  • Gemini Code Assist noted a high-priority issue: the testTelemetryEncoding unit test in ModelDownloaderUnitTests.swift became obsolete due to the removal of ModelOptions and SwiftProtobuf serialization methods.
  • Gemini Code Assist highlighted another high-priority issue: the testLogTelemetryEvent integration test in ModelDownloaderIntegrationTests.swift was obsolete and needed removal.
  • Gemini Code Assist found a critical bug: a completion handler call was accidentally removed in a catch block within ModelDownloader.swift, which could lead to client-side hangs or undefined behavior.

@paulb777 paulb777 requested review from ncooke3 and ryanwilson January 7, 2026 15:07
Copy link
Member

@ncooke3 ncooke3 left a comment

Choose a reason for hiding this comment

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

Nice! 2 non-blocking comments. Also, please add changelog entry.

Copy link
Contributor

@andrewheard andrewheard left a comment

Choose a reason for hiding this comment

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

Looks very good to me! 🚢

@paulb777 paulb777 added this to the 12.8.0 - M175 milestone Jan 7, 2026
@paulb777 paulb777 merged commit c993ea0 into main Jan 7, 2026
86 checks passed
@paulb777 paulb777 deleted the pb-mlkit-telemetry branch January 7, 2026 16:09
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.

Swift Package is very heavy - "Resolving Package Graph" takes ~19s

3 participants