Skip to content

Fix: Make metalavaSemver depend on copyApiTxtFile #7088

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rlazo
Copy link
Collaborator

@rlazo rlazo commented Jun 26, 2025

Explicitly wire the output of the copyApiTxtFile task (new_api.txt) to the input of the metalavaSemver task, ensuring the file is present before metalavaSemver runs.

Explicitly wire the output of the copyApiTxtFile task
(new_api.txt) to the input of the metalavaSemver task,
ensuring the file is present before metalavaSemver runs.
Copy link

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

Summary of Changes

Hello @rlazo, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request improves the reliability of the build process by formalizing a critical task dependency within the Gradle plugin. It ensures that a specific file, new_api.txt, is correctly generated and available before a subsequent task, metalavaSemver, attempts to consume it, preventing potential build failures due to missing or outdated inputs.

Highlights

  • Gradle Task Dependency: I've explicitly wired the metalavaSemver task's apiTxtFile input to depend on the output of the copyApiTxtFile task. This ensures that new_api.txt is guaranteed to be present and up-to-date before metalavaSemver attempts to use it.
  • Build Reliability: This change addresses a potential race condition or ordering issue, making the build process more robust and reliable by formalizing the dependency between these two critical tasks.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

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 is currently in preview and 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 to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

Firebase AI Mock Responses Check ⚠️

A newer major version of the mock responses for Firebase AI unit tests is available. update_responses.sh should be updated to clone the latest version of the responses: v14.1

@rlazo rlazo requested review from davidmotson and mrober June 26, 2025 22:16
Copy link

@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 fixes a Gradle task dependency issue by explicitly wiring the output of the copyApiTxtFile task to the input of the metalavaSemver task, ensuring the file is present before metalavaSemver runs. However, a critical logic issue was identified: the metalavaSemver task compares api.txt with a copy of itself, rendering the semantic versioning check ineffective.

Comment on lines 170 to +171
project.tasks.register<SemVerTask>("metalavaSemver") {
apiTxtFile.set(project.file("new_api.txt"))
apiTxtFile.set(copyApiTxtFileTask.flatMap { it.output })

Choose a reason for hiding this comment

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

critical

The metalavaSemver task is currently configured to compare api.txt with a copy of itself (new_api.txt). This makes the check ineffective as it will always pass without detecting API changes. To properly check for semantic versioning changes, the task should compare the API generated from the current source code against the checked-in api.txt file (representing the last released API).

Copy link
Contributor

Test Results

 1 058 files  +  904   1 058 suites  +904   36m 30s ⏱️ + 28m 36s
 5 985 tests +4 837   5 963 ✅ +4 816  22 💤 +21  0 ❌ ±0 
12 033 runs  +9 731  11 989 ✅ +9 689  44 💤 +42  0 ❌ ±0 

Results for commit 243a275. ± Comparison against base commit be2b6ed.

@google-oss-bot
Copy link
Contributor

@google-oss-bot
Copy link
Contributor

Coverage Report 1

Affected Products

  • firebase-appdistribution

    Overall coverage changed from ? (be2b6ed) to 75.72% (5c5ee13) by ?.

    68 individual files with coverage change

    FilenameBase (be2b6ed)Merge (5c5ee13)Diff
    AabUpdater.java?98.36%?
    AabUpdater_Factory.java?0.00%?
    ApkInstaller.java?100.00%?
    ApkInstaller_Factory.java?0.00%?
    ApkUpdater.java?92.63%?
    ApkUpdater_Factory.java?0.00%?
    AppDistributionReleaseImpl.java?100.00%?
    AppDistributionReleaseInternal.java?100.00%?
    AppDistroComponent.java?0.00%?
    AppDistroComponent_MainModule_BindContentResolverFactory.java?0.00%?
    AppIconSource.java?84.62%?
    AppIconSource_Factory.java?100.00%?
    AutoValue_AppDistributionReleaseImpl.java?65.45%?
    AutoValue_AppDistributionReleaseInternal.java?71.58%?
    AutoValue_ImageUtils_ImageSize.java?35.00%?
    AutoValue_TesterApiDisabledErrorDetails.java?29.41%?
    AutoValue_TesterApiDisabledErrorDetails_HelpLink.java?54.17%?
    AutoValue_UpdateProgressImpl.java?65.96%?
    DaggerAppDistroComponent.java?80.56%?
    DevModeDetector.java?9.09%?
    DevModeDetector_Factory.java?100.00%?
    ErrorMessages.java?0.00%?
    FeedbackActivity.java?3.39%?
    FeedbackActivity_MembersInjector.java?0.00%?
    FeedbackSender.java?84.48%?
    FeedbackSender_Factory.java?0.00%?
    FeedbackTrigger.java?61.54%?
    FirebaseAppDistributionExceptions.java?80.00%?
    FirebaseAppDistributionFileProvider.java?0.00%?
    FirebaseAppDistributionImpl.java?89.89%?
    FirebaseAppDistributionImpl_Factory.java?0.00%?
    FirebaseAppDistributionLifecycleNotifier.java?91.49%?
    FirebaseAppDistributionLifecycleNotifier_Factory.java?0.00%?
    FirebaseAppDistributionNotificationsManager.java?88.89%?
    FirebaseAppDistributionNotificationsManager_Factory.java?0.00%?
    FirebaseAppDistributionRegistrar.java?95.83%?
    FirebaseAppDistributionTesterApiClient.java?88.78%?
    FirebaseAppDistributionTesterApiClient_Factory.java?0.00%?
    HttpsUrlConnectionFactory.java?50.00%?
    HttpsUrlConnectionFactory_Factory.java?100.00%?
    ImageUtils.java?100.00%?
    InstallActivity.java?2.67%?
    LogWrapper.java?86.67%?
    NewReleaseFetcher.java?86.67%?
    NewReleaseFetcher_Factory.java?0.00%?
    PackageInfoUtils.java?42.86%?
    ReleaseIdentifier.java?91.78%?
    ReleaseIdentifier_Factory.java?0.00%?
    ReleaseUtils.java?83.33%?
    ScreenshotTaker.java?36.17%?
    ScreenshotTaker_Factory.java?0.00%?
    SequentialReference.java?100.00%?
    SignInResultActivity.java?0.00%?
    SignInStorage.java?100.00%?
    SignInStorage_Factory.java?0.00%?
    TakeScreenshotAndStartFeedbackActivity.java?0.00%?
    TakeScreenshotAndStartFeedbackActivity_MembersInjector.java?0.00%?
    TaskCache.java?100.00%?
    TaskCompletionSourceCache.java?72.41%?
    TaskUtils.java?77.50%?
    TesterApiDisabledErrorDetails.java?93.75%?
    TesterApiHttpClient.java?90.09%?
    TesterApiHttpClient_Factory.java?0.00%?
    TesterSignInManager.java?89.41%?
    TesterSignInManager_Factory.java?0.00%?
    UpdateProgressImpl.java?100.00%?
    UpdateTaskCache.java?91.30%?
    UpdateTaskImpl.java?76.32%?

  • firebase-config

    Overall coverage changed from ? (be2b6ed) to 84.31% (5c5ee13) by ?.

    34 individual files with coverage change

    FilenameBase (be2b6ed)Merge (5c5ee13)Diff
    AutoValue_ConfigUpdate.java?29.41%?
    Code.java?0.00%?
    ConfigAutoFetch.java?86.73%?
    ConfigCacheClient.java?93.33%?
    ConfigContainer.java?94.29%?
    ConfigFetchHandler.java?92.94%?
    ConfigFetchHttpClient.java?86.27%?
    ConfigGetParameterHandler.java?96.45%?
    ConfigRealtimeHandler.java?41.38%?
    ConfigRealtimeHttpClient.java?73.57%?
    ConfigSharedPrefsClient.java?87.50%?
    ConfigStorageClient.java?100.00%?
    ConfigUpdate.java?100.00%?
    ConfigUpdateListener.java?0.00%?
    ConfigUpdateListenerRegistration.java?0.00%?
    CustomSignals.java?100.00%?
    DefaultsXmlParser.java?0.00%?
    FirebaseRemoteConfig.java?89.76%?
    FirebaseRemoteConfigClientException.java?75.00%?
    FirebaseRemoteConfigException.java?95.65%?
    FirebaseRemoteConfigFetchThrottledException.java?100.00%?
    FirebaseRemoteConfigInfo.java?0.00%?
    FirebaseRemoteConfigInfoImpl.java?100.00%?
    FirebaseRemoteConfigServerException.java?68.42%?
    FirebaseRemoteConfigSettings.java?61.54%?
    FirebaseRemoteConfigValue.java?0.00%?
    FirebaseRemoteConfigValueImpl.java?84.62%?
    Personalization.java?91.43%?
    RemoteConfig.kt?31.58%?
    RemoteConfigComponent.java?90.70%?
    RemoteConfigConstants.java?0.00%?
    RemoteConfigRegistrar.java?100.00%?
    RolloutsStateFactory.java?95.24%?
    RolloutsStateSubscriptionsHandler.java?100.00%?

  • firebase-firestore

    Overall coverage changed from 45.77% (be2b6ed) to 45.78% (5c5ee13) by +0.01%.

    FilenameBase (be2b6ed)Merge (5c5ee13)Diff
    DeleteMutation.java90.48%95.24%+4.76%
    SetMutation.java94.44%97.22%+2.78%
  • firebase-messaging

    Overall coverage changed from 84.13% (be2b6ed) to 84.10% (5c5ee13) by -0.04%.

    FilenameBase (be2b6ed)Merge (5c5ee13)Diff
    FirebaseMessaging.java76.00%75.60%-0.40%
  • firebase-ml-modeldownloader

    Overall coverage changed from ? (be2b6ed) to 82.11% (5c5ee13) by ?.

    36 individual files with coverage change

    FilenameBase (be2b6ed)Merge (5c5ee13)Diff
    AutoFirebaseMlLogEventEncoder.java?100.00%?
    AutoValue_FirebaseMlLogEvent.java?56.60%?
    AutoValue_FirebaseMlLogEvent_DeleteModelLogEvent.java?58.33%?
    AutoValue_FirebaseMlLogEvent_ModelDownloadLogEvent.java?56.96%?
    AutoValue_FirebaseMlLogEvent_ModelDownloadLogEvent_ModelOptions.java?60.00%?
    AutoValue_FirebaseMlLogEvent_ModelDownloadLogEvent_ModelOptions_ModelInfo.java?56.25%?
    AutoValue_FirebaseMlLogEvent_SystemInfo.java?54.93%?
    CustomModel.java?72.13%?
    CustomModelDownloadConditions.java?88.46%?
    CustomModelDownloadService.java?79.89%?
    CustomModelDownloadService_Factory.java?0.00%?
    CustomModel_Factory.java?0.00%?
    CustomModel_Factory_Impl.java?0.00%?
    DaggerModelDownloaderComponent.java?100.00%?
    DataTransportMlEventSender.java?100.00%?
    DataTransportMlEventSender_Factory.java?0.00%?
    DownloadType.java?100.00%?
    FirebaseMlException.java?100.00%?
    FirebaseMlLogEvent.java?97.92%?
    FirebaseMlLogger.java?88.89%?
    FirebaseMlLogger_Factory.java?0.00%?
    FirebaseModelDownloader.java?84.66%?
    FirebaseModelDownloaderRegistrar.java?100.00%?
    FirebaseModelDownloader_Factory.java?0.00%?
    ModelDownloader.kt?91.67%?
    ModelDownloaderComponent.java?25.00%?
    ModelDownloaderComponent_MainModule_AppPackageNameFactory.java?0.00%?
    ModelDownloaderComponent_MainModule_AppVersionCodeFactory.java?0.00%?
    ModelDownloaderComponent_MainModule_FirebaseOptionsFactory.java?0.00%?
    ModelDownloaderComponent_MainModule_PersistenceKeyFactory.java?0.00%?
    ModelFileDownloadService.java?88.46%?
    ModelFileDownloadService_Factory.java?0.00%?
    ModelFileManager.java?82.28%?
    ModelFileManager_Factory.java?0.00%?
    SharedPreferencesUtil.java?97.26%?
    SharedPreferencesUtil_Factory.java?0.00%?

  • firebase-storage

    Overall coverage changed from 84.33% (be2b6ed) to 84.37% (5c5ee13) by +0.04%.

    FilenameBase (be2b6ed)Merge (5c5ee13)Diff
    NetworkRequest.java87.29%87.85%+0.55%

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/buIzUA9iPP.html

@google-oss-bot
Copy link
Contributor

Startup Time Report 1

The report is too large (122,601 chars) to be displayed on GitHub. Please check this report on GCS.

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/M8HwP9xnAC/index.html

@rlazo rlazo requested review from emilypgoogle and removed request for davidmotson June 27, 2025 01:45
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.

2 participants