Deprecate Firebase ML Model Downloader#8424
Conversation
📝 PRs merging into main branchOur main branch should always be in a releasable state. If you are working on a larger change, or if you don't want this change to see the light of the day just yet, consider using a feature branch first, and only merge into the main branch when the code complete and ready to be released. |
Using Gemini Code AssistThe 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
Customization To customize the 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 Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. 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. |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request deprecates the Firebase ML Model Downloader library, adding deprecation notices to the CHANGELOG and applying @Deprecated annotations and Javadoc updates across Java and Kotlin files. The review feedback suggests extracting the repeated deprecation message in ModelDownloader.kt into a single private constant to avoid code duplication and improve maintainability.
| @Deprecated( | ||
| "Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage" | ||
| ) | ||
| val Firebase.modelDownloader: FirebaseModelDownloader | ||
| get() = FirebaseModelDownloader.getInstance() | ||
|
|
||
| /** Returns the [FirebaseModelDownloader] instance of a given [FirebaseApp]. */ | ||
| @Deprecated( | ||
| "Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage" | ||
| ) | ||
| fun Firebase.modelDownloader(app: FirebaseApp) = FirebaseModelDownloader.getInstance(app) | ||
|
|
||
| /** Returns a [CustomModelDownloadConditions] initialized using the [init] function. */ | ||
| @Deprecated( | ||
| "Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage" | ||
| ) |
There was a problem hiding this comment.
The long deprecation message is repeated multiple times in this file. To improve maintainability and adhere to the DRY (Don't Repeat Yourself) principle, we can extract this message into a private const val at the top of the file and reference it in all @Deprecated annotations.
| @Deprecated( | |
| "Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage" | |
| ) | |
| val Firebase.modelDownloader: FirebaseModelDownloader | |
| get() = FirebaseModelDownloader.getInstance() | |
| /** Returns the [FirebaseModelDownloader] instance of a given [FirebaseApp]. */ | |
| @Deprecated( | |
| "Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage" | |
| ) | |
| fun Firebase.modelDownloader(app: FirebaseApp) = FirebaseModelDownloader.getInstance(app) | |
| /** Returns a [CustomModelDownloadConditions] initialized using the [init] function. */ | |
| @Deprecated( | |
| "Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage" | |
| ) | |
| private const val DEPRECATION_MESSAGE = | |
| "Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage" | |
| @Deprecated(DEPRECATION_MESSAGE) | |
| val Firebase.modelDownloader: FirebaseModelDownloader | |
| get() = FirebaseModelDownloader.getInstance() | |
| /** Returns the [FirebaseModelDownloader] instance of a given [FirebaseApp]. */ | |
| @Deprecated(DEPRECATION_MESSAGE) | |
| fun Firebase.modelDownloader(app: FirebaseApp) = FirebaseModelDownloader.getInstance(app) | |
| /** Returns a [CustomModelDownloadConditions] initialized using the [init] function. */ | |
| @Deprecated(DEPRECATION_MESSAGE) |
| @Deprecated( | ||
| "Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage" | ||
| ) | ||
| operator fun CustomModel.component1(): File? = file | ||
|
|
||
| @Deprecated( | ||
| "Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage" | ||
| ) | ||
| operator fun CustomModel.component2() = size | ||
|
|
||
| @Deprecated( | ||
| "Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage" | ||
| ) | ||
| operator fun CustomModel.component3() = downloadId | ||
|
|
||
| @Deprecated( | ||
| "Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage" | ||
| ) | ||
| operator fun CustomModel.component4() = modelHash | ||
|
|
||
| @Deprecated( | ||
| "Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage" | ||
| ) |
There was a problem hiding this comment.
Use the newly defined DEPRECATION_MESSAGE constant here as well to eliminate duplication.
| @Deprecated( | |
| "Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage" | |
| ) | |
| operator fun CustomModel.component1(): File? = file | |
| @Deprecated( | |
| "Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage" | |
| ) | |
| operator fun CustomModel.component2() = size | |
| @Deprecated( | |
| "Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage" | |
| ) | |
| operator fun CustomModel.component3() = downloadId | |
| @Deprecated( | |
| "Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage" | |
| ) | |
| operator fun CustomModel.component4() = modelHash | |
| @Deprecated( | |
| "Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage" | |
| ) | |
| @Deprecated(DEPRECATION_MESSAGE) | |
| operator fun CustomModel.component1(): File? = file | |
| @Deprecated(DEPRECATION_MESSAGE) | |
| operator fun CustomModel.component2() = size | |
| @Deprecated(DEPRECATION_MESSAGE) | |
| operator fun CustomModel.component3() = downloadId | |
| @Deprecated(DEPRECATION_MESSAGE) | |
| operator fun CustomModel.component4() = modelHash | |
| @Deprecated(DEPRECATION_MESSAGE) |
Deprecate the FirebaseMLModelDownloader library within the Firebase Android SDK, reflecting its scheduled shutdown on June 15, 2027.
All public API symbols have been marked with
@Deprecatedand a corresponding javadoc description.Added a deprecation notice to the changelog.
Further steps to remove the library and prevent release are not in scope of initial deprecation.